diff --git a/lib/ansible/modules/extras/crypto/openssl_privatekey.py b/lib/ansible/modules/extras/crypto/openssl_privatekey.py index 5055a2826e6..f7da9d11053 100644 --- a/lib/ansible/modules/extras/crypto/openssl_privatekey.py +++ b/lib/ansible/modules/extras/crypto/openssl_privatekey.py @@ -210,7 +210,7 @@ def main(): module.fail_json(name=base_dir, msg='The directory %s does not exist or the file is not a directory' % base_dir) if not module.params['mode']: - module.params['mode'] = 0600 + module.params['mode'] = int('0600', 8) private_key = PrivateKey(module) if private_key.state == 'present':