mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 21:33:00 +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>
21 lines
1.1 KiB
YAML
21 lines
1.1 KiB
YAML
####################################################################
|
|
# WARNING: These are designed specifically for Ansible tests #
|
|
# and should not be used as examples of how to write Ansible roles #
|
|
####################################################################
|
|
|
|
- name: Generate CSR for {{ certificate.name }}
|
|
openssl_csr:
|
|
path: '{{ remote_tmp_dir }}/{{ certificate.name }}.csr'
|
|
privatekey_path: '{{ remote_tmp_dir }}/{{ certificate.name }}.key'
|
|
subject: '{{ certificate.subject }}'
|
|
useCommonNameForSAN: false
|
|
|
|
- name: Generate certificate for {{ certificate.name }}
|
|
x509_certificate:
|
|
path: '{{ remote_tmp_dir }}/{{ certificate.name }}.pem'
|
|
csr_path: '{{ remote_tmp_dir }}/{{ certificate.name }}.csr'
|
|
privatekey_path: '{{ remote_tmp_dir }}/{{ certificate.name }}.key'
|
|
provider: '{{ "selfsigned" if certificate.parent is not defined else "ownca" }}'
|
|
ownca_path: '{{ (remote_tmp_dir ~ "/" ~ certificate.parent ~ ".pem") if certificate.parent is defined else omit }}'
|
|
ownca_privatekey_path: '{{ (remote_tmp_dir ~ "/" ~ certificate.parent ~ ".key") if certificate.parent is defined else omit }}'
|