Zookeeper State
kazoo
See salt.modules.zookeeper
for setup instructions.
For more information about acls, please checkout the kazoo documentation.
http://kazoo.readthedocs.io/en/latest/api/security.html#kazoo.security.make_digest_acl
The following options can be included in the acl dictionary:
- param username
Username to use for the ACL.
- param password
A plain-text password to hash.
- param write
Write permission.
- type write
bool
- param create
Create permission.
- type create
bool
- param delete
Delete permission.
- type delete
bool
- param admin
Admin permission.
- type admin
bool
- param all
All permissions.
- type all
bool
salt.states.zookeeper.
absent
(name, version=- 1, recursive=False, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶Make sure znode is absent
path to znode
Specify the version which should be deleted Default: -1 (always match)
Boolean to indicate if children should be recursively deleted 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)
delete znode:
zookeeper.absent:
- name: /test
- recursive: True
salt.states.zookeeper.
acls
(name, acls, version=- 1, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶Update acls on a znode
path to znode
list of acl dictionaries to set on znode
Specify the version which should be deleted Default: -1 (always match)
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)
update acls:
zookeeper.acls:
- name: /test/name
- acls:
- username: daniel
password: test
all: True
- username: gtmanfred
password: test
all: True
salt.states.zookeeper.
present
(name, value, acls=None, ephemeral=False, sequence=False, makepath=False, version=- 1, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None)¶Make sure znode is present in the correct state with the correct acls
path to znode
value znode should be set to
list of acl dictionaries to set on znode (make sure the ones salt is connected with are included) Default: None
Boolean to indicate if ephemeral znode should be created Default: False
Boolean to indicate if znode path is suffixed with a unique index Default: False
Boolean to indicate if the parent paths should be created Default: False
For updating, specify the version which should be updated Default: -1 (always match)
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)
add znode:
zookeeper.present:
- name: /test/name
- value: gtmanfred
- makepath: True
update znode:
zookeeper.present:
- name: /test/name
- value: daniel
- acls:
- username: daniel
password: test
read: true
- username: gtmanfred
password: test
read: true
write: true
create: true
delete: true
admin: true
- makepath: True