| 1 |
--- |
| 2 |
# Copyright (c) Ansible Project |
| 3 |
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 4 |
# SPDX-License-Identifier: GPL-3.0-or-later |
| 5 |
|
| 6 |
#################################################################### |
| 7 |
# WARNING: These are designed specifically for Ansible tests # |
| 8 |
# and should not be used as examples of how to write Ansible roles # |
| 9 |
#################################################################### |
| 10 |
|
| 11 |
- name: Make sure the Python idna library is installed |
| 12 |
ansible.builtin.pip: |
| 13 |
name: idna |
| 14 |
state: present |
| 15 |
|
| 16 |
- name: Generate privatekey |
| 17 |
community.crypto.openssl_privatekey: |
| 18 |
path: '{{ remote_tmp_dir }}/privatekey.pem' |
| 19 |
size: '{{ default_rsa_key_size }}' |
| 20 |
|
| 21 |
- name: Generate privatekey with password |
| 22 |
community.crypto.openssl_privatekey: |
| 23 |
path: '{{ remote_tmp_dir }}/privatekeypw.pem' |
| 24 |
passphrase: hunter2 |
| 25 |
select_crypto_backend: cryptography |
| 26 |
size: '{{ default_rsa_key_size }}' |
| 27 |
|
| 28 |
- name: Generate CSR 1 |
| 29 |
community.crypto.openssl_csr: |
| 30 |
path: '{{ remote_tmp_dir }}/csr_1.csr' |
| 31 |
privatekey_path: '{{ remote_tmp_dir }}/privatekey.pem' |
| 32 |
subject: |
| 33 |
commonName: www.example.com |
| 34 |
C: de |
| 35 |
L: Somewhere |
| 36 |
ST: Zurich |
| 37 |
streetAddress: Welcome Street |
| 38 |
O: Ansible |
| 39 |
organizationalUnitName: |
| 40 |
- Crypto Department |
| 41 |
- ACME Department |
| 42 |
serialNumber: "1234" |
| 43 |
SN: Last Name |
| 44 |
GN: First Name |
| 45 |
title: Chief |
| 46 |
pseudonym: test |
| 47 |
UID: asdf |
| 48 |
emailAddress: [email protected] |
| 49 |
postalAddress: 1234 Somewhere |
| 50 |
postalCode: "1234" |
| 51 |
useCommonNameForSAN: false |
| 52 |
key_usage: |
| 53 |
- digitalSignature |
| 54 |
- keyAgreement |
| 55 |
- Non Repudiation |
| 56 |
- Key Encipherment |
| 57 |
- dataEncipherment |
| 58 |
- Certificate Sign |
| 59 |
- cRLSign |
| 60 |
- Encipher Only |
| 61 |
- decipherOnly |
| 62 |
key_usage_critical: true |
| 63 |
extended_key_usage: |
| 64 |
- serverAuth # the same as "TLS Web Server Authentication" |
| 65 |
- TLS Web Server Authentication |
| 66 |
- TLS Web Client Authentication |
| 67 |
- Code Signing |
| 68 |
- E-mail Protection |
| 69 |
- timeStamping |
| 70 |
- OCSPSigning |
| 71 |
- Any Extended Key Usage |
| 72 |
- qcStatements |
| 73 |
- DVCS |
| 74 |
- IPSec User |
| 75 |
- biometricInfo |
| 76 |
subject_alt_name: |
| 77 |
- "DNS:www.ansible.com" |
| 78 |
- "DNS:âņsïbłè.com" |
| 79 |
- "IP:1.2.3.4" |
| 80 |
- "IP:::1" |
| 81 |
- "email:[email protected]" |
| 82 |
- "URI:https://example.org/test/index.html" |
| 83 |
basic_constraints: |
| 84 |
- "CA:TRUE" |
| 85 |
- "pathlen:23" |
| 86 |
basic_constraints_critical: true |
| 87 |
ocsp_must_staple: true |
| 88 |
subject_key_identifier: "00:11:22:33" |
| 89 |
authority_key_identifier: "44:55:66:77" |
| 90 |
authority_cert_issuer: '{{ value_for_authority_cert_issuer }}' |
| 91 |
authority_cert_serial_number: 12345 |
| 92 |
vars: |
| 93 |
value_for_authority_cert_issuer: |
| 94 |
- "DNS:ca.example.org" |
| 95 |
- "IP:1.2.3.4" |
| 96 |
|
| 97 |
- name: Generate CSR 2 |
| 98 |
community.crypto.openssl_csr: |
| 99 |
path: '{{ remote_tmp_dir }}/csr_2.csr' |
| 100 |
privatekey_path: '{{ remote_tmp_dir }}/privatekeypw.pem' |
| 101 |
privatekey_passphrase: hunter2 |
| 102 |
useCommonNameForSAN: false |
| 103 |
basic_constraints: |
| 104 |
- "CA:TRUE" |
| 105 |
|
| 106 |
- name: Generate CSR 3 |
| 107 |
community.crypto.openssl_csr: |
| 108 |
path: '{{ remote_tmp_dir }}/csr_3.csr' |
| 109 |
privatekey_path: '{{ remote_tmp_dir }}/privatekey.pem' |
| 110 |
useCommonNameForSAN: false |
| 111 |
subject_alt_name: |
| 112 |
- "DNS:*.ansible.com" |
| 113 |
- "DNS:*.example.org" |
| 114 |
- "IP:DEAD:BEEF::1" |
| 115 |
basic_constraints: |
| 116 |
- "CA:FALSE" |
| 117 |
authority_cert_issuer: '{{ value_for_authority_cert_issuer }}' |
| 118 |
authority_cert_serial_number: 12345 |
| 119 |
vars: |
| 120 |
value_for_authority_cert_issuer: |
| 121 |
- "DNS:ca.example.org" |
| 122 |
- "IP:1.2.3.4" |
| 123 |
|
| 124 |
- name: Generate CSR 4 |
| 125 |
community.crypto.openssl_csr: |
| 126 |
path: '{{ remote_tmp_dir }}/csr_4.csr' |
| 127 |
privatekey_path: '{{ remote_tmp_dir }}/privatekey.pem' |
| 128 |
useCommonNameForSAN: false |
| 129 |
authority_key_identifier: "44:55:66:77" |
| 130 |
|
| 131 |
- name: Running tests with cryptography backend |
| 132 |
ansible.builtin.include_tasks: impl.yml |
| 133 |
vars: |
| 134 |
select_crypto_backend: cryptography |
| 135 |
when: cryptography_version is version('3.3', '>=') |