Documentation

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

New in version 2.0.

Synopsis

Requirements (on host that executes module)

  • kazoo >= 2.1
  • python >= 2.6

Options

parameter required default choices comments
hosts
yes
    A list of ZooKeeper servers (format '[server]:[port]').
    name
    yes
      The path of the znode.
      op
      no None
        An operation to perform. Mutually exclusive with state.
        recursive
        (added in 2.1)
        no
          Recursively delete node and all its children.
          state
          no None
            The state to enforce. Mutually exclusive with op.
            timeout
            no 300
              The amount of time to wait for a node to appear.
              value
              no None
                The value assigned to the znode.

                Examples

                # Creating or updating a znode with a given value
                - action: znode hosts=localhost:2181 name=/mypath value=myvalue state=present
                
                # Getting the value and stat structure for a znode
                - action: znode hosts=localhost:2181 name=/mypath op=get
                
                # Listing a particular znode's children
                - action: znode hosts=localhost:2181 name=/zookeeper op=list
                
                # Waiting 20 seconds for a znode to appear at path /mypath
                - action: znode hosts=localhost:2181 name=/mypath op=wait timeout=20
                
                # Deleting a znode at path /mypath
                - action: znode hosts=localhost:2181 name=/mypath state=absent
                

                This is an Extras Module

                For more information on what this means please read Extras Modules

                For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.