mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 13:22:58 +00:00
* Allow multiple intermediate CAs to have same subject.
* Add tests.
* Fix test name.
* Don't use CN for SAN.
* Make a bit more compatible.
* Include jinja2 compat for CentOS 6.
(cherry picked from commit 11a14543c8)
Co-authored-by: Felix Fontein <felix@fontein.de>
45 lines
1.5 KiB
YAML
45 lines
1.5 KiB
YAML
####################################################################
|
|
# WARNING: These are designed specifically for Ansible tests #
|
|
# and should not be used as examples of how to write Ansible roles #
|
|
####################################################################
|
|
|
|
- name: Case A => works
|
|
certificate_complete_chain:
|
|
input_chain: "{{ read_certificates['d-leaf'] }}"
|
|
intermediate_certificates:
|
|
- '{{ remote_tmp_dir }}/b-intermediate.pem'
|
|
root_certificates:
|
|
- '{{ remote_tmp_dir }}/a-root.pem'
|
|
|
|
- name: Case B => doesn't work, but this is expected
|
|
failed_when: no
|
|
register: caseb
|
|
certificate_complete_chain:
|
|
input_chain: "{{ read_certificates['d-leaf'] }}"
|
|
intermediate_certificates:
|
|
- '{{ remote_tmp_dir }}/c-intermediate.pem'
|
|
root_certificates:
|
|
- '{{ remote_tmp_dir }}/a-root.pem'
|
|
|
|
- name: Assert that case B failed
|
|
assert:
|
|
that: "'Cannot complete chain' in caseb.msg"
|
|
|
|
- name: Case C => works
|
|
certificate_complete_chain:
|
|
input_chain: "{{ read_certificates['d-leaf'] }}"
|
|
intermediate_certificates:
|
|
- '{{ remote_tmp_dir }}/c-intermediate.pem'
|
|
- '{{ remote_tmp_dir }}/b-intermediate.pem'
|
|
root_certificates:
|
|
- '{{ remote_tmp_dir }}/a-root.pem'
|
|
|
|
- name: Case D => works as well after PR 403
|
|
certificate_complete_chain:
|
|
input_chain: "{{ read_certificates['d-leaf'] }}"
|
|
intermediate_certificates:
|
|
- '{{ remote_tmp_dir }}/b-intermediate.pem'
|
|
- '{{ remote_tmp_dir }}/c-intermediate.pem'
|
|
root_certificates:
|
|
- '{{ remote_tmp_dir }}/a-root.pem'
|