community.general.znode (0.2.1) — module

Create, delete, retrieve, and update znodes using ZooKeeper

Authors: Trey Perry (@treyperry)

Install collection

Install with ansible-galaxy collection install community.general:==0.2.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.2.1

Description

Create, delete, retrieve, and update znodes using ZooKeeper.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Creating or updating a znode with a given value
  znode:
    hosts: 'localhost:2181'
    name: /mypath
    value: myvalue
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Getting the value and stat structure for a znode
  znode:
    hosts: 'localhost:2181'
    name: /mypath
    op: get
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Listing a particular znode's children
  znode:
    hosts: 'localhost:2181'
    name: /zookeeper
    op: list
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Waiting 20 seconds for a znode to appear at path /mypath
  znode:
    hosts: 'localhost:2181'
    name: /mypath
    op: wait
    timeout: 20
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Deleting a znode at path /mypath
  znode:
    hosts: 'localhost:2181'
    name: /mypath
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: 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

Inputs

    
op:
    description:
    - An operation to perform. Mutually exclusive with state.

name:
    description:
    - The path of the znode.
    required: true

hosts:
    description:
    - A list of ZooKeeper servers (format '[server]:[port]').
    required: true

state:
    description:
    - The state to enforce. Mutually exclusive with op.

value:
    description:
    - The value assigned to the znode.

timeout:
    default: 300
    description:
    - The amount of time to wait for a node to appear.

recursive:
    default: 'no'
    description:
    - Recursively delete node and all its children.
    type: bool