|
1 | 1 | # Ansible playbook to start the pulp service container and its supporting services |
2 | 2 | --- |
3 | | -- hosts: "localhost" |
| 3 | +- name: "Start CI Containers" |
| 4 | + hosts: "localhost" |
4 | 5 | gather_facts: false |
5 | 6 | vars_files: |
6 | 7 | - "vars/main.yaml" |
|
14 | 15 | - "settings" |
15 | 16 |
|
16 | 17 | - name: "Generate Pulp Settings" |
17 | | - template: |
| 18 | + ansible.builtin.template: |
18 | 19 | src: "settings.py.j2" |
19 | 20 | dest: "settings/settings.py" |
20 | 21 |
|
21 | 22 | - name: "Setup docker networking" |
22 | | - docker_network: |
| 23 | + community.docker.docker_network: |
23 | 24 | name: "pulp_ci_bridge" |
24 | 25 |
|
25 | 26 | - name: "Start Service Containers" |
26 | | - docker_container: |
| 27 | + community.docker.docker_container: |
27 | 28 | name: "{{ item.name }}" |
28 | 29 | image: "{{ item.image }}" |
29 | 30 | auto_remove: true |
|
39 | 40 | loop: "{{ services | default([]) }}" |
40 | 41 |
|
41 | 42 | - name: "Retrieve Docker Network Info" |
42 | | - docker_network_info: |
| 43 | + community.docker.docker_network_info: |
43 | 44 | name: "pulp_ci_bridge" |
44 | 45 | register: "pulp_ci_bridge_info" |
45 | 46 |
|
46 | 47 | - name: "Update /etc/hosts" |
47 | | - lineinfile: |
| 48 | + ansible.builtin.lineinfile: |
48 | 49 | path: "/etc/hosts" |
49 | 50 | regexp: "\\s{{ item.value.Name }}\\s*$" |
50 | 51 | line: "{{ item.value.IPv4Address | ansible.utils.ipaddr('address') }}\t{{ item.value.Name }}" |
|
61 | 62 | state: "present" |
62 | 63 | when: "s3_test | default(false)" |
63 | 64 |
|
64 | | - - block: |
| 65 | + - name: "Wait on Services" |
| 66 | + block: |
65 | 67 | - name: "Wait for azurite" |
66 | 68 | ansible.builtin.uri: |
67 | 69 | url: "http://ci-azurite:10000/" |
|
83 | 85 | delay: 5 |
84 | 86 | rescue: |
85 | 87 | - name: "Output pulp container log" |
86 | | - command: "docker logs pulp" |
| 88 | + ansible.builtin.command: |
| 89 | + cmd: "docker logs pulp" |
87 | 90 | failed_when: true |
88 | 91 |
|
89 | 92 | - name: "Check version of component being tested" |
90 | | - assert: |
| 93 | + ansible.builtin.assert: |
91 | 94 | that: |
92 | 95 | - "(result.json.versions | items2dict(key_name='component', value_name='version'))[item.app_label] | canonical_semver == (component_version | canonical_semver)" |
93 | 96 | fail_msg: | |
|
96 | 99 | loop: "{{ 'plugins' | ansible.builtin.extract(lookup('ansible.builtin.file', '../../template_config.yml') | from_yaml) }}" |
97 | 100 |
|
98 | 101 | - name: "Set pulp password in .netrc" |
99 | | - copy: |
| 102 | + ansible.builtin.copy: |
100 | 103 | dest: "~/.netrc" |
101 | 104 | content: | |
102 | 105 | machine pulp |
103 | 106 | login admin |
104 | 107 | password password |
105 | 108 |
|
106 | | -- hosts: "pulp" |
| 109 | +- name: "Prepare Pulp Application Container" |
| 110 | + hosts: "pulp" |
107 | 111 | gather_facts: false |
108 | 112 | tasks: |
109 | 113 | - name: "Create directory for pulp-smash config" |
|
118 | 122 | dest: "/var/lib/pulp/.config/pulp_smash/settings.json" |
119 | 123 |
|
120 | 124 | - name: "Set pulp admin password" |
121 | | - command: |
| 125 | + ansible.builtin.command: |
122 | 126 | cmd: "pulpcore-manager reset-admin-password --password password" |
123 | 127 | ... |
0 commit comments