2020-03-09 13:11:34 +00:00
|
|
|
---
|
|
|
|
- name: Create CRL 1 (check mode)
|
|
|
|
x509_crl:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
revocation_date: 20191001000000Z
|
|
|
|
check_mode: yes
|
|
|
|
register: crl_1_check
|
2021-05-19 07:32:30 +00:00
|
|
|
|
2020-03-09 13:11:34 +00:00
|
|
|
- name: Create CRL 1
|
|
|
|
x509_crl:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
revocation_date: 20191001000000Z
|
|
|
|
register: crl_1
|
2021-05-19 07:32:30 +00:00
|
|
|
|
2020-03-09 13:11:34 +00:00
|
|
|
- name: Retrieve CRL 1 infos
|
|
|
|
x509_crl_info:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
register: crl_1_info_1
|
2021-05-19 07:32:30 +00:00
|
|
|
|
2020-03-09 13:11:34 +00:00
|
|
|
- name: Retrieve CRL 1 infos via file content
|
|
|
|
x509_crl_info:
|
|
|
|
content: '{{ lookup("file", output_dir ~ "/ca-crl1.crl") }}'
|
|
|
|
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:
|
|
|
|
content: '{{ lookup("file", output_dir ~ "/ca-crl1.crl") | b64encode }}'
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
revocation_date: 20191001000000Z
|
|
|
|
check_mode: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
revocation_date: 20191001000000Z
|
|
|
|
register: crl_1_idem
|
2021-05-19 07:32:30 +00:00
|
|
|
|
2020-03-09 13:11:34 +00:00
|
|
|
- name: Create CRL 1 (idempotent with content, check mode)
|
|
|
|
x509_crl:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_content: "{{ lookup('file', output_dir ~ '/ca.key') }}"
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- content: "{{ lookup('file', output_dir ~ '/cert-1.pem') }}"
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- content: "{{ lookup('file', output_dir ~ '/cert-2.pem') }}"
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
revocation_date: 20191001000000Z
|
|
|
|
check_mode: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_content: "{{ lookup('file', output_dir ~ '/ca.key') }}"
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- content: "{{ lookup('file', output_dir ~ '/cert-1.pem') }}"
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- content: "{{ lookup('file', output_dir ~ '/cert-2.pem') }}"
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
format: der
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
revocation_date: 20191001000000Z
|
|
|
|
check_mode: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
format: der
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
format: der
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
revocation_date: 20191001000000Z
|
|
|
|
check_mode: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
format: der
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: 20191013000000Z
|
|
|
|
next_update: 20191113000000Z
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
revocation_date: 20191013000000Z
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
revocation_date: 20191001000000Z
|
|
|
|
return_content: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl1.crl'
|
|
|
|
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:
|
|
|
|
src: "{{ output_dir }}/ca-crl1.crl"
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
check_mode: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
ignore_timestamps: yes
|
|
|
|
check_mode: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-1.pem'
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
- serial_number: 1234
|
|
|
|
ignore_timestamps: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- serial_number: 1235
|
|
|
|
ignore_timestamps: yes
|
|
|
|
mode: update
|
|
|
|
check_mode: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- serial_number: 1235
|
|
|
|
ignore_timestamps: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
ignore_timestamps: yes
|
|
|
|
mode: update
|
|
|
|
check_mode: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
ignore_timestamps: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
ignore_timestamps: no
|
|
|
|
mode: update
|
|
|
|
check_mode: yes
|
|
|
|
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:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
privatekey_path: '{{ output_dir }}/ca.key'
|
|
|
|
issuer:
|
|
|
|
CN: Ansible
|
|
|
|
last_update: +0d
|
|
|
|
next_update: +0d
|
|
|
|
revoked_certificates:
|
|
|
|
- path: '{{ output_dir }}/cert-2.pem'
|
|
|
|
reason: key_compromise
|
|
|
|
reason_critical: yes
|
|
|
|
invalidity_date: 20191012000000Z
|
|
|
|
ignore_timestamps: no
|
|
|
|
mode: update
|
|
|
|
return_content: yes
|
|
|
|
register: crl_2_change
|
2021-05-19 07:32:30 +00:00
|
|
|
|
|
|
|
- name: Retrieve CRL 2 infos
|
|
|
|
x509_crl_info:
|
|
|
|
path: '{{ output_dir }}/ca-crl2.crl'
|
|
|
|
list_revoked_certificates: false
|
|
|
|
register: crl_2_info_1
|