2017-09-13 23:39:32 +02:00
|
|
|
- block:
|
|
|
|
- name: Generate privatekey
|
|
|
|
openssl_privatekey:
|
|
|
|
path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
|
|
|
|
- name: Generate CSR
|
|
|
|
openssl_csr:
|
|
|
|
path: '{{ output_dir }}/csr.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
2017-12-12 13:35:22 +01:00
|
|
|
subject:
|
|
|
|
commonName: www.example.com
|
2017-09-13 23:39:32 +02:00
|
|
|
|
|
|
|
- name: Generate selfsigned certificate
|
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert.pem'
|
|
|
|
csr_path: '{{ output_dir }}/csr.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
provider: selfsigned
|
|
|
|
selfsigned_digest: sha256
|
2017-12-18 10:04:34 +01:00
|
|
|
register: selfsigned_certificate
|
|
|
|
|
|
|
|
- name: Generate selfsigned certificate
|
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert.pem'
|
|
|
|
csr_path: '{{ output_dir }}/csr.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
provider: selfsigned
|
|
|
|
selfsigned_digest: sha256
|
|
|
|
register: selfsigned_certificate_idempotence
|
2017-09-13 23:39:32 +02:00
|
|
|
|
|
|
|
- name: Check selfsigned certificate
|
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert.pem'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
provider: assertonly
|
|
|
|
has_expired: False
|
|
|
|
version: 3
|
|
|
|
signature_algorithms:
|
|
|
|
- sha256WithRSAEncryption
|
|
|
|
- sha256WithECDSAEncryption
|
2017-12-12 13:35:22 +01:00
|
|
|
subject:
|
|
|
|
commonName: www.example.com
|
2017-09-13 23:39:32 +02:00
|
|
|
|
2017-09-14 15:21:32 +02:00
|
|
|
- name: Generate selfsigned v2 certificate
|
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_v2.pem'
|
|
|
|
csr_path: '{{ output_dir }}/csr.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
provider: selfsigned
|
|
|
|
selfsigned_digest: sha256
|
|
|
|
selfsigned_version: 2
|
|
|
|
|
2017-09-13 23:39:32 +02:00
|
|
|
- name: Generate privatekey2
|
|
|
|
openssl_privatekey:
|
|
|
|
path: '{{ output_dir }}/privatekey2.pem'
|
|
|
|
|
|
|
|
- name: Generate CSR2
|
|
|
|
openssl_csr:
|
2017-12-12 13:35:22 +01:00
|
|
|
subject:
|
|
|
|
CN: www.example.com
|
|
|
|
C: US
|
|
|
|
ST: California
|
|
|
|
L: Los Angeles
|
|
|
|
O: ACME Inc.
|
|
|
|
OU:
|
|
|
|
- Roadrunner pest control
|
|
|
|
- Pyrotechnics
|
2017-09-13 23:39:32 +02:00
|
|
|
path: '{{ output_dir }}/csr2.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey2.pem'
|
2017-09-14 18:03:00 +02:00
|
|
|
keyUsage:
|
|
|
|
- digitalSignature
|
|
|
|
extendedKeyUsage:
|
|
|
|
- ipsecUser
|
|
|
|
- biometricInfo
|
2017-09-13 23:39:32 +02:00
|
|
|
|
|
|
|
- name: Generate selfsigned certificate2
|
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert2.pem'
|
|
|
|
csr_path: '{{ output_dir }}/csr2.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey2.pem'
|
|
|
|
provider: selfsigned
|
|
|
|
selfsigned_digest: sha256
|
|
|
|
|
|
|
|
- name: Check selfsigned certificate2
|
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert2.pem'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey2.pem'
|
|
|
|
provider: assertonly
|
|
|
|
has_expired: False
|
|
|
|
version: 3
|
|
|
|
signature_algorithms:
|
|
|
|
- sha256WithRSAEncryption
|
|
|
|
- sha256WithECDSAEncryption
|
|
|
|
subject:
|
2017-12-12 13:35:22 +01:00
|
|
|
commonName: www.example.com
|
2017-09-13 23:39:32 +02:00
|
|
|
C: US
|
|
|
|
ST: California
|
|
|
|
L: Los Angeles
|
|
|
|
O: ACME Inc.
|
2017-12-12 13:35:22 +01:00
|
|
|
OU:
|
|
|
|
- Roadrunner pest control
|
|
|
|
- Pyrotechnics
|
2017-09-14 18:03:00 +02:00
|
|
|
keyUsage:
|
|
|
|
- digitalSignature
|
|
|
|
extendedKeyUsage:
|
|
|
|
- ipsecUser
|
|
|
|
- biometricInfo
|
2017-09-13 23:39:32 +02:00
|
|
|
|
|
|
|
- import_tasks: ../tests/validate.yml
|
|
|
|
|
2017-11-27 23:58:08 +01:00
|
|
|
when: pyopenssl_version.stdout is version('0.15', '>=')
|