2017-07-25 11:18:18 +00:00
|
|
|
- name: Validate CSR (test - privatekey modulus)
|
2017-12-12 12:35:22 +00:00
|
|
|
shell: 'openssl rsa -noout -modulus -in {{ output_dir }}/privatekey.pem'
|
2017-07-25 11:18:18 +00:00
|
|
|
register: privatekey_modulus
|
|
|
|
|
|
|
|
- name: Validate CSR (test - Common Name)
|
|
|
|
shell: "openssl req -noout -subject -in {{ output_dir }}/csr.csr -nameopt oneline,-space_eq"
|
|
|
|
register: csr_cn
|
|
|
|
|
|
|
|
- name: Validate CSR (test - csr modulus)
|
2017-12-12 12:35:22 +00:00
|
|
|
shell: 'openssl req -noout -modulus -in {{ output_dir }}/csr.csr'
|
2017-07-25 11:18:18 +00:00
|
|
|
register: csr_modulus
|
|
|
|
|
|
|
|
- name: Validate CSR (assert)
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- csr_cn.stdout.split('=')[-1] == 'www.ansible.com'
|
|
|
|
- csr_modulus.stdout == privatekey_modulus.stdout
|
2017-09-14 16:03:00 +00:00
|
|
|
|
|
|
|
- name: Validate CSR_KU_XKU (assert idempotency)
|
|
|
|
assert:
|
|
|
|
that:
|
2018-02-08 12:03:28 +00:00
|
|
|
- csr_ku_xku is not changed
|
2017-12-12 12:35:22 +00:00
|
|
|
|
|
|
|
- name: Validate old_API CSR (test - Common Name)
|
|
|
|
shell: "openssl req -noout -subject -in {{ output_dir }}/csr_oldapi.csr -nameopt oneline,-space_eq"
|
|
|
|
register: csr_oldapi_cn
|
|
|
|
|
|
|
|
- name: Validate old_API CSR (test - csr modulus)
|
|
|
|
shell: 'openssl req -noout -modulus -in {{ output_dir }}/csr_oldapi.csr'
|
|
|
|
register: csr_oldapi_modulus
|
|
|
|
|
|
|
|
- name: Validate old_API CSR (assert)
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- csr_oldapi_cn.stdout.split('=')[-1] == 'www.ansible.com'
|
|
|
|
- csr_oldapi_modulus.stdout == privatekey_modulus.stdout
|
2018-02-08 12:03:28 +00:00
|
|
|
|
|
|
|
- name: Validate OCSP Must Staple CSR (test - everything)
|
|
|
|
shell: "openssl req -noout -in {{ output_dir }}/csr_ocsp.csr -text"
|
|
|
|
register: csr_ocsp
|
|
|
|
|
|
|
|
- name: Validate OCSP Must Staple CSR (assert)
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "(csr_ocsp.stdout is search('\\s+TLS Feature:\\s*\\n\\s+status_request\\s+')) or
|
|
|
|
(csr_ocsp.stdout is search('\\s+1.3.6.1.5.5.7.1.24:\\s*\\n\\s+0\\.\\.\\.\\.\\s+'))"
|
|
|
|
|
|
|
|
- name: Validate OCSP Must Staple CSR (assert idempotency)
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- csr_ocsp_idempotency is not changed
|