Add validation option. (#830)

This commit is contained in:
Felix Fontein
2024-12-30 10:09:51 +01:00
committed by GitHub
parent 05c442ab5e
commit abb0d67774
3 changed files with 73 additions and 1 deletions

View File

@@ -210,3 +210,33 @@
- result_8 is not changed
- result_9 is not changed
- result_10 is not changed
- name: Create empty file
ansible.builtin.copy:
dest: '{{ remote_tmp_dir }}/empty'
content: ''
- name: Convert empty file to PEM (w/o verify)
community.crypto.x509_certificate_convert:
src_path: '{{ remote_tmp_dir }}/empty'
dest_path: '{{ remote_tmp_dir }}/empty.pem'
format: pem
verify_cert_parsable: false
register: result_1
- name: Convert empty file to PEM (w/ verify)
community.crypto.x509_certificate_convert:
src_path: '{{ remote_tmp_dir }}/empty'
dest_path: '{{ remote_tmp_dir }}/empty.pem'
format: pem
verify_cert_parsable: true
register: result_2
ignore_errors: true
- name: Check conditions
assert:
that:
- result_1 is changed
- result_2 is failed
- >-
result_2.msg.startswith('Error while parsing certificate: ')