community / community.general / 3.8.10 / module / znode Create, delete, retrieve, and update znodes using ZooKeeper Authors: Trey Perry (@treyperry)community.general.znode (3.8.10) — module
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
Create, delete, retrieve, and update znodes using ZooKeeper.
- 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
op: choices: - get - wait - list description: - An operation to perform. Mutually exclusive with state. type: str name: description: - The path of the znode. required: true type: str hosts: description: - A list of ZooKeeper servers (format '[server]:[port]'). required: true type: str state: choices: - present - absent description: - The state to enforce. Mutually exclusive with op. type: str value: description: - The value assigned to the znode. type: str timeout: default: 300 description: - The amount of time to wait for a node to appear. type: int recursive: default: 'no' description: - Recursively delete node and all its children. type: bool