2020-03-09 13:11:34 +00:00
---
2022-07-21 05:27:26 +00:00
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
2021-06-02 14:44:26 +00:00
- name : Create CRL 1 (check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-06-02 14:44:26 +00:00
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
2021-06-02 14:44:26 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2021-06-02 14:44:26 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2021-06-02 14:44:26 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
check_mode : true
register : crl_1_check
2020-03-09 13:11:34 +00:00
- name : Create CRL 1
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2020-03-09 13:11:34 +00:00
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
register : crl_1
2021-05-19 07:32:30 +00:00
2021-06-02 14:44:26 +00:00
- assert :
that :
- crl_1_check is changed
- crl_1 is changed
2020-03-09 13:11:34 +00:00
- name : Retrieve CRL 1 infos
x509_crl_info :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
2020-03-09 13:11:34 +00:00
register : crl_1_info_1
2021-05-19 07:32:30 +00:00
2022-12-30 19:44:13 +00:00
- name : Read ca-crl1.crl
2021-09-07 20:37:40 +00:00
slurp :
src : '{{ remote_tmp_dir }}/ca-crl1.crl'
register : slurp
2020-03-09 13:11:34 +00:00
- name : Retrieve CRL 1 infos via file content
x509_crl_info :
2021-09-07 20:37:40 +00:00
content : '{{ slurp.content | b64decode }}'
2020-03-09 13:11:34 +00:00
register : crl_1_info_2
2021-05-19 07:32:30 +00:00
2020-05-15 07:57:07 +00:00
- name : Retrieve CRL 1 infos via file content (Base64)
x509_crl_info :
2021-09-07 20:37:40 +00:00
content : '{{ slurp.content }}'
2020-05-15 07:57:07 +00:00
register : crl_1_info_3
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 1 (idempotent, check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2020-03-09 13:11:34 +00:00
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
2023-02-15 21:23:36 +00:00
check_mode : true
2020-03-09 13:11:34 +00:00
register : crl_1_idem_check
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 1 (idempotent)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2020-03-09 13:11:34 +00:00
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
register : crl_1_idem
2021-05-19 07:32:30 +00:00
2022-12-30 19:44:13 +00:00
- name : Read file
2021-09-07 20:37:40 +00:00
slurp :
src : '{{ remote_tmp_dir }}/{{ item }}'
loop :
- ca.key
- cert-1.pem
- cert-2.pem
register : slurp
2020-03-09 13:11:34 +00:00
- name : Create CRL 1 (idempotent with content, check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_content : "{{ slurp.results[0].content | b64decode }}"
2020-03-09 13:11:34 +00:00
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- content : "{{ slurp.results[1].content | b64decode }}"
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- content : "{{ slurp.results[2].content | b64decode }}"
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
2023-02-15 21:23:36 +00:00
check_mode : true
2020-03-09 13:11:34 +00:00
register : crl_1_idem_content_check
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 1 (idempotent with content)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_content : "{{ slurp.results[0].content | b64decode }}"
2020-03-09 13:11:34 +00:00
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- content : "{{ slurp.results[1].content | b64decode }}"
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- content : "{{ slurp.results[2].content | b64decode }}"
2020-03-09 13:11:34 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
register : crl_1_idem_content
2021-05-19 07:32:30 +00:00
2020-05-15 07:57:07 +00:00
- name : Create CRL 1 (format, check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2020-05-15 07:57:07 +00:00
format : der
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
2020-05-15 07:57:07 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-05-15 07:57:07 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-05-15 07:57:07 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
2023-02-15 21:23:36 +00:00
check_mode : true
2020-05-15 07:57:07 +00:00
register : crl_1_format_check
2021-05-19 07:32:30 +00:00
2020-05-15 07:57:07 +00:00
- name : Create CRL 1 (format)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2020-05-15 07:57:07 +00:00
format : der
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
2020-05-15 07:57:07 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-05-15 07:57:07 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-05-15 07:57:07 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
register : crl_1_format
2021-05-19 07:32:30 +00:00
2020-05-15 07:57:07 +00:00
- name : Create CRL 1 (format, idempotent, check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2020-05-15 07:57:07 +00:00
format : der
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
2020-05-15 07:57:07 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-05-15 07:57:07 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-05-15 07:57:07 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
2023-02-15 21:23:36 +00:00
check_mode : true
2020-05-15 07:57:07 +00:00
register : crl_1_format_idem_check
2021-05-19 07:32:30 +00:00
2020-05-15 07:57:07 +00:00
- name : Create CRL 1 (format, idempotent)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2020-05-15 07:57:07 +00:00
format : der
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
2020-05-15 07:57:07 +00:00
revocation_date : 20191013000000Z
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-05-15 07:57:07 +00:00
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-05-15 07:57:07 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
2023-02-15 21:23:36 +00:00
return_content : true
2020-05-15 07:57:07 +00:00
register : crl_1_format_idem
2021-05-19 07:32:30 +00:00
2020-05-15 07:57:07 +00:00
- name : Retrieve CRL 1 infos via file
x509_crl_info :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl1.crl'
2020-05-15 07:57:07 +00:00
register : crl_1_info_4
2021-05-19 07:32:30 +00:00
2020-05-15 07:57:07 +00:00
- name : Read ca-crl1.crl
slurp :
2021-09-07 20:37:40 +00:00
src : "{{ remote_tmp_dir }}/ca-crl1.crl"
2020-05-15 07:57:07 +00:00
register : content
2021-05-19 07:32:30 +00:00
2020-05-15 07:57:07 +00:00
- name : Retrieve CRL 1 infos via file content (Base64)
x509_crl_info :
content : '{{ content.content }}'
register : crl_1_info_5
2020-03-09 13:11:34 +00:00
- name : Create CRL 2 (check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- countryName : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
2023-02-15 21:23:36 +00:00
check_mode : true
2020-03-09 13:11:34 +00:00
register : crl_2_check
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 2
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- countryName : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
register : crl_2
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 2 (idempotent, check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- C : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
2023-02-15 21:23:36 +00:00
ignore_timestamps : true
check_mode : true
2020-03-09 13:11:34 +00:00
register : crl_2_idem_check
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 2 (idempotent)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- countryName : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-1.pem'
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
2023-02-15 21:23:36 +00:00
ignore_timestamps : true
2020-03-09 13:11:34 +00:00
register : crl_2_idem
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 2 (idempotent update, check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- countryName : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
- serial_number : 1235
2023-02-15 21:23:36 +00:00
ignore_timestamps : true
2020-03-09 13:11:34 +00:00
mode : update
2023-02-15 21:23:36 +00:00
check_mode : true
2020-03-09 13:11:34 +00:00
register : crl_2_idem_update_change_check
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 2 (idempotent update)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- countryName : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
- serial_number : 1235
2023-02-15 21:23:36 +00:00
ignore_timestamps : true
2020-03-09 13:11:34 +00:00
mode : update
register : crl_2_idem_update_change
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 2 (idempotent update, check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- countryName : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
2023-02-15 21:23:36 +00:00
ignore_timestamps : true
2020-03-09 13:11:34 +00:00
mode : update
2023-02-15 21:23:36 +00:00
check_mode : true
2020-03-09 13:11:34 +00:00
register : crl_2_idem_update_check
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 2 (idempotent update)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- countryName : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
2023-02-15 21:23:36 +00:00
ignore_timestamps : true
2020-03-09 13:11:34 +00:00
mode : update
register : crl_2_idem_update
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 2 (changed timestamps, check mode)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- countryName : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
2023-02-15 21:23:36 +00:00
ignore_timestamps : false
2020-03-09 13:11:34 +00:00
mode : update
2023-02-15 21:23:36 +00:00
check_mode : true
2020-03-09 13:11:34 +00:00
register : crl_2_change_check
2021-05-19 07:32:30 +00:00
2020-03-09 13:11:34 +00:00
- name : Create CRL 2 (changed timestamps)
x509_crl :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
2021-10-31 14:05:04 +00:00
issuer_ordered :
- CN : Ansible
- CN : CRL
- countryName : US
- CN : Test
2020-03-09 13:11:34 +00:00
last_update : +0d
next_update : +0d
revoked_certificates :
2021-09-07 20:37:40 +00:00
- path : '{{ remote_tmp_dir }}/cert-2.pem'
2020-03-09 13:11:34 +00:00
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2020-03-09 13:11:34 +00:00
invalidity_date : 20191012000000Z
2023-02-15 21:23:36 +00:00
ignore_timestamps : false
2020-03-09 13:11:34 +00:00
mode : update
2023-02-15 21:23:36 +00:00
return_content : true
2020-03-09 13:11:34 +00:00
register : crl_2_change
2021-05-19 07:32:30 +00:00
2021-10-31 14:05:04 +00:00
- name : Read ca-crl2.crl
slurp :
src : '{{ remote_tmp_dir }}/ca-crl2.crl'
register : slurp_crl2_1
2021-05-19 07:32:30 +00:00
- name : Retrieve CRL 2 infos
x509_crl_info :
2021-09-07 20:37:40 +00:00
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
2021-05-19 07:32:30 +00:00
list_revoked_certificates : false
register : crl_2_info_1
2021-10-31 14:05:04 +00:00
- name : Create CRL 2 (changed order, should be ignored)
x509_crl :
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
issuer :
countryName : US
CN :
- Ansible
- CRL
- Test
last_update : +0d
next_update : +0d
revoked_certificates :
- path : '{{ remote_tmp_dir }}/cert-2.pem'
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2021-10-31 14:05:04 +00:00
invalidity_date : 20191012000000Z
ignore_timestamps : true
mode : update
2023-02-15 21:23:36 +00:00
return_content : true
2021-10-31 14:05:04 +00:00
register : crl_2_change_order_ignore
- name : Create CRL 2 (changed order)
x509_crl :
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
issuer_ordered :
- CN : Ansible
- countryName : US
- CN : CRL
- CN : Test
last_update : +0d
next_update : +0d
revoked_certificates :
- path : '{{ remote_tmp_dir }}/cert-2.pem'
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2021-10-31 14:05:04 +00:00
invalidity_date : 20191012000000Z
ignore_timestamps : true
mode : update
2023-02-15 21:23:36 +00:00
return_content : true
2021-10-31 14:05:04 +00:00
register : crl_2_change_order
- name : Read ca-crl2.crl
slurp :
src : '{{ remote_tmp_dir }}/ca-crl2.crl'
register : slurp_crl2_2
- name : Retrieve CRL 2 infos again
x509_crl_info :
path : '{{ remote_tmp_dir }}/ca-crl2.crl'
list_revoked_certificates : false
register : crl_2_info_2
2022-04-18 06:17:27 +00:00
- name : Create CRL 3
x509_crl :
path : '{{ remote_tmp_dir }}/ca-crl3.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
issuer :
CN : Ansible
last_update : +0d
next_update : +0d
revoked_certificates :
- serial_number : 1234
revocation_date : 20191001000000Z
2022-05-09 17:57:14 +00:00
# * cryptography < 2.1 strips username and password from URIs. To avoid problems, we do
# not pass usernames and passwords for URIs when the cryptography version is < 2.1.
# * Python 3.5 before 3.5.8 rc 1 has a bug in urllib.parse.urlparse() that results in an
# error if a Unicode netloc has a username or password included.
# (https://github.com/ansible-collections/community.crypto/pull/436#issuecomment-1101737134)
# This affects the Python 3.5 included in Ansible 2.9's default test container; to avoid
# this, we also do not pass usernames and passwords for Python 3.5.
2022-04-18 06:17:27 +00:00
issuer :
- "DNS:ca.example.org"
2022-05-09 17:57:14 +00:00
- "DNS:ffóò.ḃâŗ.çøṁ"
- "email:foo@ḃâŗ.çøṁ"
- "URI:https://{{ '' if cryptography_version.stdout is version('2.1', '<') or ansible_facts.python.version.minor == 5 else 'admin:hunter2@' }}ffóò.ḃâŗ.çøṁ/baz?foo=bar"
- "URI:https://{{ '' if cryptography_version.stdout is version('2.1', '<') or ansible_facts.python.version.minor == 5 else 'goo@' }}www.straße.de"
- "URI:https://straße.de:8080"
- "URI:http://gefäß.org"
- "URI:http://{{ '' if cryptography_version.stdout is version('2.1', '<') or ansible_facts.python.version.minor == 5 else 'a:b@' }}ä:1"
2022-04-18 06:17:27 +00:00
issuer_critical : true
register : crl_3
2022-05-09 17:57:14 +00:00
- name : Create CRL 3 (IDNA encoding)
x509_crl :
path : '{{ remote_tmp_dir }}/ca-crl3.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
issuer :
CN : Ansible
last_update : +0d
next_update : +0d
revoked_certificates :
- serial_number : 1234
revocation_date : 20191001000000Z
issuer :
- "DNS:ca.example.org"
- "DNS:xn--ff-3jad.xn--2ca8uh37e.xn--7ca8a981n"
- "email:foo@xn--2ca8uh37e.xn--7ca8a981n"
- "URI:https://{{ '' if cryptography_version.stdout is version('2.1', '<') or ansible_facts.python.version.minor == 5 else 'admin:hunter2@' }}xn--ff-3jad.xn--2ca8uh37e.xn--7ca8a981n/baz?foo=bar"
- "URI:https://{{ '' if cryptography_version.stdout is version('2.1', '<') or ansible_facts.python.version.minor == 5 else 'goo@' }}www.xn--strae-oqa.de"
- "URI:https://xn--strae-oqa.de:8080"
- "URI:http://xn--gef-7kay.org"
- "URI:http://{{ '' if cryptography_version.stdout is version('2.1', '<') or ansible_facts.python.version.minor == 5 else 'a:b@' }}xn--4ca:1"
issuer_critical : true
ignore_timestamps : true
name_encoding : idna
register : crl_3_idna
- name : Create CRL 3 (Unicode encoding)
x509_crl :
path : '{{ remote_tmp_dir }}/ca-crl3.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca.key'
issuer :
CN : Ansible
last_update : +0d
next_update : +0d
revoked_certificates :
- serial_number : 1234
revocation_date : 20191001000000Z
issuer :
- "DNS:ca.example.org"
- "DNS:ffóò.ḃâŗ.çøṁ"
- "email:foo@ḃâŗ.çøṁ"
- "URI:https://{{ '' if cryptography_version.stdout is version('2.1', '<') or ansible_facts.python.version.minor == 5 else 'admin:hunter2@' }}ffóò.ḃâŗ.çøṁ/baz?foo=bar"
- "URI:https://{{ '' if cryptography_version.stdout is version('2.1', '<') or ansible_facts.python.version.minor == 5 else 'goo@' }}www.straße.de"
- "URI:https://straße.de:8080"
- "URI:http://gefäß.org"
- "URI:http://{{ '' if cryptography_version.stdout is version('2.1', '<') or ansible_facts.python.version.minor == 5 else 'a:b@' }}ä:1"
issuer_critical : true
ignore_timestamps : true
name_encoding : unicode
register : crl_3_unicode
2022-04-18 06:17:27 +00:00
- name : Retrieve CRL 3 infos
x509_crl_info :
path : '{{ remote_tmp_dir }}/ca-crl3.crl'
list_revoked_certificates : true
register : crl_3_info
2022-05-09 17:57:14 +00:00
- name : Retrieve CRL 3 infos (IDNA encoding)
x509_crl_info :
path : '{{ remote_tmp_dir }}/ca-crl3.crl'
name_encoding : idna
list_revoked_certificates : true
register : crl_3_info_idna
- name : Retrieve CRL 3 infos (Unicode encoding)
x509_crl_info :
path : '{{ remote_tmp_dir }}/ca-crl3.crl'
name_encoding : unicode
list_revoked_certificates : true
register : crl_3_info_unicode
2022-06-15 20:06:40 +00:00
- name : Ed25519 and Ed448 tests (for cryptography >= 2.6)
block :
- name : Generate private keys
openssl_privatekey :
path : '{{ remote_tmp_dir }}/ca-{{ item }}.key'
type : '{{ item }}'
loop :
- Ed25519
- Ed448
register : ed25519_ed448_privatekey
2023-02-15 21:23:36 +00:00
ignore_errors : true
2022-06-15 20:06:40 +00:00
- when : ed25519_ed448_privatekey is not failed
block :
- name : Create CRL
x509_crl :
path : '{{ remote_tmp_dir }}/ca-crl-{{ item }}.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca-{{ item }}.key'
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
- path : '{{ remote_tmp_dir }}/cert-1.pem'
revocation_date : 20191013000000Z
- path : '{{ remote_tmp_dir }}/cert-2.pem'
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2022-06-15 20:06:40 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
register : ed25519_ed448_crl
loop :
- Ed25519
- Ed448
2023-02-15 21:23:36 +00:00
ignore_errors : true
2022-06-15 20:06:40 +00:00
- name : Create CRL (idempotence)
x509_crl :
path : '{{ remote_tmp_dir }}/ca-crl-{{ item }}.crl'
privatekey_path : '{{ remote_tmp_dir }}/ca-{{ item }}.key'
issuer :
CN : Ansible
last_update : 20191013000000Z
next_update : 20191113000000Z
revoked_certificates :
- path : '{{ remote_tmp_dir }}/cert-1.pem'
revocation_date : 20191013000000Z
- path : '{{ remote_tmp_dir }}/cert-2.pem'
revocation_date : 20191013000000Z
reason : key_compromise
2023-02-15 21:23:36 +00:00
reason_critical : true
2022-06-15 20:06:40 +00:00
invalidity_date : 20191012000000Z
- serial_number : 1234
revocation_date : 20191001000000Z
register : ed25519_ed448_crl_idempotence
loop :
- Ed25519
- Ed448
2023-02-15 21:23:36 +00:00
ignore_errors : true
2022-06-15 20:06:40 +00:00
2022-12-30 19:44:13 +00:00
when : cryptography_version.stdout is version('2.6', '>=')