From 40b5321f8dedbbde91a3734ba7178134a19cc708 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sun, 29 Dec 2024 11:21:06 +0100 Subject: [PATCH] dd --- roles/mgrote_apt_manage_packages/README.md | 5 +---- .../defaults/main.yml | 1 - roles/mgrote_apt_manage_packages/tasks/main.yml | 17 +++++------------ 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/roles/mgrote_apt_manage_packages/README.md b/roles/mgrote_apt_manage_packages/README.md index 7d193e2c..2354d70e 100644 --- a/roles/mgrote_apt_manage_packages/README.md +++ b/roles/mgrote_apt_manage_packages/README.md @@ -1,6 +1,7 @@ ## mgrote.apt_manage_packages ### Beschreibung + Fuehrt: `apt install {{ programme }}` aus. @@ -13,10 +14,6 @@ aus. - nur in VMs apt_packages_extra: - Extra-Parameter für einzelne Hosts - apt_packages_internet: - - für URLs - - http://docker10.mgrote.net:3344/bash-helper-scripts-mgrote-latest.deb - ``` Es wird unterschieden ob das Ziel eine VM ist oder nicht. diff --git a/roles/mgrote_apt_manage_packages/defaults/main.yml b/roles/mgrote_apt_manage_packages/defaults/main.yml index 6afe8b53..b1f2da5d 100644 --- a/roles/mgrote_apt_manage_packages/defaults/main.yml +++ b/roles/mgrote_apt_manage_packages/defaults/main.yml @@ -32,4 +32,3 @@ apt_packages_vm: - open-vm-tools apt_packages_extra: apt_packages_absent: -apt_packages_internet: diff --git a/roles/mgrote_apt_manage_packages/tasks/main.yml b/roles/mgrote_apt_manage_packages/tasks/main.yml index 786817b9..5fa0d424 100644 --- a/roles/mgrote_apt_manage_packages/tasks/main.yml +++ b/roles/mgrote_apt_manage_packages/tasks/main.yml @@ -1,39 +1,32 @@ --- -- name: install common-packages +- name: Ensure common-packages are installed become: true ansible.builtin.package: name: "{{ apt_packages_common }}" state: present -- name: install extra-packages +- name: Ensure extra-packages are installed become: true ansible.builtin.package: name: "{{ apt_packages_extra }}" state: present when: apt_packages_extra is defined -- name: install vm-packages +- name: Ensure vm-packages are installed become: true ansible.builtin.package: name: "{{ apt_packages_vm }}" state: present when: ansible_virtualization_role == 'guest' -- name: install physical-packages +- name: Ensure physical-packages are installed become: true ansible.builtin.package: name: "{{ apt_packages_physical }}" state: present when: ansible_virtualization_role != 'guest' -- name: install packages from the internet - become: true - ansible.builtin.apt: - deb: "{{ apt_packages_internet }}" - state: present - when: apt_packages_internet is defined - -- name: remove packages +- name: Ensure packages are removed become: true ansible.builtin.package: name: "{{ apt_packages_absent }}"