Skip to content

Commit

Permalink
consul: fix session_id not associated with key/pair
Browse files Browse the repository at this point in the history
Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
  • Loading branch information
wilfriedroset committed Aug 26, 2022
1 parent 2900004 commit cdf25fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/xxxx-consul-session-token.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
minor_changes:
- consul - adds ``token`` parameter for session (https://github.com/ansible-collections/community.general/pull/xxxx).

bugfixes:
- consul - fix session not attached to the key/pair (https://github.com/ansible-collections/community.general/pull/xxxx).
2 changes: 2 additions & 0 deletions plugins/modules/clustering/consul/consul_kv.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def get_value(module):
def set_value(module):
consul_api = get_consul_api(module)

session = module.params.get('session')
key = module.params.get('key')
value = module.params.get('value')

Expand All @@ -247,6 +248,7 @@ def set_value(module):
if changed and not module.check_mode:
changed = consul_api.kv.put(key, value,
cas=module.params.get('cas'),
acquire=session,
flags=module.params.get('flags'))

stored = None
Expand Down

0 comments on commit cdf25fd

Please sign in to comment.