diff --git a/lib/ansible/modules/crypto/openssl_csr.py b/lib/ansible/modules/crypto/openssl_csr.py index b6bb34b852..594d99a9b5 100644 --- a/lib/ansible/modules/crypto/openssl_csr.py +++ b/lib/ansible/modules/crypto/openssl_csr.py @@ -31,7 +31,7 @@ description: - "This module allows one to (re)generates OpenSSL certificate signing requests. It uses the pyOpenSSL python library to interact with openssl. This module support the subjectAltName extension. Note: At least one of commonName or subjectAltName must - be specified." + be specified. This module uses file common arguments to specify generated file permissions." requirements: - "python-pyOpenSSL" options: diff --git a/lib/ansible/modules/crypto/openssl_privatekey.py b/lib/ansible/modules/crypto/openssl_privatekey.py index 93044a318b..f2eeed837a 100644 --- a/lib/ansible/modules/crypto/openssl_privatekey.py +++ b/lib/ansible/modules/crypto/openssl_privatekey.py @@ -30,7 +30,8 @@ short_description: Generate OpenSSL private keys. description: - "This module allows one to (re)generate OpenSSL private keys. It uses the pyOpenSSL python library to interact with openssl. One can generate - either RSA or DSA private keys. Keys are generated in PEM format." + either RSA or DSA private keys. Keys are generated in PEM format. + This module uses file common arguments to specify generated file permissions." requirements: - "python-pyOpenSSL" options: diff --git a/lib/ansible/modules/crypto/openssl_publickey.py b/lib/ansible/modules/crypto/openssl_publickey.py index 59f28fe4c4..6534f6e2fe 100644 --- a/lib/ansible/modules/crypto/openssl_publickey.py +++ b/lib/ansible/modules/crypto/openssl_publickey.py @@ -30,7 +30,8 @@ short_description: Generate an OpenSSL public key from its private key. description: - "This module allows one to (re)generate OpenSSL public keys from their private keys. It uses the pyOpenSSL python library to interact with openssl. Keys are generated - in PEM format. This module works only if the version of PyOpenSSL is recent enough (> 16.0.0)" + in PEM format. This module works only if the version of PyOpenSSL is recent enough (> 16.0.0). + This module uses file common arguments to specify generated file permissions." requirements: - "python-pyOpenSSL" options: @@ -145,6 +146,10 @@ class PublicKey(object): publickey_file = open(self.path, 'w') publickey_file.write(publickey_content) publickey_file.close() + + file_args = module.load_file_common_arguments(module.params) + if module.set_fs_attributes_if_different(file_args, False): + self.changed = True except (IOError, OSError) as exc: raise PublicKeyError(exc) except AttributeError as exc: