mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 21:33:00 +00:00
openssl_pkcs12: Add a check for parsed pkcs12 files (#145)
* openssl_pkcs12: Add a check for parsed pkcs12 files Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de> * Add changelog fragment Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de> * openssl_pkcs12: Report changed state when a pkcs12 file is dumped Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de> * Add a basic test for dumping a pkcs12 file Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de> * Update changelog fragment Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de> * Add test for dumped pkcs12 file in check mode Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
This commit is contained in:
@@ -88,6 +88,22 @@
|
||||
path: '{{ output_dir }}/ansible_parse.pem'
|
||||
action: parse
|
||||
state: present
|
||||
register: p12_dumped
|
||||
- name: Dump PKCS#12 file again, idempotency
|
||||
openssl_pkcs12:
|
||||
src: '{{ output_dir }}/ansible.p12'
|
||||
path: '{{ output_dir }}/ansible_parse.pem'
|
||||
action: parse
|
||||
state: present
|
||||
register: p12_dumped_idempotency
|
||||
- name: Dump PKCS#12, check mode
|
||||
openssl_pkcs12:
|
||||
src: '{{ output_dir }}/ansible.p12'
|
||||
path: '{{ output_dir }}/ansible_parse.pem'
|
||||
action: parse
|
||||
state: present
|
||||
check_mode: true
|
||||
register: p12_dumped_check_mode
|
||||
- name: Generate PKCS#12 file with multiple certs
|
||||
openssl_pkcs12:
|
||||
path: '{{ output_dir }}/ansible_multi_certs.p12'
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
- p12_validate_no_pkey.stdout_lines[-1] == '-----END CERTIFICATE-----'
|
||||
- p12_force.changed
|
||||
- p12_force_and_mode.mode == '0644' and p12_force_and_mode.changed
|
||||
- p12_dumped.changed
|
||||
- not p12_standard_idempotency.changed
|
||||
- not p12_multiple_certs_idempotency.changed
|
||||
- not p12_dumped_idempotency.changed
|
||||
- not p12_dumped_check_mode.changed
|
||||
- "'www.' in p12_validate_multi_certs.stdout"
|
||||
- "'www2.' in p12_validate_multi_certs.stdout"
|
||||
- "'www3.' in p12_validate_multi_certs.stdout"
|
||||
|
||||
Reference in New Issue
Block a user