1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

consul: add support for session token (#5193) (#5222)

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
(cherry picked from commit feabe20c63)

Co-authored-by: wilfriedroset <wilfriedroset@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2022-09-03 12:23:02 +02:00 committed by GitHub
parent 1cddae2265
commit 73ee9702db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- consul_session - adds ``token`` parameter for session (https://github.com/ansible-collections/community.general/pull/5193).

View file

@ -279,7 +279,7 @@ def remove_value(module):
data=existing) data=existing)
def get_consul_api(module, token=None): def get_consul_api(module):
return consul.Consul(host=module.params.get('host'), return consul.Consul(host=module.params.get('host'),
port=module.params.get('port'), port=module.params.get('port'),
scheme=module.params.get('scheme'), scheme=module.params.get('scheme'),

View file

@ -101,6 +101,12 @@ options:
- Specifies the duration of a session in seconds (between 10 and 86400). - Specifies the duration of a session in seconds (between 10 and 86400).
type: int type: int
version_added: 5.4.0 version_added: 5.4.0
token:
description:
- The token key identifying an ACL rule set that controls access to
the key value pair.
type: str
version_added: 5.6.0
''' '''
EXAMPLES = ''' EXAMPLES = '''
@ -241,7 +247,8 @@ def get_consul_api(module):
return consul.Consul(host=module.params.get('host'), return consul.Consul(host=module.params.get('host'),
port=module.params.get('port'), port=module.params.get('port'),
scheme=module.params.get('scheme'), scheme=module.params.get('scheme'),
verify=module.params.get('validate_certs')) verify=module.params.get('validate_certs'),
token=module.params.get('token'))
def test_dependencies(module): def test_dependencies(module):
@ -265,6 +272,7 @@ def main():
node=dict(type='str'), node=dict(type='str'),
state=dict(type='str', default='present', choices=['absent', 'info', 'list', 'node', 'present']), state=dict(type='str', default='present', choices=['absent', 'info', 'list', 'node', 'present']),
datacenter=dict(type='str'), datacenter=dict(type='str'),
token=dict(type='str', no_log=True),
) )
module = AnsibleModule( module = AnsibleModule(