From 5aab073f2193bfd7202710b82a95a34c694fcf28 Mon Sep 17 00:00:00 2001 From: neingeist Date: Fri, 8 Oct 2021 17:58:17 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20cacert=5Fremove=20variable=20?= =?UTF-8?q?to=20*remove*=20cacert=20certs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- defaults/main.yml | 2 ++ tasks/debian-remove.yml | 15 +++++++++++++++ tasks/main.yml | 8 ++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 defaults/main.yml create mode 100644 tasks/debian-remove.yml diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..cf32f6d --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +cacert_remove: false diff --git a/tasks/debian-remove.yml b/tasks/debian-remove.yml new file mode 100644 index 0000000..740c2a0 --- /dev/null +++ b/tasks/debian-remove.yml @@ -0,0 +1,15 @@ +--- + +- name: Remove CACert certificates + file: + path: /usr/local/share/ca-certificates/cacert.org/{{ item }} + state: absent + with_items: + - root.crt + - class3.crt + notify: Update Debian CA certificates + +- name: Remove CACert certificate directory + file: + path: /usr/local/share/ca-certificates/cacert.org + state: absent diff --git a/tasks/main.yml b/tasks/main.yml index 7bf9f5f..bb129bf 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,10 @@ --- - include_tasks: debian.yml - when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' + when: not cacert_remove and (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') +- include_tasks: debian-remove.yml + when: cacert_remove and (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') - include_tasks: fedora.yml - when: ansible_distribution == 'Fedora' + when: not cacert_remove and ansible_distribution == 'Fedora' +- include_tasks: fedora-remove.yml + when: cacert_remove and ansible_distribution == 'Fedora'