2021-12-14 10:26:42 +00:00
|
|
|
---
|
2022-02-15 12:14:36 +00:00
|
|
|
- name: Set facts
|
2022-02-24 14:00:10 +00:00
|
|
|
ansible.builtin.set_fact:
|
2021-12-14 10:26:42 +00:00
|
|
|
update_cache: true
|
|
|
|
packages_to_install: []
|
|
|
|
|
|
|
|
- name: "Check packages to be installed"
|
2022-02-24 14:00:10 +00:00
|
|
|
ansible.builtin.include_tasks: check.yml
|
2021-12-14 10:26:42 +00:00
|
|
|
loop: "{{ packages_list | flatten }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: package_name
|
|
|
|
|
|
|
|
- name: "Install packages: {{ packages_to_install }}"
|
|
|
|
become: yes
|
2022-02-24 14:00:10 +00:00
|
|
|
ansible.builtin.yum:
|
2021-12-14 10:26:42 +00:00
|
|
|
name: "{{ packages_to_install }}"
|
|
|
|
state: present
|
|
|
|
when: packages_to_install | length > 0
|