SaltStack
new
all
kazoo
New in version 2018.3.0.
This module is not usable until the following are specified either in a pillar or in the minion's config file:
zookeeper:
hosts: zoo1,zoo2,zoo3
default_acl:
- username: daniel
password: test
read: true
write: true
create: true
delete: true
admin: true
username: daniel
password: test
If configuration for multiple zookeeper environments is required, they can be set up as different configuration profiles. For example:
zookeeper:
prod:
hosts: zoo1,zoo2,zoo3
default_acl:
- username: daniel
password: test
read: true
write: true
create: true
delete: true
admin: true
username: daniel
password: test
dev:
hosts:
- dev1
- dev2
- dev3
default_acl:
- username: daniel
password: test
read: true
write: true
create: true
delete: true
admin: true
username: daniel
password: test
Create Znode
path of znode to create
value to assign to znode (Default: '')
list of acl dictionaries to be assigned (Default: None)
indicate node is ephemeral (Default: False)
indicate node is suffixed with a unique index (Default: False)
Create parent paths if they do not exist (Default: False)
Configured Zookeeper profile to authenticate with (Default: None)
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
Scheme to authenticate with (Default: 'digest')
Username to authenticate (Default: None)
Password to authenticate (Default: None)
Default acls to assign if a node is created in this connection (Default: None)
CLI Example:
salt minion1 zookeeper.create /test/name daniel profile=prod
Delete znode
path to znode
only delete if version matches (Default: -1 (always matches))
Configured Zookeeper profile to authenticate with (Default: None)
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
Scheme to authenticate with (Default: 'digest')
Username to authenticate (Default: None)
Password to authenticate (Default: None)
Default acls to assign if a node is created in this connection (Default: None)
CLI Example:
salt minion1 zookeeper.delete /test/name profile=prod
Ensure Znode path exists
Parent path to create
list of acls dictionaries to be assigned (Default: None)
Configured Zookeeper profile to authenticate with (Default: None)
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
Scheme to authenticate with (Default: 'digest')
Username to authenticate (Default: None)
Password to authenticate (Default: None)
Default acls to assign if a node is created in this connection (Default: None)
CLI Example:
salt minion1 zookeeper.ensure_path /test/name profile=prod
Check if path exists
path to check
Configured Zookeeper profile to authenticate with (Default: None)
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
Scheme to authenticate with (Default: 'digest')
Username to authenticate (Default: None)
Password to authenticate (Default: None)
Default acls to assign if a node is created in this connection (Default: None)
CLI Example:
salt minion1 zookeeper.exists /test/name profile=prod
Get value saved in znode
path to check
Configured Zookeeper profile to authenticate with (Default: None)
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
Scheme to authenticate with (Default: 'digest')
Username to authenticate (Default: None)
Password to authenticate (Default: None)
Default acls to assign if a node is created in this connection (Default: None)
CLI Example:
salt minion1 zookeeper.get /test/name profile=prod
Get acls on a znode
path to znode
Configured Zookeeper profile to authenticate with (Default: None)
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
Scheme to authenticate with (Default: 'digest')
Username to authenticate (Default: None)
Password to authenticate (Default: None)
Default acls to assign if a node is created in this connection (Default: None)
CLI Example:
salt minion1 zookeeper.get_acls /test/name profile=prod
Get children in znode path
path to check
Configured Zookeeper profile to authenticate with (Default: None)
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
Scheme to authenticate with (Default: 'digest')
Username to authenticate (Default: None)
Password to authenticate (Default: None)
Default acls to assign if a node is created in this connection (Default: None)
CLI Example:
salt minion1 zookeeper.get_children /test profile=prod
Generate acl object
Note
This is heavily used in the zookeeper state and probably is not useful as a cli module
username of acl
plain text password of acl
read acl
write acl
create acl
delete acl
admin acl
set all other acls to True
CLI Example:
salt minion1 zookeeper.make_digest_acl username=daniel password=mypass allperms=True
Update znode with new value
znode to update
value to set in znode
only update znode if version matches (Default: -1 (always matches))
Configured Zookeeper profile to authenticate with (Default: None)
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
Scheme to authenticate with (Default: 'digest')
Username to authenticate (Default: None)
Password to authenticate (Default: None)
Default acls to assign if a node is created in this connection (Default: None)
CLI Example:
salt minion1 zookeeper.set /test/name gtmanfred profile=prod
Set acls on a znode
path to znode
list of acl dictionaries to set on the znode
only set acls if version matches (Default: -1 (always matches))
Configured Zookeeper profile to authenticate with (Default: None)
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
Scheme to authenticate with (Default: 'digest')
Username to authenticate (Default: None)
Password to authenticate (Default: None)
Default acls to assign if a node is created in this connection (Default: None)
CLI Example:
salt minion1 zookeeper.set_acls /test/name acls='[{"username": "gtmanfred", "password": "test", "all": True}]' profile=prod