From cc09184dbc582bc85779e4894980d7b1e962ea23 Mon Sep 17 00:00:00 2001 From: Rene Mewissen Date: Thu, 27 Feb 2025 11:46:51 +0100 Subject: [PATCH] only needed on debian and ubuntu --- roles/base/tasks/ansible_setup.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/base/tasks/ansible_setup.yml b/roles/base/tasks/ansible_setup.yml index 6de7b70..7cbcacf 100644 --- a/roles/base/tasks/ansible_setup.yml +++ b/roles/base/tasks/ansible_setup.yml @@ -4,11 +4,13 @@ path: "/etc/apt/sources.list" regexp: "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" state: absent + when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"] - debug: var: ansible_distribution_release - debug: var: equivalents[ansible_distribution_release]['ubuntu'] + when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"] - name: ansible setup | get key @@ -16,8 +18,9 @@ get_url: url: "https://keyserver.ubuntu.com/pks/lookup?fingerprint=on&op=get&search=0x6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367" # required. HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path dest: "/usr/share/keyrings/ansible-archive-keyring.asc" + when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"] -- name: ansible setup | update repository +- name: ansible setup | update repository - Debian tags: ansible,ansible-setup apt_repository: repo: "deb [signed-by=/usr/share/keyrings/ansible-archive-keyring.asc] http://ppa.launchpad.net/ansible/ansible/ubuntu {{ equivalents[ansible_distribution_release]['ubuntu'] }} main" @@ -26,7 +29,7 @@ filename: ansible when: ansible_distribution == "Debian" -- name: ansible setup | update repository +- name: ansible setup | update repository - Ubuntu tags: ansible,ansible-setup apt_repository: repo: "deb [signed-by=/usr/share/keyrings/ansible-archive-keyring.asc] http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_release }} main"