diff --git a/defaults/main.yml b/defaults/main.yml index 8311a90..b7cdec0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -83,10 +83,12 @@ trusted_ca_letsencrypt_ca_files: - { ca: 'isrg-root-x2.pem', name: 'isrg-root-x2-not-cross' } - { ca: 'isrgrootx1.pem', name: 'isrg-root-x1' } - { ca: 'lets-encrypt-e1.pem', name: 'lets-encrypt-e1' } - - { ca: 'lets-encrypt-r3-cross-signed.pem', name: 'lets-encrypt-r3-cross-signed' } - { ca: 'lets-encrypt-r3.pem', name: 'lets-encrypt-r3-not-cross' } - - { ca: 'lets-encrypt-x3-cross-signed.pem', name: 'lets-encrypt-x3-cross-signed' } - { ca: 'letsencryptauthorityx3.pem', name: 'lets-encrypt-x3-not-cross' } +expired_ca_letsencrypt_ca_files: + - lets-encrypt-r3-cross-signed.pem + - lets-encrypt-x3-cross-signed.pem + trusted_ca_additional_ca_files: [] # - { can_url: 'https://example.com/foo-ca.pem', ca: 'foo-ca.pem', name: 'foo-ca' } diff --git a/files/letsencrypt_ca_files/lets-encrypt-r3-cross-signed.pem b/files/letsencrypt_ca_files/lets-encrypt-r3-cross-signed.pem deleted file mode 100644 index 1d82449..0000000 --- a/files/letsencrypt_ca_files/lets-encrypt-r3-cross-signed.pem +++ /dev/null @@ -1,26 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEZTCCA02gAwIBAgIQQAF1BIMUpMghjISpDBbN3zANBgkqhkiG9w0BAQsFADA/ -MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT -DkRTVCBSb290IENBIFgzMB4XDTIwMTAwNzE5MjE0MFoXDTIxMDkyOTE5MjE0MFow -MjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxCzAJBgNVBAMT -AlIzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuwIVKMz2oJTTDxLs -jVWSw/iC8ZmmekKI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F2JIbeQAcH5H0tZrUlo5ZYyOqA7s9p -O5b85o3AM/OJ+CktFBQtfvBhcJVd9wvlwPsk+uyOy2HI7mNxKKgsBTt375teA2Tw -UdHkhVNcsAKX1H7GNNLOEADksd86wuoXvg== ------END CERTIFICATE----- diff --git a/files/letsencrypt_ca_files/lets-encrypt-x3-cross-signed.pem b/files/letsencrypt_ca_files/lets-encrypt-x3-cross-signed.pem deleted file mode 100644 index 0002462..0000000 --- a/files/letsencrypt_ca_files/lets-encrypt-x3-cross-signed.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/ -MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT -DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow -SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT -GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF -q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8 -SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0 -Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA -a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj -/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T -AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG -CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv -bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k -c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw -VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC -ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz -MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu -Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF -AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo -uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/ -wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu -X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG -PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6 -KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg== ------END CERTIFICATE----- diff --git a/tasks/trusted_ca.yml b/tasks/trusted_ca.yml index 96d3b79..c2ccf5f 100644 --- a/tasks/trusted_ca.yml +++ b/tasks/trusted_ca.yml @@ -20,10 +20,21 @@ with_items: '{{ trusted_ca_letsencrypt_ca_files }}' register: letsencrypt_ca_files_installation - - name: Trust the CA files on EL + - name: Rebuild the trust CA files on EL command: /bin/update-ca-trust extract when: letsencrypt_ca_files_installation is changed + - name: Ensure that the expired CA files are not present + file: + dest: '/etc/pki/ca-trust/source/anchors/{{ item }}' + state: absent + loop: '{{ expired_ca_letsencrypt_ca_files }}' + register: letsencrypt_ca_files_removal + + - name: Rebuild the trust CA files on EL + command: /bin/update-ca-trust extract + when: letsencrypt_ca_files_removal is changed + when: - trusted_ca_letsencrypt_install - ansible_distribution_file_variety == "RedHat" @@ -57,6 +68,17 @@ command: /usr/sbin/update-ca-certificates when: letsencrypt_ca_files_installation is changed + - name: Ensure that the expired CA files are not present + file: + dest: '/etc/ssl/certs/{{ item }}' + state: absent + loop: '{{ expired_ca_letsencrypt_ca_files }}' + register: letsencrypt_ca_files_removal + + - name: Trust the CA files on deb + command: /usr/sbin/update-ca-certificates + when: letsencrypt_ca_files_removal is changed + when: - trusted_ca_letsencrypt_install - ansible_distribution_file_variety == "Debian"