2020-08-28 13:32:16 +02:00
|
|
|
---
|
2023-07-31 16:45:00 +02:00
|
|
|
- name: Update apt repo-cache on debian/ubuntu hosts
|
2020-11-11 00:39:13 +01:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.apt:
|
2021-01-18 10:47:52 +01:00
|
|
|
update_cache: true
|
2020-11-11 01:23:46 +01:00
|
|
|
cache_valid_time: 3600
|
2020-11-11 00:39:13 +01:00
|
|
|
when:
|
2021-03-12 22:18:54 +01:00
|
|
|
- ansible_pkg_mgr == "apt"
|
2020-11-11 00:39:13 +01:00
|
|
|
|
2023-07-31 16:45:00 +02:00
|
|
|
- name: Update dnf repo-cache on RHEL/Fedora hosts
|
2020-11-11 00:39:13 +01:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.dnf:
|
2021-01-18 10:47:52 +01:00
|
|
|
update_cache: true
|
2020-11-11 00:39:13 +01:00
|
|
|
when:
|
2020-11-11 11:11:17 +01:00
|
|
|
- ansible_os_family == 'RedHat' and ansible_distribution_version | float >= 8
|
2020-11-11 00:39:13 +01:00
|
|
|
|
2023-07-31 16:45:00 +02:00
|
|
|
- name: Create Package installation list
|
2023-07-31 18:18:04 +02:00
|
|
|
block:
|
2023-07-31 16:45:00 +02:00
|
|
|
- name: Adding Advances Packages to installation list
|
|
|
|
ansible.builtin.set_fact:
|
2023-07-31 18:18:04 +02:00
|
|
|
l3d_pkgs__advanced: []
|
2023-07-31 16:45:00 +02:00
|
|
|
when:
|
2023-07-31 18:18:04 +02:00
|
|
|
not l3d_pkgs__install_advanced | bool
|
2023-07-31 16:45:00 +02:00
|
|
|
|
|
|
|
- name: Adding Python Packages to installation list
|
|
|
|
ansible.builtin.set_fact:
|
2023-07-31 18:18:04 +02:00
|
|
|
ll3d_pkgs__python: []
|
2023-07-31 16:45:00 +02:00
|
|
|
when:
|
2023-07-31 18:18:04 +02:00
|
|
|
not l3d_pkgs__install_python | bool
|
2020-08-28 13:32:16 +02:00
|
|
|
|
2023-07-31 16:45:00 +02:00
|
|
|
- name: Adding CLI Packages to installation list
|
|
|
|
ansible.builtin.set_fact:
|
2023-07-31 18:18:04 +02:00
|
|
|
l3d_pkgs__cli: []
|
2023-07-31 16:45:00 +02:00
|
|
|
when:
|
2023-07-31 18:18:04 +02:00
|
|
|
not l3d_pkgs__install_cli | bool
|
2023-07-31 16:45:00 +02:00
|
|
|
|
2023-07-31 18:18:04 +02:00
|
|
|
- name: Combine Lists
|
2023-07-31 16:45:00 +02:00
|
|
|
ansible.builtin.set_fact:
|
2023-07-31 18:18:04 +02:00
|
|
|
l3d_pkgs__install: "{{ l3d_pkgs__base + l3d_pkgs__advanced + l3d_pkgs__python + l3d_pkgs__cli + l3d_pkgs__install_extra_packages }}"
|
2023-07-31 16:45:00 +02:00
|
|
|
|
|
|
|
- name: Show l3d_pkgs__install on verbose run
|
|
|
|
ansible.builtin.debug:
|
|
|
|
msg: "{{ l3d_pkgs__install }}"
|
|
|
|
verbosity: 1
|
|
|
|
rescue:
|
2023-07-31 18:18:04 +02:00
|
|
|
- name: Show l3d_pkgs__install on verbose run
|
|
|
|
ansible.builtin.debug:
|
|
|
|
msg: "{{ l3d_pkgs__install }}"
|
|
|
|
verbosity: 1
|
|
|
|
|
|
|
|
- name: Error Info
|
|
|
|
ansible.builtin.fail:
|
|
|
|
msg: "Error creating list of packages for installation."
|
2023-07-31 16:45:00 +02:00
|
|
|
|
|
|
|
- name: Install selected Packages
|
2020-08-29 15:00:05 +02:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.package:
|
2023-07-31 16:45:00 +02:00
|
|
|
name: "{{ item }}"
|
|
|
|
state: "{{ l3d_pkgs__package_state }}"
|
2023-08-01 21:27:00 +02:00
|
|
|
loop: "{{ l3d_pkgs__install | flatten(1) }}"
|