community / community.zabbix / 1.8.0 / module / zabbix_user Create/update/delete Zabbix users Authors: sky-joker (@sky-joker)community.zabbix.zabbix_user (1.8.0) — module
Install with ansible-galaxy collection install community.zabbix:==1.8.0
collections: - name: community.zabbix version: 1.8.0
This module allows you to create, modify and delete Zabbix users.
- name: create a new zabbix user. community.zabbix.zabbix_user: server_url: "http://zabbix.example.com/zabbix/" login_user: Admin login_password: secret username: example name: user name surname: user surname usrgrps: - Guests - Disabled passwd: password lang: en_GB theme: blue-theme autologin: no autologout: '0' refresh: '30' rows_per_page: '200' after_login_url: '' user_medias: - mediatype: Email sendto: example@example.com period: 1-7,00:00-24:00 severity: not_classified: no information: yes warning: yes average: yes high: yes disaster: yes active: no type: Zabbix super admin state: present
- name: delete existing zabbix user. community.zabbix.zabbix_user: server_url: "http://zabbix.example.com/zabbix/" login_user: admin login_password: secret username: example usrgrps: - Guests passwd: password user_medias: - sendto: example@example.com state: absent
lang: choices: - en_GB - en_US - zh_CN - cs_CZ - fr_FR - he_IL - it_IT - ko_KR - ja_JP - nb_NO - pl_PL - pt_BR - pt_PT - ru_RU - sk_SK - tr_TR - uk_UA - default description: - Language code of the user's language. - C(default) can be used with Zabbix version 5.2 or higher. type: str name: description: - Name of the user. type: str type: choices: - Zabbix user - Zabbix admin - Zabbix super admin description: - Type of the user. - I(type) can be used when Zabbix version is 5.0 or lower. type: str state: choices: - present - absent default: present description: - State of the user. - On C(present), it will create if user does not exist or update the user if the associated data is different. - On C(absent) will remove a user if it exists. type: str theme: choices: - default - blue-theme - dark-theme description: - User's theme. type: str passwd: description: - User's password. - Required unless all of the I(usrgrps) are set to use LDAP as frontend access. - Always required for Zabbix versions lower than 4.0. required: false type: str refresh: description: - Automatic refresh period in seconds. type: str surname: description: - Surname of the user. type: str timeout: default: 10 description: - The timeout of API request (seconds). type: int usrgrps: description: - User groups to add the user to. - Required when I(state=present). elements: str required: false type: list timezone: description: - User's time zone. - I(timezone) can be used with Zabbix version 5.2 or higher. - For the full list of supported time zones please refer to U(https://www.php.net/manual/en/timezones.php) type: str version_added: 1.2.0 version_added_collection: community.zabbix username: aliases: - alias description: - Name of the user alias in Zabbix. - username is the unique identifier used and cannot be updated using this module. - alias should be replaced with username required: true type: str autologin: description: - Whether to enable auto-login. - If enable autologin, cannot enable autologout. type: bool role_name: description: - User's role. - I(role_name) can be used when Zabbix version is 5.2 or higher. - Default is C(User role) when creating a new user. - The default value will be removed at the version 2.0.0. type: str version_added: 1.2.0 version_added_collection: community.zabbix autologout: description: - User session life time in seconds. If set to 0, the session will never expire. - If enable autologout, cannot enable autologin. 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 user_medias: description: - Set the user's media. - If not set, makes no changes to media. elements: dict suboptions: active: default: true description: - Whether the media is enabled. type: bool mediatype: default: Email description: - Media type name to set. type: str period: default: 1-7,00:00-24:00 description: - Time when the notifications can be sent as a time period or user macros separated by a semicolon. - Please review the documentation for more information on the supported time period. - https://www.zabbix.com/documentation/4.0/manual/appendix/time_period type: str sendto: description: - Address, user name or other identifier of the recipient. required: true type: str severity: default: average: true disaster: true high: true information: true not_classified: true warning: true description: - Trigger severities to send notifications about. suboptions: average: default: true description: - severity average enable/disable. type: bool disaster: default: true description: - severity disaster enable/disable. type: bool high: default: true description: - severity high enable/disable. type: bool information: default: true description: - severity information enable/disable. type: bool not_classified: default: true description: - severity not_classified enable/disable. type: bool warning: default: true description: - severity warning enable/disable. type: bool type: dict type: list rows_per_page: description: - Amount of object rows to show per page. type: str 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 after_login_url: description: - URL of the page to redirect the user to after logging in. type: str http_login_user: description: - Basic Auth login type: str override_passwd: default: false description: - Override password for the user. - Password will not be updated on subsequent runs without setting this value to yes. type: bool http_login_password: description: - Basic Auth password type: str
user_ids: description: User id created or changed returned: success sample: userids: - '5' type: dict