community / community.zabbix / 1.8.0 / module / zabbix_usergroup Create/delete/update Zabbix user groups Authors: Tobias Birkefeld (@tcraxs)community.zabbix.zabbix_usergroup (1.8.0) — module
Install with ansible-galaxy collection install community.zabbix:==1.8.0
collections: - name: community.zabbix version: 1.8.0
Create user groups if they do not exist.
Delete existing user groups if they exist and are empty.
Update existing user groups.
# Base create user group example - name: Create user group community.zabbix.zabbix_usergroup: server_url: "http://zabbix.example.com/zabbix/" login_user: admin login_password: secret name: ACME state: present
# Base create user group with disabled gui access - name: Create user group with disabled gui access community.zabbix.zabbix_usergroup: server_url: "http://zabbix.example.com/zabbix/" login_user: admin login_password: secret name: ACME gui_access: disable
# Base create user group with permissions - name: Create user group with permissions community.zabbix.zabbix_usergroup: server_url: "http://zabbix.example.com/zabbix/" login_user: admin login_password: secret name: ACME rights: - host_group: Webserver permission: read-write - host_group: Databaseserver permission: read-only state: present
# Base create user group with tag permissions - name: Create user group with tag permissions community.zabbix.zabbix_usergroup: server_url: "http://zabbix.example.com/zabbix/" login_user: admin login_password: secret name: ACME tag_filters: - host_group: Webserver tag: Application value: Java - host_group: Discovered hosts tag: Service value: JIRA state: present
# Base delete user groups example - name: Delete user groups community.zabbix.zabbix_usergroup: server_url: "http://zabbix.example.com/zabbix/" login_user: admin login_password: secret name: ACME state: absent
name: aliases: - user_group description: - Name of the user group to create, update or delete. required: true type: str state: choices: - present - absent default: present description: - State of the user group. - On C(present), it will create if user group does not exist or update the user group if the associated data is different. - On C(absent) will remove a user group if it exists. required: false type: str rights: description: - Permissions to assign to the group elements: dict required: false suboptions: host_group: description: - Name of the host group to add permission to. required: true type: str permission: choices: - denied - read-only - read-write description: - Access level to the host group. required: true type: str type: list status: choices: - enabled - disabled default: enabled description: - Whether the user group is enabled or disabled. required: false type: str timeout: default: 10 description: - The timeout of API request (seconds). type: int debug_mode: choices: - disabled - enabled default: disabled description: - Whether debug mode is enabled or disabled. required: false type: str gui_access: choices: - default - internal - LDAP - disable default: default description: - Frontend authentication method of the users in the group. - 'Possible values:' - default - use the system default authentication method; - internal - use internal authentication; - LDAP - use LDAP authentication; - disable - disable access to the frontend. required: false type: str login_user: description: - Zabbix user name. - If not set the environment variable C(ZABBIX_USERNAME) will be used. required: true type: str server_url: aliases: - url description: - URL of Zabbix server, with protocol (http or https). C(url) is an alias for C(server_url). - If not set the environment variable C(ZABBIX_SERVER) will be used. required: true type: str tag_filters: description: - Tag based permissions to assign to the group elements: dict required: false suboptions: host_group: description: - Name of the host group to add permission to. required: true type: str tag: default: '' description: - Tag name. required: false type: str value: default: '' description: - Tag value. required: false type: str type: list login_password: description: - Zabbix user password. - If not set the environment variable C(ZABBIX_PASSWORD) will be used. required: true type: str validate_certs: default: true description: - If set to False, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. - If not set the environment variable C(ZABBIX_VALIDATE_CERTS) will be used. type: bool http_login_user: description: - Basic Auth login type: str http_login_password: description: - Basic Auth password type: str
msg: description: The result of the operation returned: always sample: 'User group created: ACME, ID: 42' type: str state: description: User group state at the end of execution. returned: on success sample: present type: str usergroup: description: User group name. returned: on success sample: ACME type: str usrgrpid: description: User group id, if created, changed or deleted. returned: on success sample: '42' type: str