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
|
|
|
|
blocks:
|
|
|
|
- name: Create Package installation list
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
l3d_pkgs__install: "{{ l3d_pkgs__base }}"
|
|
|
|
|
|
|
|
- name: Adding Advances Packages to installation list
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
l3d_pkgs__install: "{{ l3d_pkgs__install | ansible.builtin.combine(l3d_pkgs__advanced) }}"
|
|
|
|
when:
|
|
|
|
l3d_pkgs__install_advanced | bool
|
|
|
|
|
|
|
|
- name: Adding Python Packages to installation list
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
l3d_pkgs__install: "{{ l3d_pkgs__install | ansible.builtin.combine(l3d_pkgs__python) }}"
|
|
|
|
when:
|
|
|
|
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:
|
|
|
|
l3d_pkgs__install: "{{ l3d_pkgs__base | ansible.builtin.combine(l3d_pkgs__cli) }}"
|
|
|
|
when:
|
|
|
|
l3d_pkgs__install_cli | bool
|
|
|
|
|
|
|
|
- name: Adding extra Packages to installation list
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
l3d_pkgs__install: "{{ l3d_pkgs__base | ansible.builtin.combine(l3d_pkgs__install_extra_packages) }}"
|
|
|
|
|
|
|
|
- name: Show l3d_pkgs__install on verbose run
|
|
|
|
ansible.builtin.debug:
|
|
|
|
msg: "{{ l3d_pkgs__install }}"
|
|
|
|
verbosity: 1
|
|
|
|
rescue:
|
|
|
|
ansible.builtin.fail:
|
|
|
|
msg: "Error creating list of packages for installation. Created list: {{ l3d_pkgs__install }}"
|
|
|
|
|
|
|
|
- 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 }}"
|
|
|
|
with_items: "{{ l3d_pkgs__install }}"
|