community.general.consul_session – Manipulate consul sessions¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.consul_session
.
Synopsis¶
Allows the addition, modification and deletion of sessions in a consul cluster. These sessions can then be used in conjunction with key value pairs to implement distributed locks. In depth documentation for working with sessions can be found at http://www.consul.io/docs/internals/sessions.html
Requirements¶
The below requirements are needed on the host that executes this module.
python-consul
requests
Parameters¶
Examples¶
- name: Register basic session with consul
community.general.consul_session:
name: session1
- name: Register a session with an existing check
community.general.consul_session:
name: session_with_check
checks:
- existing_check_name
- name: Register a session with lock_delay
community.general.consul_session:
name: session_with_delay
delay: 20s
- name: Retrieve info about session by id
community.general.consul_session:
id: session_id
state: info
- name: Retrieve active sessions
community.general.consul_session:
state: list
Authors¶
Steve Gargan (@sgargan)