From ddae32ea0a7c92f55178b6934303bbe1735106c7 Mon Sep 17 00:00:00 2001 From: mg Date: Sat, 27 Nov 2021 23:39:02 +0100 Subject: [PATCH] installiere *.deb aus dem Internet (#256) Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/256 Co-authored-by: mg Co-committed-by: mg --- group_vars/all.yml | 3 ++- roles/mgrote.apt_manage_packages/README.md | 15 ++++++++------- .../mgrote.apt_manage_packages/defaults/main.yml | 1 + roles/mgrote.apt_manage_packages/tasks/main.yml | 8 ++++++++ 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 475a4762..d1e38fd1 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -205,7 +205,6 @@ - apt-transport-https - neofetch - moreutils - - ntpdate - acl - vim - rsync @@ -223,6 +222,8 @@ - open-vm-tools apt_packages_absent: - nano + apt_packages_internet: + - https://git.mgrote.net/mg/bash-helper-scripts-mgrote/raw/branch/master/output/bash-helper-scripts-mgrote-latest.deb diff --git a/roles/mgrote.apt_manage_packages/README.md b/roles/mgrote.apt_manage_packages/README.md index b0c7a234..1b3a76ee 100644 --- a/roles/mgrote.apt_manage_packages/README.md +++ b/roles/mgrote.apt_manage_packages/README.md @@ -6,23 +6,24 @@ Fuehrt: aus. ```yaml apt_packages_common: - - locales - wird überall installiert apt_packages_physical: - - hddtemp - nur auf Hardware-Maschinen apt_packages_vm: - - qemu-guest-agent - nur in VMs apt_packages_extra: - Extra-Parameter für einzelne Hosts + apt_packages_internet: + - für URLs + - https://git.mgrote.net/mg/bash-helper-scripts-mgrote/raw/branch/master/output/bash-helper-scripts-mgrote-latest.deb + + ``` Es wird unterschieden ob das Ziel eine VM ist oder nicht. ### getestet auf -- [x] Ubuntu (>=18.04) -- [x] Debian -- [x] ProxMox 6.1 +- [x] Ubuntu (>=20.04) +- [x] ProxMox 7* ### Variablen + Defaults -- siehe default/main.yml +- siehe [defaults/main.yml](./defaults/main.yml) diff --git a/roles/mgrote.apt_manage_packages/defaults/main.yml b/roles/mgrote.apt_manage_packages/defaults/main.yml index 4f223b2c..4872db06 100644 --- a/roles/mgrote.apt_manage_packages/defaults/main.yml +++ b/roles/mgrote.apt_manage_packages/defaults/main.yml @@ -32,3 +32,4 @@ - 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 a69d91a3..3f1782d4 100644 --- a/roles/mgrote.apt_manage_packages/tasks/main.yml +++ b/roles/mgrote.apt_manage_packages/tasks/main.yml @@ -26,6 +26,14 @@ state: present when: ansible_virtualization_role != 'guest' + - name: install packages from the internet + become: yes + ansible.builtin.apt: + deb: "{{ item }}" + state: present + when: apt_packages_internet is defined + loop: "{{ apt_packages_internet }}" + - name: remove packages become: yes ansible.builtin.package: