when I run below mentioned commands to generate RSA and csr in linux prompt , its require a password (Enter pass phrase for pradeep.key) and mention there “abc” password. Please do let me know how to capture this password in ansible script. When I mention -des3 then its require the password and its mandatory part.
- openssl genrsa -des3 -out pradeep.key 2048
- openssl req -new -key pradeep.key -out pradeepcsr.csr -config set.txt
- openssl pkcs12 -export -out pradeep.p12 -inkey pradeep.key -in cert.pem
Generating RSA private key, 2048 bit long modulus
…+++
…+++
e is 65537 (0x10001)
Enter pass phrase for pradeep.key:
Verifying - Enter pass phrase for pradeep.key:
I mentioned below ansible script :
command: openssl genrsa
-des3
-out “/app/ex.key” 2048
command: openssl req
-new
-subj ‘/C=US/ST=Florida/L=atlanta View/O=xx/CN=abc’
-key “/app/ex.key”
-out “/app/ex.csr”
Secondly, can we do this part with any ansible module, I tried with openssl_privatekey but its not cover all above details.