- Docs »
- znode - Create, delete, retrieve, and update znodes using ZooKeeper
-
You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
znode - Create, delete, retrieve, and update znodes using ZooKeeper
- Create, delete, retrieve, and update znodes using ZooKeeper.
The below requirements are needed on the host that executes this module.
- kazoo >= 2.1
- python >= 2.6
Parameter |
Choices/Defaults |
Comments |
hosts
required |
|
A list of ZooKeeper servers (format '[server]:[port]').
|
name
required |
|
The path of the znode.
|
op
|
|
An operation to perform. Mutually exclusive with state.
|
recursive
bool
(added in 2.1) |
|
Recursively delete node and all its children.
|
state
|
|
The state to enforce. Mutually exclusive with op.
|
timeout
|
Default:
300
|
The amount of time to wait for a node to appear.
|
value
|
|
The value assigned to the znode.
|
# Creating or updating a znode with a given value
- znode:
hosts: 'localhost:2181'
name: /mypath
value: myvalue
state: present
# Getting the value and stat structure for a znode
- znode:
hosts: 'localhost:2181'
name: /mypath
op: get
# Listing a particular znode's children
- znode:
hosts: 'localhost:2181'
name: /zookeeper
op: list
# Waiting 20 seconds for a znode to appear at path /mypath
- znode:
hosts: 'localhost:2181'
name: /mypath
op: wait
timeout: 20
# Deleting a znode at path /mypath
- znode:
hosts: 'localhost:2181'
name: /mypath
state: absent
# Creating or updating a znode with a given value on a remote Zookeeper
- znode:
hosts: 'my-zookeeper-node:2181'
name: /mypath
value: myvalue
state: present
delegate_to: 127.0.0.1
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.