openssl_certificate: Correctly set the version (#30314)

Current openssl_certificate is mistakenly taking its derivating its
version number from the csr version number.

Thos two fields are completly unrelated and hence the version number of
the certificate should be able to be directly specified (via
selfsigned_version parameter).
This commit is contained in:
Yanis Guenane 2017-09-14 15:21:32 +02:00 committed by René Moser
commit 3e4a306a42
4 changed files with 35 additions and 4 deletions

View file

@ -28,6 +28,15 @@
- sha256WithRSAEncryption
- sha256WithECDSAEncryption
- 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
- name: Generate privatekey2
openssl_privatekey:
path: '{{ output_dir }}/privatekey2.pem'