mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
Squashed commit of the following:
commit 406214fad214359fcf13fe8c7cd3f8f8faac5386 commit 85d1c9b0a41dd075eb2683b1a7de595ca3119614 commit 4aa5049b5ae25dee71a248238201611a466a13c4 commit 65a96974c80aea1fef88d78e218ecb665d8113e1 commit 22ea5863d1dfd628735b46cc7de51c0fd33251de Refactoring
This commit is contained in:
parent
39d3c3dea6
commit
2eb6b566b2
1 changed files with 16 additions and 0 deletions
|
@ -80,6 +80,15 @@ options:
|
||||||
choices: [ "yes", "no" ]
|
choices: [ "yes", "no" ]
|
||||||
default: "no"
|
default: "no"
|
||||||
version_added: "1.9"
|
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:
|
description:
|
||||||
- "Adds or removes authorized keys for particular user accounts"
|
- "Adds or removes authorized keys for particular user accounts"
|
||||||
author: "Ansible Core Team"
|
author: "Ansible Core Team"
|
||||||
|
@ -111,6 +120,11 @@ EXAMPLES = '''
|
||||||
key="{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
|
key="{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
|
||||||
key_options='no-port-forwarding,from="10.0.1.1"'
|
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
|
# Set up authorized_keys exclusively with one key
|
||||||
- authorized_key: user=root key="{{ item }}" state=present
|
- authorized_key: user=root key="{{ item }}" state=present
|
||||||
exclusive=yes
|
exclusive=yes
|
||||||
|
@ -358,6 +372,7 @@ def enforce_state(module, params):
|
||||||
state = params.get("state", "present")
|
state = params.get("state", "present")
|
||||||
key_options = params.get("key_options", None)
|
key_options = params.get("key_options", None)
|
||||||
exclusive = params.get("exclusive", False)
|
exclusive = params.get("exclusive", False)
|
||||||
|
validate_certs = params.get("validate_certs", True)
|
||||||
error_msg = "Error getting key from: %s"
|
error_msg = "Error getting key from: %s"
|
||||||
|
|
||||||
# if the key is a url, request it and use it as key source
|
# 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'),
|
key_options = dict(required=False, type='str'),
|
||||||
unique = dict(default=False, type='bool'),
|
unique = dict(default=False, type='bool'),
|
||||||
exclusive = dict(default=False, type='bool'),
|
exclusive = dict(default=False, type='bool'),
|
||||||
|
validate_certs = dict(default=True, type='bool'),
|
||||||
),
|
),
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue