|
124 | 124 | - gateway_build_packages is iterable |
125 | 125 | - gateway_build_packages | length > 0 |
126 | 126 |
|
127 | | - - name: Install Gateway build packages (offline) |
128 | | - when: offline_install_enabled | bool |
129 | | - block: |
130 | | - - name: Install Gateway build packages (offline) |
131 | | - ansible.builtin.import_role: |
132 | | - name: offline |
133 | | - tasks_from: install-rpms |
134 | | - vars: |
135 | | - offline_rpms_path: "{{ gateway_offline_control_node_rpms_dir }}/build" |
136 | | - |
137 | | - # Build a list of installed build packages. The rpm_list variable is registered in the |
138 | | - # offline install-rpms. |
139 | | - - name: Set Gateway build package list |
140 | | - ansible.builtin.set_fact: |
141 | | - gateway_installed_build_package_list: |
142 | | - "{{ gateway_installed_build_package_list | default([]) + |
143 | | - [item | basename | split('.el') | first] }}" |
144 | | - with_items: "{{ rpm_list.files | map(attribute='path') | list | sort }}" |
145 | | - when: |
146 | | - - rpm_list is defined |
147 | | - - rpm_list is iterable |
148 | | - - rpm_list | length > 0 |
149 | | - |
150 | | - # Build a list of build packages that need to be removed later. We don't want to remove |
151 | | - # all of the installed build packages, only the ones that are in the gateway_build_packages |
152 | | - # and gateway_installed_build_package_list. |
153 | | - - name: Set Gateway build package remove list |
154 | | - ansible.builtin.set_fact: |
155 | | - gateway_build_package_remove_list: |
156 | | - "{{ gateway_build_package_remove_list | default([]) + [item] }}" |
157 | | - with_items: "{{ gateway_build_packages }}" |
158 | | - when: gateway_installed_build_package_list | select('search', item | regex_escape) | list | length > 0 |
159 | | - |
160 | 127 | - name: Install Python dependencies |
161 | 128 | tags: install_python_dependencies |
162 | 129 | block: |
|
165 | 132 | file: install-python-dependencies.yml |
166 | 133 |
|
167 | 134 | # Need to install ansible within the virtual environment |
168 | | - - name: Install Ansible |
169 | | - tags: install_ansible |
| 135 | + - name: Configure Ansible |
| 136 | + tags: configure_ansible |
170 | 137 | when: gateway_enable_ansible | bool |
171 | 138 | block: |
172 | | - - name: Install Ansible and Ansible collections |
| 139 | + - name: Install Ansible collections |
173 | 140 | when: not offline_install_enabled | bool |
174 | 141 | block: |
175 | | - - name: Install Ansible into the python virtual environment |
176 | | - ansible.builtin.pip: |
177 | | - name: "{{ gateway_ansible_version }}" |
178 | | - virtualenv: "{{ gateway_install_dir }}/venv" |
179 | | - |
180 | 142 | - name: Install collections |
181 | 143 | ansible.builtin.command: |
182 | 144 | argv: |
|
279 | 241 | virtualenv: "{{ gateway_install_dir }}/venv" |
280 | 242 | when: not offline_install_enabled | bool |
281 | 243 |
|
282 | | - - name: Install IAG (offline) |
283 | | - ansible.builtin.include_role: |
284 | | - name: offline |
285 | | - tasks_from: install-wheels |
286 | | - vars: |
287 | | - offline_wheels_dir: "{{ gateway_offline_control_node_wheels_dir }}/gateway" |
288 | | - offline_python_venv: "{{ gateway_python_venv }}" |
289 | | - when: offline_install_enabled | bool |
290 | | - |
291 | 244 | - name: Set ownership/permissions and create properties.yml |
292 | 245 | when: not gateway_installed.stat.exists |
293 | 246 | block: |
|
423 | 376 | - gateway_build_packages_result.results is iterable |
424 | 377 | - gateway_build_packages_result.results | length > 0 |
425 | 378 |
|
426 | | - - name: Uninstall Gateway build packages (offline) |
427 | | - when: offline_install_enabled | bool |
428 | | - block: |
429 | | - - name: Get list of yum repos (to disable temporarily) # noqa command-instead-of-module |
430 | | - ansible.builtin.command: yum -q repolist |
431 | | - register: gateway_repolist_result |
432 | | - changed_when: false |
433 | | - |
434 | | - - name: Uninstall Gateway build packages (offline) |
435 | | - ansible.builtin.dnf: |
436 | | - name: "{{ gateway_build_package_remove_list }}" |
437 | | - state: absent |
438 | | - enablerepo: [] |
439 | | - disablerepo: "{{ gateway_repolist_result.stdout_lines[1:] | map('split', ' ') |
440 | | - | map('first') | list }}" |
441 | | - when: |
442 | | - - gateway_build_package_remove_list is defined |
443 | | - - gateway_build_package_remove_list | length > 0 |
444 | | - |
445 | 379 | - name: Assert that Gateway is running |
446 | 380 | ansible.builtin.systemd: |
447 | 381 | name: automation-gateway |
|
0 commit comments