community.general.znode – Create, delete, retrieve, and update znodes using ZooKeeper¶
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.znode
.
Requirements¶
The below requirements are needed on the host that executes this module.
kazoo >= 2.1
python >= 2.6
Parameters¶
Examples¶
- name: Creating or updating a znode with a given value
community.general.znode:
hosts: 'localhost:2181'
name: /mypath
value: myvalue
state: present
- name: Getting the value and stat structure for a znode
community.general.znode:
hosts: 'localhost:2181'
name: /mypath
op: get
- name: Listing a particular znode's children
community.general.znode:
hosts: 'localhost:2181'
name: /zookeeper
op: list
- name: Waiting 20 seconds for a znode to appear at path /mypath
community.general.znode:
hosts: 'localhost:2181'
name: /mypath
op: wait
timeout: 20
- name: Deleting a znode at path /mypath
community.general.znode:
hosts: 'localhost:2181'
name: /mypath
state: absent
- name: Creating or updating a znode with a given value on a remote Zookeeper
community.general.znode:
hosts: 'my-zookeeper-node:2181'
name: /mypath
value: myvalue
state: present
delegate_to: 127.0.0.1
Authors¶
Trey Perry (@treyperry)