Use package module to install distro packages
Consolidate distro package install tasks into a single task using the package module and pass the package list into the name instead of using a with_items loop. Change-Id: Ia410f29e53764bebe5dbe096d441cdc78d336e64
This commit is contained in:
parent
8a4729de24
commit
23a7eb6493
@ -46,29 +46,13 @@
|
|||||||
- openrc
|
- openrc
|
||||||
|
|
||||||
post_tasks:
|
post_tasks:
|
||||||
- name: Update apt sources
|
|
||||||
apt:
|
|
||||||
update_cache: yes
|
|
||||||
cache_valid_time: 600
|
|
||||||
register: apt_update
|
|
||||||
until: apt_update|success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
when: ansible_pkg_mgr == 'apt'
|
|
||||||
|
|
||||||
- name: Install apt packages
|
- name: Install distro packages
|
||||||
apt:
|
package:
|
||||||
pkg: "{{ item }}"
|
name: "{{ utility_distro_packages | default([]) }}"
|
||||||
state: "{{ utility_package_state }}"
|
state: "{{ utility_package_state }}"
|
||||||
with_items: "{{ utility_distro_packages | default([]) }}"
|
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
|
||||||
when: ansible_pkg_mgr == 'apt'
|
cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}"
|
||||||
|
|
||||||
- name: Install yum packages
|
|
||||||
yum:
|
|
||||||
pkg: "{{ item }}"
|
|
||||||
state: "{{ utility_package_state }}"
|
|
||||||
with_items: "{{ utility_distro_packages | default([]) }}"
|
|
||||||
when: ansible_pkg_mgr == 'yum'
|
|
||||||
|
|
||||||
- name: Get list of python clients
|
- name: Get list of python clients
|
||||||
shell: "curl -s {{ repo_release_path }}/requirements_absolute_requirements.txt | grep client | cut -d'=' -f1"
|
shell: "curl -s {{ repo_release_path }}/requirements_absolute_requirements.txt | grep client | cut -d'=' -f1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user