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
salt.modules.zookeeper.
create
(path, value='', acls=None, ephemeral=False, sequence=False, makepath=False, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶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
salt.modules.zookeeper.
delete
(path, version=- 1, recursive=False, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶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
salt.modules.zookeeper.
ensure_path
(path, acls=None, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶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
salt.modules.zookeeper.
exists
(path, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶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
salt.modules.zookeeper.
get
(path, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶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
salt.modules.zookeeper.
get_acls
(path, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶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
salt.modules.zookeeper.
get_children
(path, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶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
salt.modules.zookeeper.
make_digest_acl
(username, password, read=False, write=False, create=False, delete=False, admin=False, allperms=False)¶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
salt.modules.zookeeper.
set
(path, value, version=- 1, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶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
salt.modules.zookeeper.
set_acls
(path, acls, version=- 1, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶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