From 2db773f15a3a0e50e6a7e39bde537bbfcbdf51d9 Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Wed, 30 Aug 2023 20:28:20 -0500 Subject: [PATCH] install-packages: become, add more pkgs --- roles/install-packages/defaults/main.yml | 2 ++ roles/install-packages/tasks/deb.yml | 1 + roles/install-packages/tasks/el.yml | 1 + roles/install-packages/tasks/main.yml | 15 +-------------- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/roles/install-packages/defaults/main.yml b/roles/install-packages/defaults/main.yml index 3369ece..b1b5ca0 100644 --- a/roles/install-packages/defaults/main.yml +++ b/roles/install-packages/defaults/main.yml @@ -22,5 +22,7 @@ EL_PKGS: - wget - cockpit - ioping + - kitty-terminfo + - dnf-plugin-system-upgrade DEB_PKGS: - dnsutils diff --git a/roles/install-packages/tasks/deb.yml b/roles/install-packages/tasks/deb.yml index 83608f6..fbe758e 100644 --- a/roles/install-packages/tasks/deb.yml +++ b/roles/install-packages/tasks/deb.yml @@ -1,6 +1,7 @@ --- - name: install packages (Debian/Ubuntu) + become: true package: name: "{{ (COMMON_PKGS + DEB_PKGS) | difference(ansible_facts.packages) }}" state: present diff --git a/roles/install-packages/tasks/el.yml b/roles/install-packages/tasks/el.yml index 82128b4..34d6211 100644 --- a/roles/install-packages/tasks/el.yml +++ b/roles/install-packages/tasks/el.yml @@ -1,6 +1,7 @@ --- - name: install packages (EPEL/Fedora) + become: true package: name: "{{ (COMMON_PKGS + EL_PKGS) | difference(ansible_facts.packages) }}" state: present diff --git a/roles/install-packages/tasks/main.yml b/roles/install-packages/tasks/main.yml index 72c4982..cef579f 100644 --- a/roles/install-packages/tasks/main.yml +++ b/roles/install-packages/tasks/main.yml @@ -2,19 +2,6 @@ - include_tasks: deb.yml when: ansible_distribution in ["Debian", "Ubuntu"] - + - include_tasks: el.yml when: ansible_distribution in ["CentOS" , "Red Hat Enterprise Linux", "RedHat", "Fedora"] and not is_atomic - -# Need an idempotent way to install packages on atomic -# command module isn't idempotent and the package module insists on installing containers. - -#- name: install packages (fedora - atomic) -# command: rpm-ostree install '{{ item }}' -# with_items: -# - htop -# - vim -# - iperf3 -# - strace -# - nmap -# when: ansible_distribution == 'Fedora' and is_atomic