summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeaceslav (Slava) Mindru <vmindru@redhat.com>2015-11-26 08:48:42 -0500
committerVeaceslav (Slava) Mindru <vmindru@redhat.com>2015-11-26 08:48:42 -0500
commit19abe233fed3cb04ec3344f549c48f8ea661aeab (patch)
tree15cf801b112b3502ab3b42ca7208bd70dee387ce
parent1ff0704c0c6dbc88e08f19620d7325aa5790d40f (diff)
downloadansible-modules-core-19abe233fed3cb04ec3344f549c48f8ea661aeab.tar.gz
Squashed commit of the following:
commit 406214fad214359fcf13fe8c7cd3f8f8faac5386 commit 85d1c9b0a41dd075eb2683b1a7de595ca3119614 commit 4aa5049b5ae25dee71a248238201611a466a13c4 commit 65a96974c80aea1fef88d78e218ecb665d8113e1 commit 22ea5863d1dfd628735b46cc7de51c0fd33251de Refactoring
-rw-r--r--system/authorized_key.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/system/authorized_key.py b/system/authorized_key.py
index 8a97722b..55c1ec43 100644
--- a/system/authorized_key.py
+++ b/system/authorized_key.py
@@ -80,6 +80,15 @@ options:
choices: [ "yes", "no" ]
default: "no"
version_added: "1.9"
+ validate_certs:
+ description:
+ - If C(no), SSL certificates will not be validated. This should only
+ set to C(no) used on personally controlled sites using self-signed
+ certificates. Prior to 2.0 the code defaulted to C(yes).
+ required: false
+ default: "yes"
+ choices: ["yes", "no"]
+ version_added: "2.0"
description:
- "Adds or removes authorized keys for particular user accounts"
author: "Ansible Core Team"
@@ -111,6 +120,11 @@ EXAMPLES = '''
key="{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
key_options='no-port-forwarding,from="10.0.1.1"'
+# Using validate_certs:
+- authorized_key: user=charlie
+ key=https://github.com/user.keys
+ validate_certs=no
+
# Set up authorized_keys exclusively with one key
- authorized_key: user=root key="{{ item }}" state=present
exclusive=yes
@@ -358,6 +372,7 @@ def enforce_state(module, params):
state = params.get("state", "present")
key_options = params.get("key_options", None)
exclusive = params.get("exclusive", False)
+ validate_certs = params.get("validate_certs", True)
error_msg = "Error getting key from: %s"
# if the key is a url, request it and use it as key source
@@ -460,6 +475,7 @@ def main():
key_options = dict(required=False, type='str'),
unique = dict(default=False, type='bool'),
exclusive = dict(default=False, type='bool'),
+ validate_certs = dict(default=True, type='bool'),
),
supports_check_mode=True
)