Init: mediaserver

This commit is contained in:
2023-02-08 12:13:28 +01:00
parent 848bc9739c
commit f7c23d4ba9
31914 changed files with 6175775 additions and 0 deletions

View File

@@ -0,0 +1,581 @@
==============================
community.zabbix Release Notes
==============================
.. contents:: Topics
v1.9.1
======
Minor Changes
-------------
- zabbix suport for rhel 9
Bugfixes
--------
- all modules - remove deprecation warnings for modules parameters related to zabbix-api when these parapmeters are not explicetely defined
- all roles and modules integration tests - replace deprecated include module whith include_tasks
- zabbix_agent, zabbix_proxy roles, all modules - make httpapi connection work with HTTP Basic Authorization
- zabbix_proxy - do not set ServerPort config parameter which was removed in Zabbix 6.0
- zabbix_server role Debian.yml task - remove warn: arg for shell module as the arg is deprecated since ansible-core above 2.13
- zabbix_user_role module - creation of a User Role with Super Admin type
v1.9.0
======
Major Changes
-------------
- all modules are opting away from zabbix-api and using httpapi ansible.netcommon plugin. We will support zabbix-api for backwards compatibility until next major release. See our README.md for more information about how to migrate
- zabbix_agent and zabbix_proxy roles are opting away from zabbix-api and use httpapi ansible.netcommon plugin. We will support zabbix-api for backwards compatibility until next major release. See our README.md for more information about how to migrate
Minor Changes
-------------
- ansible_zabbix_url_path introduced to be able to specify non-default Zabbix WebUI path, e.g. http://<FQDN>/zabbixeu
- collection now supports creating ``module_defaults`` for ``group/community.zabbix.zabbix`` (see https://github.com/ansible-collections/community.zabbix/issues/326)
- fixed ``zabbix_server`` role failure running in check_mode (see https://github.com/ansible-collections/community.zabbix/issues/804)
- zabbix_agent - give Zabbix Agent access to the Linux DMI table allowing system.hw.chassis info to populate.
- zabbix_template - add support for template tags
- zabbix_user_role module added
- zabbix_web - add support for Ubuntu 22.04 jammy
Bugfixes
--------
- The inventory script had insufficient error handling in case the Zabbix API provided an empty interfaces list. This bugfix checks for an exisiting interfaces element, then for the minimal length of 1 so that the first interface will only be accessed when it really exists in the api response. (https://github.com/ansible-collections/community.zabbix/issues/826)
- zabbix-proxy - updated to install correct sources for Debian arm64 family
- zabbix_agent - Filter IPv6 addresses from list of IP as Zabbix host creation expects IPv4
- zabbix_agent - installation on Windows will no longer fail when zabbix_agent2 is used
- zabbix_host - fix updating of host without interfaces
- zabbix_proxy - correctly provision tls_accept and tls_connect on Zabbix backend
- zabbix_proxy - updated the datafiles_path fact for the zabbix_proxy and zabbix_server roles due to upstream change
- zabbix_server - move location of the fping(6) variables to distribution specific files (https://github.com/ansible-collections/community.zabbix/issues/812)
- zabbix_server - updated the datafiles_path fact for the zabbix_proxy and zabbix_server roles due to upstream change
v1.8.0
======
Minor Changes
-------------
- roles - Minimized the config templates for the zabbix_agent, zabbix_javagateway, zabbix_proxy, and zabbix_server roles to make them version independent.
- roles - Support for Zabbix 6.2 has been added
- roles - Updated the version defaults to select the latest version supported by an operating system.
- zabbix_action - added another condition operator naming options (contains, does not contain,...)
- zabbix_agent - Set a ansible_python_interpreter to localhost based on the env the playbook is executed from.
- zabbix_agent - add option to set host tags using ``zabbix_agent_tags``.
- zabbix_agent - add possiblity to set include file pattern using ``zabbix_agent(2)_include_pattern`` variable.
- zabbix_agent - is now able to manage directories and upload files for TLS PSK configuration used with Windows operating systems
- zabbix_agent - new options for Windows installations zabbix_win_install_dir_conf/bin
- zabbix_agent - when configuring firewalld, make sure the new rule is applied immediately
- zabbix_authentication - module updated to support Zabbix 6.2
- zabbix_host - using ``tls_psk_identity`` or ``tls_psk`` parameters with Zabbix >= 5.4 makes this module non-idempotent
- zabbix_host - will no longer wipe tls_connect en tls_accept settings when not specified on update
- zabbix_mediatype - added support for time units in ``attempt_interval`` parameter
- zabbix_template - added support for template groups (Zabbix >= 6.2)
- zabbix_template_info - add template_id return value
- zabbix_template_info - add yaml and none formats
- zabbix_user_directory - added new module to support multiple sources for LDAP authentication
Bugfixes
--------
- zabbix_host - fixed idempotency of the module when hostmacros or snmp interfaces are used
- zabbix_script - fix compatibility with Zabbix <5.4.
- zabbix_script - should no longer fail when description is not set
v1.7.0
======
Minor Changes
-------------
- helpers.helper_compare_lists() changed logic to not consider the order of elements in lists. (https://github.com/ansible-collections/community.zabbix/pull/683)
- zabbix_action, zabbix_maintenance, zabbix_mediatype, zabbix_proxy, zabbix_service - updated to work with Zabbix 6.0. (https://github.com/ansible-collections/community.zabbix/pull/683)
- zabbix_script module added (https://github.com/ansible-collections/community.zabbix/issues/634)
Bugfixes
--------
- Include ``PSF-license.txt`` file for ``plugins/module_utils/_version.py``.
- zabbix_action - will no longer wipe `esc_step_to` and `esc_step_from` (https://github.com/ansible-collections/community.zabbix/issues/692)
- zabbix_agent - added support for zabbix-agent on Ubuntu 22.04 (https://github.com/ansible-collections/community.zabbix/pull/681)
- zabbix_agent - now properly creates webroot for issuing LE certificates (https://github.com/ansible-collections/community.zabbix/pull/677, https://github.com/ansible-collections/community.zabbix/pull/682)
- zabbix_proxy (module) - passive proxy should be now correctly created in Zabbix 6.0 (https://github.com/ansible-collections/community.zabbix/pull/697)
- zabbix_proxy (role) - fixed accidental regression of TLS psk file being generated for passive agent (#528) caused in (#663) (https://github.com/ansible-collections/community.zabbix/issues/680)
New Modules
-----------
- community.zabbix.zabbix_script - Create/update/delete Zabbix scripts
v1.6.0
======
Minor Changes
-------------
- all modules - prepare for deprecation of distutils LooseVersion.
- collection - Add dependencies to other collections. This helps Ansible Galaxy automatically downloading collections that this collection relies on to run.
- connection.httpapi (plugin) - add initial httpapi connection plugin.
- httpapi.jsonrpc (plugin) - add initial httpapi for future handling of json-rpc.
- new module zabbix authentication for configuring global authentication settings in Zabbix Server's Settings section of GUI.
- new module zabbix_autoregister for configuring global autoregistration settings in Zabbix Server's Settings section of GUI.
- new module zabbix_housekeeping for configuring global housekeeping settings in Zabbix Server's Settings section of GUI.
- test_zabbix_host_info - fix Template/Group names for 5.4
- test_zabbix_screen - disable testing for screen in 5.4 (deprecated)
- zabbix_action - additional fixes to make module work with Zabbix 6.0 (https://github.com/ansible-collections/community.zabbix/pull/664)
- zabbix_action - module ported to work with Zabbix 6.0 (https://github.com/ansible-collections/community.zabbix/pull/648, https://github.com/ansible-collections/community.zabbix/pull/653)
- zabbix_action - should now correctly actions with maintenance_status conditions (https://github.com/ansible-collections/community.zabbix/pull/667)
- zabbix_agent - Check if 'firewalld' exist and is running when handler is executed.
- zabbix_agent - Fixed use of bare variables in conditions (https://github.com/ansible-collections/community.zabbix/pull/663)
- zabbix_agent - Install the correct Python libxml2 package on SLES15
- zabbix_agent - Move inclusion of the apache.yml tasks to later stage during execution of role.
- zabbix_agent - Prepare for Zabbix 6.0.
- zabbix_agent - Specify a minor version with zabbix_agent_version_minor for RH systems.
- zabbix_agent - There was no way to configure a specific type for the macro.
- zabbix_agent - Use multiple aliases in the configuration file with ``zabbix_agent_zabbix_alias`` or ``zabbix_agent2_zabbix_alias``.
- zabbix_maintenance - added new module parameter `tags`, which allows configuring Problem Tags on maintenances.
- zabbix_maintenance - fixed to work with Zabbix 6.0+ and Python 3.9+ (https://github.com/ansible-collections/community.zabbix/pull/665)
- zabbix_proxy - Prepare for Zabbix 6.0.
- zabbix_proxy - Specify a minor version with zabbix_proxy_version_minor for RH systems.
- zabbix_proxy - Support for Sangoma and treat it like a RHEL system.
- zabbix_server - Check the 'zabbix_server_install_database_client' variable in RedHat tasks.
- zabbix_server - Prepare for Zabbix 6.0.
- zabbix_server - Specify a minor version with zabbix_server_version_minor for RH systems.
- zabbix_user - change alias property to username (changed in 5.4) (alias is now an alias for username)
- zabbix_user_info - change alias property to username (changed in 5.4) (alias is now an alias for username)
- zabbix_web - Change format ENCRYPTION, VERIFY_HOST from string to boolean.
- zabbix_web - Specify a minor version with zabbix_web_version_minor for RH systems.
Bugfixes
--------
- Various modules and plugins - use vendored version of ``distutils.version`` instead of the deprecated Python standard library ``distutils`` (https://github.com/ansible-collections/community.zabbix/pull/603). This superseedes #597.
- ZapiWrapper (module_utils) - fix only partial zabbix version is returned.
- zabbix_agent - Install Zabbix packages when zabbix_repo == other is used with yum.
- zabbix_agent - Install the Agent for MacOSX sooner than its configuration.
- zabbix_agent - The ``Install gpg key`` task for Debian did not work when a http proxy is configured.
- zabbix_agent - Use the correct URL with correct version.
- zabbix_agent - Use the correct path to determine Zabbix Agent 2 installation on Windows.
- zabbix_agent - Using the correct hostgroup as default now.
- zabbix_agent - fix for the autopsk, incl. tests with Molecule.
- zabbix_host - Added small notification that an user should have read access to get hostgroups overview.
- zabbix_host - adapter changed properties for interface comparisson
- zabbix_maintenance - should now work when creating maintenace on Zabbix 6.0 server
- zabbix_proxy - 'zcat' the zipped sql files to /tmp before executing it.
- zabbix_proxy - Check MySQL version before settings mysql_innodb_default_row_format value.
- zabbix_proxy - Install Zabbix packages when zabbix_repo == other is used with yum.
- zabbix_server - 'zcat' the zipped sql files to /tmp before executing it.
- zabbix_server - Check MySQL version before settings mysql_innodb_default_row_format value.
- zabbix_server - Install Zabbix packages when zabbix_repo == other is used with yum.
- zabbix_template - setting correct null values to fix unintentional changes
- zabbix_web - Added some default variables if the geerlingguys apache role is not used.
- zabbix_web - Specified the correct versions for php.
New Plugins
-----------
Connection
~~~~~~~~~~
- community.zabbix.httpapi - Use httpapi to run command on network appliances
Httpapi
~~~~~~~
- community.zabbix.jsonrpc - HttpApi Plugin for Zabbix
New Modules
-----------
- community.zabbix.zabbix_authentication - Update Zabbix authentication
- community.zabbix.zabbix_autoregister - Update Zabbix autoregistration
- community.zabbix.zabbix_housekeeping - Update Zabbix housekeeping
v1.5.1
======
Minor Changes
-------------
- Enabled usage of environment variables for modules by adding a fallback lookup in the module_utils/helpers.py - zabbix_common_argument_spec
Bugfixes
--------
- template - use templateid property when linking templates for ``template.create`` and ``template.update`` API calls.
- zabbix inventory - Moved ZABBIX_VALIDATE_CERTS to correct option, validate_certs.
- zabbix_agent - Create the actual configuration file for Windows setups.
- zabbix_agent - Fix typo for correct using the zabbix_windows_service.exists
- zabbix_agent - tlspsk_auto to support become on Linux and ignore on windows
- zabbix_user - fix zabbix_user require password only on internal.
v1.5.0
======
Minor Changes
-------------
- Added requirements.txt to collection root to be used with Ansible Builder. See https://ansible-builder.readthedocs.io/en/latest/collection_metadata.html
- some roles are now using new naming for API connection parameters (https://github.com/ansible-collections/community.zabbix/pull/492 and https://github.com/ansible-collections/community.zabbix/pull/495).
- some roles can now utilize an option `zabbix_repo_yum_gpgcheck` to enable/disable GPG check for YUM repository (https://github.com/ansible-collections/community.zabbix/pull/438).
- zabbix inventory - Enabled the usage of environment variables in zabbix inventory plugin.
- zabbix inventory plugin - can now use environment variables ZABBIX_SERVER, ZABBIX_USERNAME and ZABBIX_PASSWORD for connection purposes to the Zabbix API.
- zabbix_agent - `zabbix_agent_loadmodule` can also be configured with a list.
- zabbix_agent - new `zabbix_api_timeout` option.
- zabbix_agent - now supports DenyKeys configuration.
- zabbix_hostmacro - now supports creating macros of type secret and vault.
- zabbix_proxy (role) - new `zabbix_api_timeout` option.
- zabbix_proxy_info - new module that allows to retrieve information about configured Zabbix Proxies.
- zabbix_server - added support for TimescaleDB (https://github.com/ansible-collections/community.zabbix/pull/428).
Breaking Changes / Porting Guide
--------------------------------
- all roles now reference other roles and modules via their fully qualified collection names, which makes Ansible 2.10 minimum supported version for roles (See https://github.com/ansible-collections/community.zabbix/pull/477).
Bugfixes
--------
- all roles now support installing zabbix 4.0 version on Ubuntu 20.04.
- all roles now supports installations on Debian 11.
- zabbix inventory - Change default value for host_zapi_query from list "[]" to dict "{}".
- zabbix_action - should no longer fail with Zabbix version 5.4.
- zabbix_agent - `zabbix_win_install_dir` no longer ignored for zabbix_agentd.d and zabbix log directories.
- zabbix_agent - auto-recovery for Windows installation has been fixed (https://github.com/ansible-collections/community.zabbix/pull/470).
- zabbix_agent - deploying zabbix_agent2 under Windows should now be possible (Thanks to https://github.com/ansible-collections/community.zabbix/pull/433 and https://github.com/ansible-collections/community.zabbix/pull/453).
- zabbix_agent - fixed AutoPSK for Windows deployments (https://github.com/ansible-collections/community.zabbix/pull/450).
- zabbix_host - Fix error when updating hosts caused by Zabbix bug not returning the inventory_mode field for hosts(https://github.com/ansible-collections/community.zabbix/issues/385).
- zabbix_host - will not break when `tls_psk*` parameters are set with Zabbix version 5.4.
- zabbix_proxy (module) - now supports configuring `tls_psk*` parameters.
- zabbix_proxy (role) - TLS config should now properly configure certificates.
- zabbix_proxy (role) - should no longer fail on permission problems wren configured to use SQLite database and now installs correct package sqlite3 on Debian systems.
- zabbix_web - `zabbix_nginx_vhost_*` parameters are no longer ignored.
- zabbix_web - executing role with `--tags` should now correctly include distribution specific variables (https://github.com/ansible-collections/community.zabbix/pull/448).
- zabbix_web - now correctly restarts php-fpm service (https://github.com/ansible-collections/community.zabbix/pull/427).
- zabbix_web - permissions for accesing php-fpm socket has been fixed (See https://github.com/ansible-collections/community.zabbix/pull/426).
New Modules
-----------
- community.zabbix.zabbix_proxy_info - Gather information about Zabbix proxy
v1.4.0
======
Minor Changes
-------------
- all roles were updated to support Zabbix 5.4 release (https://github.com/ansible-collections/community.zabbix/pull/405)
- new inventory plugin zabbix_inventory (https://github.com/ansible-collections/community.zabbix/pull/373)
- new module plugin zabbix_globalmacro (https://github.com/ansible-collections/community.zabbix/pull/377)
- zabbix_agent - `zabbix_agent_src_reinstall` now defaults to `False` (https://github.com/ansible-collections/community.zabbix/pull/403)
- zabbix_agent - now supports setting AllowKey (https://github.com/ansible-collections/community.zabbix/pull/358)
- zabbix_globalmacros - it is now possible to create global macros using this module (https://github.com/ansible-collections/community.zabbix/pull/377).
- zabbix_inventory - Created Ansible - Zabbix inventory plugin to create dynamic inventory from Zabbix.
- zabbix_maintenance - it is now possible to target hosts by their technical name if it differs from the visible name
- zabbix_proxy - Add MySQL Python 3 package installation.
- zabbix_server - Add MySQL Python 3 package installation.
- zabbix_server - now supports setting StartLLDProcessors (https://github.com/ansible-collections/community.zabbix/pull/361)
- zabbix_user - now supports parameter `username` as an alternative to `alias` (https://github.com/ansible-collections/community.zabbix/pull/406)
- zabbix_user - removed some of the default values because a configuration should be changed only if specified as a parameter (https://github.com/ansible-collections/community.zabbix/pull/382).
- zabbix_web - now supports setting SAML certificates (https://github.com/ansible-collections/community.zabbix/pull/408)
Bugfixes
--------
- zabbix_agent - StatusPort will be configured only when `zabbix_agent2_statusport` is defined (https://github.com/ansible-collections/community.zabbix/pull/378)
- zabbix_agent - fixed issue preventing installation of zabbix-agent 4.2 on Ubuntu Focal 20.04 (https://github.com/ansible-collections/community.zabbix/pull/390)
- zabbix_agent - role will now configure correct port for hostinterface in Zabbix Server if `zabbix_agent2_listenport` is defined (https://github.com/ansible-collections/community.zabbix/pull/400)
- zabbix_agent - should no longer be failing on Windows platform due to re-running all of the tasks for the 2nd time (https://github.com/ansible-collections/community.zabbix/pull/376)
- zabbix_agent - should no longer fail while cleaning up zabbix_agent installation if Zabbix Agent2 is being used (https://github.com/ansible-collections/community.zabbix/pull/409)
- zabbix_agent - will no longer install zabbix_get package on Debian systems when `zabbix_agent_install_agent_only` is defined (https://github.com/ansible-collections/community.zabbix/pull/363)
- zabbix_host - fixed issue where module was idempotent when multiple host interfaces of the same type were present (https://github.com/ansible-collections/community.zabbix/pull/391)
- zabbix_proxy (role) - will no longer fail on proxy creation in Zabbix Server when TLS parameters are used (https://github.com/ansible-collections/community.zabbix/pull/388)
- zabbix_server - Removed the removal everything from /tmp directory command as it removes things that it shouldnt do.
- zabbix_template - first time import of template now works with Zabbix 5.4 (https://github.com/ansible-collections/community.zabbix/pull/407), please note that rerunning the task will fail as there are breaking changes in Zabbix 5.4 API that module not yet covers.
- zabbix_user - now works with Zabbix 5.4 (https://github.com/ansible-collections/community.zabbix/pull/406)
New Plugins
-----------
Inventory
~~~~~~~~~
- community.zabbix.zabbix_inventory - Zabbix Inventory Plugin
New Modules
-----------
- community.zabbix.zabbix_globalmacro - Create/update/delete Zabbix Global macros
v1.3.0
======
Release Summary
---------------
| Release date: 2021-03-20 | Last major release to support Zabbix server 3.X versions in plugins.
Minor Changes
-------------
- zabbix_agent - added support for installations on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
- zabbix_proxy - now supports configuring StatsAllowedIP (https://github.com/ansible-collections/community.zabbix/pull/337).
- zabbix_server - added support for installtions on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
- zabbix_web - added support for installtions on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
Security Fixes
--------------
- zabbix_action - no longer exposes remote SSH command password used in operations, recovery & acknowledge operations to system logs (https://github.com/ansible-collections/community.zabbix/pull/345).
- zabbix_discovery_rule - no longer exposes SNMPv3 auth and priv passphrases to system logs (https://github.com/ansible-collections/community.zabbix/pull/345).
- zabbix_host - no longer exposes SNMPv3 auth and priv passphrases to system logs (https://github.com/ansible-collections/community.zabbix/pull/345).
Bugfixes
--------
- zabbix_action - now properly filters discovery rule checks by name (https://github.com/ansible-collections/community.zabbix/pull/349).
- zabbix_agent - corrected version for Windows agents (https://github.com/ansible-collections/community.zabbix/pull/316).
- zabbix_agent - fixed download URL for MacOS (https://github.com/ansible-collections/community.zabbix/pull/325).
- zabbix_server - now installs correct MySQL client packages on RHEL8 systems (https://github.com/ansible-collections/community.zabbix/pull/343).
- zabbix_template - fixed an issue with Python2 where module wouldn't decode Unicode characters (https://github.com/ansible-collections/community.zabbix/pull/322).
- zabbix_web - fixed installation of python3-libsemanage package RHEL7 and older systems (https://github.com/ansible-collections/community.zabbix/pull/330).
- zabbix_web - role should now correctly determine naming of PHP packages on older systems (https://github.com/ansible-collections/community.zabbix/pull/344).
- zabbix_web - updated default PHP version for Debian10 (https://github.com/ansible-collections/community.zabbix/pull/323).
v1.2.0
======
Release Summary
---------------
| Release date: 2021-01-11 | Last major release to support Zabbix server 3.X versions in plugins.
Minor Changes
-------------
- Updated the roles to support Zabbix 5.2.
- zabbix_agent - Added a new property `zabbix_agent_dont_detect_ip` when set to true, it won't detect the ips and no need to install the python module `netaddr`.
- zabbix_agent - Added parameter `zabbix_agent_package_remove` when set to `true` and `zabbix_agent2` is set to `true` it will uninstall the `zabbix-agent` service and package.
- zabbix_agent - added `zabbix_agent_install_agent_only` Will only install the Zabbix Agent package and not the `zabbix-sender` or `zabbix-get` packages.
- zabbix_template - Fixed to decode Unicode Escape of multibyte strings in an importing template data(https://github.com/ansible-collections/community.zabbix/pull/226).
- zabbix_user - added new parameters to set timezone and role_name for users (https://github.com/ansible-collections/community.zabbix/pull/260).
- zabbix_user - user_medias now defaults to None and is optional (https://github.com/ansible-collections/community.zabbix/pull/264).
- zabbix_web - added `zabbix_web_rhel_release` which enable scl on RHEL (https://github.com/ansible-collections/community.zabbix/pull/266).
- zabbix_web - quality of life improvements when using Nginx (https://github.com/ansible-collections/community.zabbix/pull/304).
Bugfixes
--------
- When installing the Zabbix packages, we disable all other yum repositories except the one for the Zabbix.
- zabbix_agent - Agent 2 also be able to use userparameters file.
- zabbix_agent - Also work on SLES 12 sp5
- zabbix_agent - Documented the property 'zabbix_proxy_ip' in the documentation.
- zabbix_agent - There was an task that wasn't able to use an http(s)_proxy environment while installing an package.
- zabbix_agent - Windows - Able to create PSK file
- zabbix_agent - Windows - Fixing download links to proper version/url
- zabbix_agent - Windows - Removal of not working property
- zabbix_agent - Zabbix packages were not able to install properly on Fedora. When the packages are installed, the version will be appended to the package name. This is eofr all RedHat related OS'es.
- zabbix_agent - fixed issue with zabbix_agent2_tlspsk_auto having no effect when using zabbix_agent2
- zabbix_agent - fixed issue with zabbix_api_create_hosts and TLS configuration when using zabbix_agent2, where zabbix_agent_tls* settings were used instead of zabbix_agent2_tls*
- zabbix_host - module will no longer require ``interfaces`` to be present when creating host with Zabbix 5.2 (https://github.com/ansible-collections/community.zabbix/pull/291).
- zabbix_host - should no longer fail with 'host cannot have more than one default interface' error (https://github.com/ansible-collections/community.zabbix/pull/309).
- zabbix_proxy (role) - Added missing paragraph for the SQLite3 as database.
- zabbix_proxy (role) - The become option was missing in some essential tasks when installing the Zabbix Proxy with SQLite3 as database.
- zabbix_proxy (role) - Various documentation fixes removing the Zabbix Server and replaced it with actual Zabbix Proxy information.
- zabbix_proxy - Added new property 'zabbix_proxy_ip' to determine ip for host running the Zabbix Proxy.
- zabbix_proxy - The 'interface' option was missing when creating an Proxy via the API.
- zabbix_template - fixed documentation for ``macros`` argument (https://github.com/ansible-collections/community.zabbix/pull/296).
- zabbix_template - fixed encode error when using Python2 (https://github.com/ansible-collections/community.zabbix/pull/297).
- zabbix_template - fixed issue when importing templates to zabbix version. >= 5.2
- zabbix_template_info - fixed encode error when using Python2 (https://github.com/ansible-collections/community.zabbix/pull/297).
- zabbix_user - disable no_log warning for option override_password.
- zabbix_user - fixed issue where module couldn't create a user since Zabbix 5.2 (https://github.com/ansible-collections/community.zabbix/pull/260).
- zabbix_web - fixed issue Role cannot install Zabbix web 5.0 on RHEL 7 (https://github.com/ansible-collections/community.zabbix/issues/202).
v1.1.0
======
Release Summary
---------------
| Release date: 2020-10-22
Minor Changes
-------------
- all roles - added ``zabbix_{agent,web,server,proxy,javagateway}_conf_mode`` option for configuring a mode of the configuration file for each Zabbix service.
- zabbix_proxy (role) - added an option ``innodb_default_row_format`` for MariaDB/MySQL if it isn't set to ``dynamic``.
- zabbix_server - fixed installation output when using MySQL database to not print PostgreSQL.
- zabbix_user - ``passwd`` no longer required when ALL groups in ``usrgrps`` use LDAP as ``gui_access`` (see `#240 <https://github.com/ansible-collections/community.zabbix/issues/232>`_).
- zabbix_user - no longer requires ``usrgrps`` when ``state=absent`` (see `#240 <https://github.com/ansible-collections/community.zabbix/issues/232>`_).
- zabbix_web - added several configuration options for the PHP-FPM setup to configure the listen (socket) file.
- zabbix_web - added support for configuring Zabbix Web with Nginx, same way as with Apache.
Bugfixes
--------
- all roles - missing ``become`` set to ``true`` was added to each task that requires admin privleges.
- zabbix_agent - added new properties and updated documentation to allow for correct Zabbix Agent2 configuration.
- zabbix_agent - fixed bug where Nginx prevented Apache from working as it was part of the FPM configuration.
v1.0.0
======
Release Summary
---------------
| Release date: 2020-08-16
Minor Changes
-------------
- Added the possibility to configure the ``mode`` for the ``zabbix_{agent,server,proxy}_include`` directories.
- all roles - added the possibility to configure the ``mode`` for the ``yum`` repositories files in case it contains credentials.
- zabbix_agent - ``zabbix-sender`` and ``zabbix-get`` will not be installed when ``zabbix_repo`` is set to ``epel``, as they are not part of the repository.
- zabbix_agent - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
- zabbix_agent - can also install the zabbix-agent2 application when ``zabbix_agent2`` is set to ``true``.
- zabbix_proxy (role) - a user and group are created on the host when ``zabbix_repo`` is set to ``epel``.
- zabbix_proxy (role) - now supports ``startpreprocessors`` setting and encryption when connecting to database (see `#164 <https://github.com/ansible-collections/community.zabbix/pull/164>`_).
- zabbix_server - a user and group are created on the host when ``zabbix_repo`` is set to ``epel``.
- zabbix_server - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
- zabbix_server - now supports ``startpreprocessors`` setting and encryption when connecting to database (see `#164 <https://github.com/ansible-collections/community.zabbix/pull/164>`_).
- zabbix_web - a property is added ``zabbix_web_doubleprecision`` which currently is set to ``false`` for default installations. For new installations this should be set to ``True``. For upgraded installations, please read database `upgrade notes <https://www.zabbix.com/documentation/current/manual/installation/upgrade_notes_500>`_ (Paragraph "Enabling extended range of numeric (float) values") before enabling this option.
- zabbix_web - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
- zabbix_web - don't remove the files that Zabbix will install during installation when you don't want to configure a virtual host configuration.
Breaking Changes / Porting Guide
--------------------------------
- zabbix_javagateway - options ``javagateway_pidfile``, ``javagateway_listenip``, ``javagateway_listenport`` and ``javagateway_startpollers`` renamed to ``zabbix_javagateway_xyz`` (see `UPGRADE.md <https://github.com/ansible-collections/community.zabbix/blob/main/docs/UPGRADE.md>`_).
Bugfixes
--------
- all roles - a ``handler`` is configured when ``zabbix_http(s)_proxy`` is defined which will remove the proxy line from the repository files. This results that execution of the roles are not idempotent anymore.
- zabbix_proxy (role) - ``StartPreprocessors`` only works with version 4.2 or higher. When a lower version is used, it will not be added to the configuration.
- zabbix_proxy (role) - only install the sql files that needs to be executed for when ``zabbix_repo`` is set to ``epel``.
- zabbix_server - ``StartPreprocessors`` only works with version 4.2 or higher. When a lower version is used, it will not be added to the configuration.
- zabbix_server - only install the sql files that needs to be executed for when ``zabbix_repo`` is set to ``epel``.
v0.3.0
======
Release Summary
---------------
| Release date: 2020-07-26
Minor Changes
-------------
- All roles now **support Zabbix 5.0** and by default install this version (see `#131 <https://github.com/ansible-collections/community.zabbix/pull/131>`_ and `#121 <https://github.com/ansible-collections/community.zabbix/pull/121>`_).
- Roles will now install gnupg on Debian OS family if not present.
- zabbix_action - no longer requires ``password`` and ``ssh_*key_file`` parameters at the same time for ``remote_command`` operations of type SSH.
- zabbix_action - parameter ``ssh_auth_type`` for SSH ``remote_command`` operation now correctly identifies which other parameters are required.
- zabbix_discovery_rule - refactoring module to use ``module_utils`` classes and functions, adjust return values on success, add documentation for return values.
- zabbix_discovery_rule - refactoring the module to remove unnecessary variables and fix a variable typo.
- zabbix_mediatype - new options ``message_templates``, ``description`` and many more related to ``type=webhook``.
- zabbix_mediatype - now supports new ``webhook`` media type.
Bugfixes
--------
- zabbix_action - choices for the ``inventory`` paramter sub option in ``*operations`` arguments have been clarified to ``manual`` and ``automatic``.
- zabbix_action - fixed error on changed API fields ``*default_message`` and ``*default_subject`` for Zabbix 5.0 (see `#92 <https://github.com/ansible-collections/community.zabbix/pull/92>`_).
- zabbix_action - module will no longer fail when searching for global script provided to ``script_name`` parameter.
- zabbix_action - now correctly selects mediatype for the (normal|recovery|update) operations with Zabbix 4.4 and newer.
- zabbix_agent - fixed installation of agent on Windows to directories with spaces.
- zabbix_agent - role should no longer fail when looking for ``getenforce`` binary.
- zabbix_host - module will no longer convert context part of user macro to upper case.
- zabbix_proxy (role) - will now correctly install python3-libsemanage on RHEL OS family.
- zabbix_service - fixed the zabbix_service has no idempotency with Zabbix 5.0.
- zabbix_web - now no longer fails when rendering apache vhost template.
New Modules
-----------
- community.zabbix.zabbix_discovery_rule - Create/delete/update Zabbix discovery rules
- community.zabbix.zabbix_usergroup - Create/delete/update Zabbix user groups
v0.2.0
======
Release Summary
---------------
| Release date: 2020-06-15
Minor Changes
-------------
- Documentation for roles moved to ``docs/`` sub-directory in the collection.
- New **role zabbix_agent** - previously known as dj-wasabi/zabbix-agent (also see `UPGRADE.md <https://github.com/ansible-collections/community.zabbix/blob/main/docs/UPGRADE.md>`_ for each role).
- New **role zabbix_javagateway** - previously known as dj-wasabi/zabbix-javagateway.
- New **role zabbix_proxy** - previously known as dj-wasabi/zabbix-proxy.
- New **role zabbix_server** - previously known as dj-wasabi/zabbix-server.
- New **role zabbix_web** - previously known as dj-wasabi/zabbix-web.
- zabbix_action - new alias ``update_operations`` for ``acknowledge_operations`` parameter.
- zabbix_host - ``macros`` now support new macro types ``text`` and ``secret``.
- zabbix_host - new option ``details`` (additional SNMP details) for ``interfaces`` parameter.
- zabbix_host - now supports Zabbix 5.0.
- zabbix_proxy (module) - now supports Zabbix 5.0.
- zabbix_screen - ``host_group`` parameter now accepts multiple groups.
Bugfixes
--------
- zabbix_action - documented ``value2`` parameter and ``notify_all_involved`` option.
- zabbix_maintenance - changing value of ``description`` parameter now actually updates maintenance's description.
- zabbix_template - is now able to perform ``state=dump`` when using ``ansible-playbook --check``.
- zabbix_template - no longer imports template from ``template_json`` or ``template_xml`` when using ``ansible-playbook --check``.
v0.1.0
======
Release Summary
---------------
| Release date: 2020-06-15
Minor Changes
-------------
- zabbix inventory plugin now no longer prints DeprecationWarning when used with Python3 due to SafeConfigParser.
- zabbix_action - arguments ``event_source`` and ``esc_period`` no longer required when ``state=absent``.
- zabbix_host - fixed inventory_mode key error, which occurs with Zabbix 4.4.1 or more (see `#65304 <https://github.com/ansible/ansible/issues/65304>`_).
- zabbix_host - was not possible to update a host where visible_name was not set in zabbix.
- zabbix_mediatype - Fixed to support zabbix 4.4 or more and python3 (see `#67693 <https://github.com/ansible/ansible/pull/67693>`_).
- zabbix_template - fixed error when providing empty ``link_templates`` to the module (see `#66417 <https://github.com/ansible/ansible/issues/66417>`_).
- zabbix_template - fixed invalid (non-importable) output provided by exporting XML (see `#66466 <https://github.com/ansible/ansible/issues/66466>`_).
- zabbix_user - Fixed an issue where module failed with zabbix 4.4 or above (see `#67475 <https://github.com/ansible/ansible/pull/67475>`_).
Deprecated Features
-------------------
- zabbix_proxy (module) - deprecates ``interface`` sub-options ``type`` and ``main`` when proxy type is set to passive via ``status=passive``. Make sure these suboptions are removed from your playbook as they were never supported by Zabbix in the first place.
Bugfixes
--------
- zabbix_action - allow str values for ``esc_period`` options (see `#66841 <https://github.com/ansible/ansible/pull/66841>`_).
- zabbix_action - no longer requires ``esc_period`` and ``event_source`` arguments when ``state=absent``.
- zabbix_host - now supports configuring user macros and host tags on the managed host (see `#66777 <https://github.com/ansible/ansible/pull/66777>`_).
- zabbix_host_info - ``host_name`` based search results now include host groups.
- zabbix_hostmacro - ``macro_name`` now accepts macros in zabbix native format as well (e.g. ``{$MACRO}``).
- zabbix_hostmacro - ``macro_value`` is no longer required when ``state=absent``.
- zabbix_proxy (module) - ``interface`` sub-options ``type`` and ``main`` are now deprecated and will be removed in community.general 3.0.0. Also, the values passed to ``interface`` are now checked for correct types and unexpected keys.
- zabbix_proxy (module) - added option proxy_address for comma-delimited list of IP/CIDR addresses or DNS names to accept active proxy requests from.
- zabbix_template - add new option omit_date to remove date from exported/dumped template (see `#67302 <https://github.com/ansible/ansible/pull/67302>`_).
- zabbix_template - adding new update rule templateLinkage.deleteMissing for newer zabbix versions (see `#66747 <https://github.com/ansible/ansible/pull/66747>`_).
- zabbix_template_info - add new option omit_date to remove date from exported/dumped template (see `#67302 <https://github.com/ansible/ansible/pull/67302>`_).

View File

@@ -0,0 +1,82 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting one of the project maintainers at:
* d3defi@gmail.com
* sky.jokerxx@gmail.com
* github@werner-dijkerman.nl
Or Ansible project directly at codeofconduct@ansible.com.
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View File

@@ -0,0 +1,169 @@
# Contribution guidelines
**Table of contents**
- [Contribution guidelines](#contribution-guidelines)
* [Contributing](#contributing)
* [Coding guidelines](#coding-guidelines)
+ [Zabbix roles](#zabbix-roles)
+ [Zabbix modules](#zabbix-modules)
* [Testing and Development](#testing-and-development)
+ [Testing Zabbix roles](#testing-zabbix-roles)
+ [Testing Zabbix modules](#testing-zabbix-modules)
- [Additional information](#additional-information)
* [Virtualenv](#virtualenv)
* [Links](#links)
Thank you very much for taking time to improve this Ansible collection. We appreciate your every contribution. Please make sure you are familiar with the content presented in this document to avoid any delays during reviews or merge.
Please note that this project is released with following codes of conduct and by participating in the project you agree to abide by them:
* [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md)
* [Community Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html)
If you are interested in joining us as a maintainer, please open an issue.
## Contributing
1. Fork this repository with community Zabbix collection.
2. Create a new branch and apply your changes to it. In addition to that:
1. Ensure that any changes you introduce to this collection are reflected in the documentation.
2. Ensure that your PR contains valid [changelog fragment](https://docs.ansible.com/ansible/devel/community/development_process.html#changelogs).
3. Include tests with your contribution to ensure that future pull requests will not break your functionality.
4. Make sure that tests succeed.
3. Push the branch to your forked repository.
4. Submit a new pull request into this collection.
*Notes:*
* Pull requests that fail during the tests will not be merged. If you have trouble narrowing down cause of a failure and would like some help, do not hesitate to ask for it in comments.
* If you plan to propose an extensive feature or breaking change, please open an issue first. This allows collection maintainers to comment on such change in advance and avoid possible rejection of such contribution.
## Coding guidelines
Style guides are important because they ensure consistency in the content, look, and feel of a book or a website. Any contributions to this collection must adhere to the following rules:
* [Ansible style guide](http://docs.ansible.com/ansible/latest/dev_guide/style_guide/).
* Use "Ansible" when referring to the product and ``ansible`` when referring to the command line tool, package and so on.
### Zabbix roles
* Playbooks should be written in multi-line YAML format using ``key: value``.
* The form ``key=value`` is suitable for ``ansible`` ad-hoc execution, not for ``ansible-playbook``.
* Every task should always have a ``name:`` keyword associated with it.
### Zabbix modules
These rules are required for any contributions proposing a new Zabbix module or updating an existing one. Modules should:
* Be compatible with [currently supported Zabbix releases](https://www.zabbix.com/life_cycle_and_release_policy).
* Include the same set of general options as other Zabbix modules:
* In `DOCUMENTATION` block via `extends_documentation_fragment` keyword.
* In module `argument_spec` as a set of module parameters.
* Implement proper logout mechanism as other modules do.
* Use the same version of `zabbix-api` library as defined in collection requirements.
* Comply with [Ansible module best practices](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html).
## Testing and Development
It is recommended to use Docker for the testing as this repository is utilizing it for its own CI. Read [Docker installation guide](https://docs.docker.com/install/) for more information.
Make sure you start your work on the current state of the repository with `main` branch up to date. The best way to both try new changes and run shipped tests is by cloning the repository to Ansible project:
```bash
cd <ANSIBLE-PROJECT>/
mkdir -p collections/ansible_collections/community
git clone git@github.com:<USERNAME>/community.zabbix.git collections/ansible_collections/community/zabbix
```
Functionality can be verified by looking at the documentation of a module:
```bash
ansible-doc community.zabbix.zabbix_host
```
Once this is done, you can reference modules and roles from testing playbook likes this:
```yaml
- hosts: myserver
roles:
- role: community.zabbix.zabbix_agent
zabbix_agent_server: 10.0.0.1
...
tasks:
- name: Configure Zabbix host
community.zabbix.zabbix_host:
server_url: http://10.0.0.1/
...
delegate_to: localhost
```
### Testing Zabbix roles
*This section is subject to change as our CI regarding roles is being reworked and may not work for you right now!*
Roles make use of [Molecule](https://molecule.readthedocs.io/en/latest/) to verify and test the execution of each role. In order to start testing with Molecule, you need to install the required dependencies. Requirements file can be found in the root of the [dj-wasabi/ansible-ci-base](https://github.com/dj-wasabi/ansible-ci-base) repository.
It is recommended to create a [new Python virtual environment](#virtualenv) for this to not clutter your global Python installation. First, install the dependencies:
```bash
pip install -r requirements.txt
```
Note that Docker is required when testing roles as Molecule is configured to use it. Once everything is installed, validate your role changes with:
```bash
molecule test
```
### Testing Zabbix modules
Modules are tested via `ansible-test` command. Configurations for integration and sanity tests for the command are contained within `tests` directory. Refer to the [official documentation](https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html) for introduction to module integration testing within Ansible. Please note that this may fail if you get your directory structure wrong. If this happens, please see the start of [Testing and Development](#testing-and-development) regarding the placement of the collection.
Running test suites locally requires a few dependencies to be installed. Same as for the roles, it is recommended to use [Python virtual environment](#virtualenv):
```bash
pip install docker-compose
```
Integration test suite for modules can be run with the commands below:
```bash
export zabbix_version=X.Y
docker-compose up -d
ansible-test integration -v --color --continue-on-error --diff [test_zabbix_xyz]
docker-compose down
```
*Notes*:
* `zabbix_version=X.Y` will be expanded to Docker image `ubuntu-X.Y-latest`
* Details for both variables and values that are in use can be read from [ansible-test.yml](.github/workflows/ansible-test.yml).
Sanity test suite for the modules can be run with the commands:
```bash
ansible-test sanity -v --color --docker --python 3.6
```
# Additional information
## Virtualenv
It is recommended to use virtualenv for development and testing work to prevent any conflicting dependencies with other projects.
A few resources describing virtualenvs:
* http://thepythonguru.com/python-virtualenv-guide/
* https://realpython.com/python-virtual-environments-a-primer/
* https://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/
## Links
* [Ansible](https://www.ansible.com/)
* [Ansible style guide](http://docs.ansible.com/ansible/latest/dev_guide/style_guide/)
* [Ansible module best practices](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html)
* [Integration testing with `ansible-test`](https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html)
* [Docker installation guide](https://docs.docker.com/install/)
* [Molecule](https://molecule.readthedocs.io/)
* [Molecule V2 with your own role](https://werner-dijkerman.nl/2017/09/05/using-molecule-v2-to-test-ansible-roles/)
* [dj-wasabi/ansible-ci-base](https://github.com/dj-wasabi/ansible-ci-base)
* [Current Zabbix releases](https://www.zabbix.com/life_cycle_and_release_policy)
**End note**: Have fun making changes. If a feature helps you, others may find it useful as well and we will be happy to merge it.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -0,0 +1,6 @@
D3DeFi (https://gitter.im/D3DeFi, d3defi@gmail.com)
ragingpastry
BGmot
pyrodie18
lzadjsf
mu1f407

View File

@@ -0,0 +1,40 @@
{
"collection_info": {
"namespace": "community",
"name": "zabbix",
"version": "1.9.1",
"authors": [
"Dusan Matejka (@D3DeFi)",
"sky-joker (@sky-joker)",
"Werner Dijkerman (@dj-wasabi)"
],
"readme": "README.md",
"tags": [
"monitoring",
"zabbix"
],
"description": "Collection allowing to configure resources in Zabbix monitoring system",
"license": [],
"license_file": "LICENSE",
"dependencies": {
"ansible.windows": "*",
"ansible.netcommon": "*",
"ansible.posix": "*",
"community.general": "*",
"community.mysql": "*",
"community.postgresql": "*"
},
"repository": "https://github.com/ansible-collections/community.zabbix.git",
"documentation": "https://github.com/ansible-collections/community.zabbix.git",
"homepage": "https://github.com/ansible-collections/community.zabbix",
"issues": "https://github.com/ansible-collections/community.zabbix/issues"
},
"file_manifest_file": {
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "e73e5c4854c6180579dbfe291504b8edb2e2b6fa3e41a2912af22bbc815cf7e1",
"format": 1
},
"format": 1
}

View File

@@ -0,0 +1,48 @@
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.

View File

@@ -0,0 +1,243 @@
# Zabbix collection for Ansible
Plugins:
![plugins](https://github.com/ansible-collections/community.zabbix/workflows/plugins-integration/badge.svg) ![repo-sanity](https://github.com/ansible-collections/community.zabbix/workflows/repo-sanity/badge.svg)
Roles:
![Zabbix Agent](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_agent/badge.svg) ![Zabbix Server](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_server/badge.svg) ![Zabbix Proxy](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_proxy/badge.svg) ![Zabbix Web](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_web/badge.svg) ![Zabbix Javagateway](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_javagateway/badge.svg)
**Table of Contents**
- [Zabbix collection for Ansible](#zabbix-collection-for-ansible)
* [Introduction](#introduction)
* [Included content](#included-content)
* [Installation](#installation)
+ [Requirements](#requirements)
+ [Installing the Collection from Ansible Galaxy](#installing-the-collection-from-ansible-galaxy)
+ [Upgrading collection](#upgrading-collection)
* [Usage](#usage)
* [Supported Zabbix versions](#supported-zabbix-versions)
* [Collection life cycle and support](#collection-life-cycle-and-support)
* [Contributing](#contributing)
* [License](#license)
## Introduction
This repo hosts the `community.zabbix` Ansible Collection.
The collection includes a variety of Ansible content to help automate the management of resources in Zabbix.
## Included content
Click on the name of a plugin or module to view that content's documentation:
- **Inventory Sources**:
- [zabbix](scripts/inventory/zabbix.py) - Zabbix Inventory Script
- [zabbix_inventory](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_inventory_inventory.html) - Zabbix Ansible Inventory Plugin
- **Modules**:
- [zabbix_action](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_action_module.html)
- [zabbix_authentication](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_authentication_module.html)
- [zabbix_autoregister](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_autoregister_module.html)
- [zabbix_discovery_rule](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_discovery_rule_module.html)
- [zabbix_globalmacro](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_globalmacro_module.html)
- [zabbix_group_info](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_group_info_module.html)
- [zabbix_group](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_group_module.html)
- [zabbix_host_events_info](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_events_info_module.html)
- [zabbix_host_info](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_info_module.html)
- [zabbix_host](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html)
- [zabbix_hostmacro](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_hostmacro_module.html)
- [zabbix_housekeeping](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_housekeeping_module.html)
- [zabbix_maintenance](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_maintenance_module.html)
- [zabbix_map](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_map_module.html)
- [zabbix_mediatype](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_mediatype_module.html)
- [zabbix_proxy_info](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_proxy_info_module.html)
- [zabbix_proxy](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_proxy_module.html)
- [zabbix_screen](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_screen_module.html)
- [zabbix_script](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_script_module.html)
- [zabbix_service](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_service_module.html)
- [zabbix_template_info](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_template_info_module.html)
- [zabbix_template](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_template_module.html)
- [zabbix_user_info](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_user_info_module.html)
- [zabbix_user](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_user_module.html)
- [zabbix_usergroup](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_usergroup_module.html)
- [zabbix_valuemap](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_valuemap_module.html)
- **Roles**:
- [zabbix_agent](docs/ZABBIX_AGENT_ROLE.md)
- [zabbix_javagateway](docs/ZABBIX_JAVAGATEWAY_ROLE.md)
- [zabbix_proxy](docs/ZABBIX_PROXY_ROLE.md)
- [zabbix_server](docs/ZABBIX_SERVER_ROLE.md)
- [zabbix_web](docs/ZABBIX_WEB_ROLE.md)
## Installation
### Requirements
Each component in this collection requires additional dependencies. Review components you are interested in by visiting links present in the [Included content](#included-content) section.
This is especially important for some of the Zabbix roles that require you to **install additional standalone roles** from Ansible Galaxy.
For the majority of modules, however, you can get away with just:
```bash
pip install zabbix-api
```
#### Ansible 2.10 and higher
With the release of Ansible 2.10, modules have been moved into collections. With the exception of ansible.builtin modules, this means additonal collections must be installed in order to use modules such as seboolean (now ansible.posix.seboolean). The following collections are now frequently required: `ansible.posix` and `community.general`. Installing the collections:
```bash
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install community.general
ansible-galaxy collection install ansible.netcommon
```
### Installing the Collection from Ansible Galaxy
Before using the Zabbix collection, you need to install it with the Ansible Galaxy CLI:
```bash
ansible-galaxy collection install community.zabbix
```
You can also include it in a `requirements.yml` file along with other required collections and install them via `ansible-galaxy collection install -r requirements.yml`, using the format:
```yaml
---
collections:
- name: community.zabbix
version: 1.9.1
- name: ansible.posix
version: 1.3.0
- name: community.general
version: 3.7.0
```
### Upgrading collection
Make sure to read [UPGRADE](docs/UPGRADE.md) document before installing newer version of this collection.
## Usage
*Please note that these are not working examples. For documentation on how to use content included in this collection, refer to the links in the [Included content](#included-content) section.*
To use a module or role from this collection, reference them with their Fully Qualified Collection Namespace (FQCN) like so:
```yaml
---
- name: Using Zabbix collection to install Zabbix Agent
hosts: localhost
roles:
- role: community.zabbix.zabbix_agent
zabbix_agent_server: zabbix.example.com
...
- name: If Zabbix WebUI runs on non-default (zabbix) path, e.g. http://<FQDN>/zabbixeu
set_fact:
ansible_zabbix_url_path: 'zabbixeu'
- name: Using Zabbix collection to manage Zabbix Server's elements with username/password
hosts: zabbix.example.com
vars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 80
ansible_httpapi_use_ssl: false
ansible_httpapi_validate_certs: false
ansible_user: Admin
ansible_httpapi_pass: zabbix
tasks:
- name: Ensure host is monitored by Zabbix
community.zabbix.zabbix_host:
...
- name: Using Zabbix collection to manage Zabbix Server's elements with authentication key
hosts: zabbix.example.net
vars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 80
ansible_httpapi_use_ssl: false
ansible_httpapi_validate_certs: false
ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
tasks:
- name: Ensure host is monitored by Zabbix
community.zabbix.zabbix_host:
...
```
Or you include collection name `community.zabbix` in the playbook's `collections` element, like this:
```yaml
---
- name: Using Zabbix collection
hosts: localhost
collections:
- community.zabbix
roles:
- role: zabbix_agent
zabbix_agent_server: zabbix.example.com
...
- name: Using Zabbix collection to manage Zabbix Server's elements with username/password
hosts: zabbix.example.com
vars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 80
ansible_httpapi_use_ssl: false
ansible_httpapi_validate_certs: false
ansible_user: Admin
ansible_httpapi_pass: zabbix
tasks:
- name: Ensure host is monitored by Zabbix
zabbix.zabbix_host:
...
- name: Using Zabbix collection to manage Zabbix Server's elements with authentication key
hosts: zabbix.example.net
vars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 80
ansible_httpapi_use_ssl: false
ansible_httpapi_validate_certs: false
ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
tasks:
- name: Ensure host is monitored by Zabbix
zabbix_host:
...
```
If Basic Authentication is required to access Zabbix server add following variables:
```
zabbix_api_http_user: "user"
zabbix_api_http_password: "password"
```
## Supported Zabbix versions
Main priority is to support Zabbix releases which have official full support from Zabbix LLC. Please checkout the versions at [Zabbix Life Cycle & Release Policy](https://www.zabbix.com/life_cycle_and_release_policy) page.
> We aim to cover at least two LTS releases. For example, currently we support LTS 4.0 + 5.0 and with LTS 6.0 we will drop 4.0. But we do our best to also include the latest point releases - for example currently this is 5.4 which should be supperseeded by 6.2 then.
Support for Zabbix LTS versions will be dropped with Major releases of the collection and mostly affect modules. Each role is following its unique support matrix. You should always consult documentation of roles in *docs/* directory.
If you find any inconsistencies with the version of Zabbix you are using, feel free to open a pull request or an issue and we will try to address it as soon as possible. In case of pull requests, please make sure that your changes will not break any existing functionality for currently supported Zabbix releases.
## Collection life cycle and support
See [RELEASE](docs/RELEASE.md) document for more information regarding life cycle and support for the collection.
## Contributing
See [CONTRIBUTING](CONTRIBUTING.md) for more information about how to contribute to this repository.
Please also feel free to stop by our [Gitter community](https://gitter.im/community-zabbix/community).
## License
GNU General Public License v3.0 or later
See [LICENSE](LICENSE) to see the full text.

View File

@@ -0,0 +1,164 @@
objects: {}
plugins:
become: {}
cache: {}
callback: {}
cliconf: {}
connection: {}
httpapi:
zabbix:
description: HttpApi Plugin for Zabbix
name: zabbix
version_added: 1.8.0
inventory:
zabbix_inventory:
description: Zabbix Inventory Plugin
name: zabbix_inventory
version_added: 1.4.0
lookup: {}
module:
zabbix_action:
description: Create/Delete/Update Zabbix actions
name: zabbix_action
namespace: ''
version_added: null
zabbix_authentication:
description: Update Zabbix authentication
name: zabbix_authentication
namespace: ''
version_added: 1.6.0
zabbix_autoregister:
description: Update Zabbix autoregistration
name: zabbix_autoregister
namespace: ''
version_added: 1.6.0
zabbix_discovery_rule:
description: Create/delete/update Zabbix discovery rules
name: zabbix_discovery_rule
namespace: ''
version_added: null
zabbix_globalmacro:
description: Create/update/delete Zabbix Global macros
name: zabbix_globalmacro
namespace: ''
version_added: 1.4.0
zabbix_group:
description: Create/delete Zabbix host groups
name: zabbix_group
namespace: ''
version_added: null
zabbix_group_info:
description: Gather information about Zabbix hostgroup
name: zabbix_group_info
namespace: ''
version_added: null
zabbix_host:
description: Create/update/delete Zabbix hosts
name: zabbix_host
namespace: ''
version_added: null
zabbix_host_events_info:
description: Get all triggers about a Zabbix host
name: zabbix_host_events_info
namespace: ''
version_added: null
zabbix_host_info:
description: Gather information about Zabbix host
name: zabbix_host_info
namespace: ''
version_added: null
zabbix_hostmacro:
description: Create/update/delete Zabbix host macros
name: zabbix_hostmacro
namespace: ''
version_added: null
zabbix_housekeeping:
description: Update Zabbix housekeeping
name: zabbix_housekeeping
namespace: ''
version_added: 1.6.0
zabbix_maintenance:
description: Create Zabbix maintenance windows
name: zabbix_maintenance
namespace: ''
version_added: null
zabbix_map:
description: Create/update/delete Zabbix maps
name: zabbix_map
namespace: ''
version_added: null
zabbix_mediatype:
description: Create/Update/Delete Zabbix media types
name: zabbix_mediatype
namespace: ''
version_added: null
zabbix_proxy:
description: Create/delete/get/update Zabbix proxies
name: zabbix_proxy
namespace: ''
version_added: null
zabbix_proxy_info:
description: Gather information about Zabbix proxy
name: zabbix_proxy_info
namespace: ''
version_added: 1.5.0
zabbix_screen:
description: Create/update/delete Zabbix screens
name: zabbix_screen
namespace: ''
version_added: null
zabbix_script:
description: Create/update/delete Zabbix scripts
name: zabbix_script
namespace: ''
version_added: 1.7.0
zabbix_service:
description: Create/update/delete Zabbix service
name: zabbix_service
namespace: ''
version_added: null
zabbix_template:
description: Create/update/delete/dump Zabbix template
name: zabbix_template
namespace: ''
version_added: null
zabbix_template_info:
description: Gather information about Zabbix template
name: zabbix_template_info
namespace: ''
version_added: null
zabbix_user:
description: Create/update/delete Zabbix users
name: zabbix_user
namespace: ''
version_added: null
zabbix_user_directory:
description: Create/update/delete Zabbix user directories
name: zabbix_user_directory
namespace: ''
version_added: null
zabbix_user_info:
description: Gather information about Zabbix user
name: zabbix_user_info
namespace: ''
version_added: null
zabbix_user_role:
description: Adds or removes zabbix roles
name: zabbix_user_role
namespace: ''
version_added: null
zabbix_usergroup:
description: Create/delete/update Zabbix user groups
name: zabbix_usergroup
namespace: ''
version_added: null
zabbix_valuemap:
description: Create/update/delete Zabbix value maps
name: zabbix_valuemap
namespace: ''
version_added: null
netconf: {}
shell: {}
strategy: {}
vars: {}
version: 1.9.1

View File

@@ -0,0 +1,816 @@
ancestor: null
releases:
0.1.0:
changes:
bugfixes:
- zabbix_action - allow str values for ``esc_period`` options (see `#66841 <https://github.com/ansible/ansible/pull/66841>`_).
- zabbix_action - no longer requires ``esc_period`` and ``event_source`` arguments
when ``state=absent``.
- zabbix_host - now supports configuring user macros and host tags on the managed
host (see `#66777 <https://github.com/ansible/ansible/pull/66777>`_).
- zabbix_host_info - ``host_name`` based search results now include host groups.
- zabbix_hostmacro - ``macro_name`` now accepts macros in zabbix native format
as well (e.g. ``{$MACRO}``).
- zabbix_hostmacro - ``macro_value`` is no longer required when ``state=absent``.
- zabbix_proxy (module) - ``interface`` sub-options ``type`` and ``main`` are
now deprecated and will be removed in community.general 3.0.0. Also, the values
passed to ``interface`` are now checked for correct types and unexpected keys.
- zabbix_proxy (module) - added option proxy_address for comma-delimited list
of IP/CIDR addresses or DNS names to accept active proxy requests from.
- zabbix_template - add new option omit_date to remove date from exported/dumped
template (see `#67302 <https://github.com/ansible/ansible/pull/67302>`_).
- zabbix_template - adding new update rule templateLinkage.deleteMissing for
newer zabbix versions (see `#66747 <https://github.com/ansible/ansible/pull/66747>`_).
- zabbix_template_info - add new option omit_date to remove date from exported/dumped
template (see `#67302 <https://github.com/ansible/ansible/pull/67302>`_).
deprecated_features:
- zabbix_proxy (module) - deprecates ``interface`` sub-options ``type`` and
``main`` when proxy type is set to passive via ``status=passive``. Make sure
these suboptions are removed from your playbook as they were never supported
by Zabbix in the first place.
minor_changes:
- zabbix inventory plugin now no longer prints DeprecationWarning when used
with Python3 due to SafeConfigParser.
- zabbix_action - arguments ``event_source`` and ``esc_period`` no longer required
when ``state=absent``.
- zabbix_host - fixed inventory_mode key error, which occurs with Zabbix 4.4.1
or more (see `#65304 <https://github.com/ansible/ansible/issues/65304>`_).
- zabbix_host - was not possible to update a host where visible_name was not
set in zabbix.
- zabbix_mediatype - Fixed to support zabbix 4.4 or more and python3 (see `#67693
<https://github.com/ansible/ansible/pull/67693>`_).
- zabbix_template - fixed error when providing empty ``link_templates`` to the
module (see `#66417 <https://github.com/ansible/ansible/issues/66417>`_).
- zabbix_template - fixed invalid (non-importable) output provided by exporting
XML (see `#66466 <https://github.com/ansible/ansible/issues/66466>`_).
- zabbix_user - Fixed an issue where module failed with zabbix 4.4 or above
(see `#67475 <https://github.com/ansible/ansible/pull/67475>`_).
release_summary: '| Release date: 2020-06-15
'
fragments:
- 010release.yml
release_date: '2020-06-15'
0.2.0:
changes:
bugfixes:
- zabbix_action - documented ``value2`` parameter and ``notify_all_involved``
option.
- zabbix_maintenance - changing value of ``description`` parameter now actually
updates maintenance's description.
- zabbix_template - is now able to perform ``state=dump`` when using ``ansible-playbook
--check``.
- zabbix_template - no longer imports template from ``template_json`` or ``template_xml``
when using ``ansible-playbook --check``.
minor_changes:
- Documentation for roles moved to ``docs/`` sub-directory in the collection.
- New **role zabbix_agent** - previously known as dj-wasabi/zabbix-agent (also
see `UPGRADE.md <https://github.com/ansible-collections/community.zabbix/blob/main/docs/UPGRADE.md>`_
for each role).
- New **role zabbix_javagateway** - previously known as dj-wasabi/zabbix-javagateway.
- New **role zabbix_proxy** - previously known as dj-wasabi/zabbix-proxy.
- New **role zabbix_server** - previously known as dj-wasabi/zabbix-server.
- New **role zabbix_web** - previously known as dj-wasabi/zabbix-web.
- zabbix_action - new alias ``update_operations`` for ``acknowledge_operations``
parameter.
- zabbix_host - ``macros`` now support new macro types ``text`` and ``secret``.
- zabbix_host - new option ``details`` (additional SNMP details) for ``interfaces``
parameter.
- zabbix_host - now supports Zabbix 5.0.
- zabbix_proxy (module) - now supports Zabbix 5.0.
- zabbix_screen - ``host_group`` parameter now accepts multiple groups.
release_summary: '| Release date: 2020-06-15 '
fragments:
- 020release.yml
release_date: '2020-06-15'
0.3.0:
changes:
bugfixes:
- zabbix_action - choices for the ``inventory`` paramter sub option in ``*operations``
arguments have been clarified to ``manual`` and ``automatic``.
- zabbix_action - fixed error on changed API fields ``*default_message`` and
``*default_subject`` for Zabbix 5.0 (see `#92 <https://github.com/ansible-collections/community.zabbix/pull/92>`_).
- zabbix_action - module will no longer fail when searching for global script
provided to ``script_name`` parameter.
- zabbix_action - now correctly selects mediatype for the (normal|recovery|update)
operations with Zabbix 4.4 and newer.
- zabbix_agent - fixed installation of agent on Windows to directories with
spaces.
- zabbix_agent - role should no longer fail when looking for ``getenforce``
binary.
- zabbix_host - module will no longer convert context part of user macro to
upper case.
- zabbix_proxy (role) - will now correctly install python3-libsemanage on RHEL
OS family.
- zabbix_service - fixed the zabbix_service has no idempotency with Zabbix 5.0.
- zabbix_web - now no longer fails when rendering apache vhost template.
minor_changes:
- All roles now **support Zabbix 5.0** and by default install this version (see
`#131 <https://github.com/ansible-collections/community.zabbix/pull/131>`_
and `#121 <https://github.com/ansible-collections/community.zabbix/pull/121>`_).
- Roles will now install gnupg on Debian OS family if not present.
- zabbix_action - no longer requires ``password`` and ``ssh_*key_file`` parameters
at the same time for ``remote_command`` operations of type SSH.
- zabbix_action - parameter ``ssh_auth_type`` for SSH ``remote_command`` operation
now correctly identifies which other parameters are required.
- zabbix_discovery_rule - refactoring module to use ``module_utils`` classes
and functions, adjust return values on success, add documentation for return
values.
- zabbix_discovery_rule - refactoring the module to remove unnecessary variables
and fix a variable typo.
- zabbix_mediatype - new options ``message_templates``, ``description`` and
many more related to ``type=webhook``.
- zabbix_mediatype - now supports new ``webhook`` media type.
release_summary: '| Release date: 2020-07-26
'
fragments:
- 030release.yml
modules:
- description: Create/delete/update Zabbix discovery rules
name: zabbix_discovery_rule
namespace: ''
- description: Create/delete/update Zabbix user groups
name: zabbix_usergroup
namespace: ''
release_date: '2020-07-26'
1.0.0:
changes:
breaking_changes:
- zabbix_javagateway - options ``javagateway_pidfile``, ``javagateway_listenip``,
``javagateway_listenport`` and ``javagateway_startpollers`` renamed to ``zabbix_javagateway_xyz``
(see `UPGRADE.md <https://github.com/ansible-collections/community.zabbix/blob/main/docs/UPGRADE.md>`_).
bugfixes:
- all roles - a ``handler`` is configured when ``zabbix_http(s)_proxy`` is defined
which will remove the proxy line from the repository files. This results that
execution of the roles are not idempotent anymore.
- zabbix_proxy (role) - ``StartPreprocessors`` only works with version 4.2 or
higher. When a lower version is used, it will not be added to the configuration.
- zabbix_proxy (role) - only install the sql files that needs to be executed
for when ``zabbix_repo`` is set to ``epel``.
- zabbix_server - ``StartPreprocessors`` only works with version 4.2 or higher.
When a lower version is used, it will not be added to the configuration.
- zabbix_server - only install the sql files that needs to be executed for when
``zabbix_repo`` is set to ``epel``.
minor_changes:
- Added the possibility to configure the ``mode`` for the ``zabbix_{agent,server,proxy}_include``
directories.
- all roles - added the possibility to configure the ``mode`` for the ``yum``
repositories files in case it contains credentials.
- zabbix_agent - ``zabbix-sender`` and ``zabbix-get`` will not be installed
when ``zabbix_repo`` is set to ``epel``, as they are not part of the repository.
- zabbix_agent - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
- zabbix_agent - can also install the zabbix-agent2 application when ``zabbix_agent2``
is set to ``true``.
- zabbix_proxy (role) - a user and group are created on the host when ``zabbix_repo``
is set to ``epel``.
- zabbix_proxy (role) - now supports ``startpreprocessors`` setting and encryption
when connecting to database (see `#164 <https://github.com/ansible-collections/community.zabbix/pull/164>`_).
- zabbix_server - a user and group are created on the host when ``zabbix_repo``
is set to ``epel``.
- zabbix_server - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
- zabbix_server - now supports ``startpreprocessors`` setting and encryption
when connecting to database (see `#164 <https://github.com/ansible-collections/community.zabbix/pull/164>`_).
- zabbix_web - a property is added ``zabbix_web_doubleprecision`` which currently
is set to ``false`` for default installations. For new installations this
should be set to ``True``. For upgraded installations, please read database
`upgrade notes <https://www.zabbix.com/documentation/current/manual/installation/upgrade_notes_500>`_
(Paragraph "Enabling extended range of numeric (float) values") before enabling
this option.
- zabbix_web - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
- zabbix_web - don't remove the files that Zabbix will install during installation
when you don't want to configure a virtual host configuration.
release_summary: '| Release date: 2020-08-16
'
fragments:
- 100-release-prep.yaml
- role-agent-supports-zabbix-agent2.yaml
- role-all-configure-mode-include.yaml
- role-all-configure-mode-with-handlers.yaml
- role-all-fix-epel-installations.yaml
- role-web-add-doubleprecision.yaml
- role-web-zabbix_vhost-dont-remove-files.yaml
release_date: '2020-08-16'
1.1.0:
changes:
bugfixes:
- all roles - missing ``become`` set to ``true`` was added to each task that
requires admin privleges.
- zabbix_agent - added new properties and updated documentation to allow for
correct Zabbix Agent2 configuration.
- zabbix_agent - fixed bug where Nginx prevented Apache from working as it was
part of the FPM configuration.
minor_changes:
- all roles - added ``zabbix_{agent,web,server,proxy,javagateway}_conf_mode``
option for configuring a mode of the configuration file for each Zabbix service.
- zabbix_proxy (role) - added an option ``innodb_default_row_format`` for MariaDB/MySQL
if it isn't set to ``dynamic``.
- zabbix_server - fixed installation output when using MySQL database to not
print PostgreSQL.
- zabbix_user - ``passwd`` no longer required when ALL groups in ``usrgrps``
use LDAP as ``gui_access`` (see `#240 <https://github.com/ansible-collections/community.zabbix/issues/232>`_).
- zabbix_user - no longer requires ``usrgrps`` when ``state=absent`` (see `#240
<https://github.com/ansible-collections/community.zabbix/issues/232>`_).
- zabbix_web - added several configuration options for the PHP-FPM setup to
configure the listen (socket) file.
- zabbix_web - added support for configuring Zabbix Web with Nginx, same way
as with Apache.
release_summary: '| Release date: 2020-10-22
'
fragments:
- 240-zabbix-user-nopass-ldap.yaml
- role-agent-correct-usage-acl.yaml
- role-agent-zabbix-agent2-props.yaml
- role-server-screen-output.yaml
- role-web-add-support-for-nginx.yaml
- role-web-added-some-properties.yaml
- roles-all-add-become.yaml
- roles-all-configure-conf-mode.yaml
- roles-server-proxy-add-innodb-check.yaml
release_date: '2020-10-22'
1.2.0:
changes:
bugfixes:
- When installing the Zabbix packages, we disable all other yum repositories
except the one for the Zabbix.
- zabbix_agent - Agent 2 also be able to use userparameters file.
- zabbix_agent - Also work on SLES 12 sp5
- zabbix_agent - Documented the property 'zabbix_proxy_ip' in the documentation.
- zabbix_agent - There was an task that wasn't able to use an http(s)_proxy
environment while installing an package.
- zabbix_agent - Windows - Able to create PSK file
- zabbix_agent - Windows - Fixing download links to proper version/url
- zabbix_agent - Windows - Removal of not working property
- zabbix_agent - Zabbix packages were not able to install properly on Fedora.
When the packages are installed, the version will be appended to the package
name. This is eofr all RedHat related OS'es.
- zabbix_agent - fixed issue with zabbix_agent2_tlspsk_auto having no effect
when using zabbix_agent2
- zabbix_agent - fixed issue with zabbix_api_create_hosts and TLS configuration
when using zabbix_agent2, where zabbix_agent_tls* settings were used instead
of zabbix_agent2_tls*
- zabbix_host - module will no longer require ``interfaces`` to be present when
creating host with Zabbix 5.2 (https://github.com/ansible-collections/community.zabbix/pull/291).
- zabbix_host - should no longer fail with 'host cannot have more than one default
interface' error (https://github.com/ansible-collections/community.zabbix/pull/309).
- zabbix_proxy (role) - Added missing paragraph for the SQLite3 as database.
- zabbix_proxy (role) - The become option was missing in some essential tasks
when installing the Zabbix Proxy with SQLite3 as database.
- zabbix_proxy (role) - Various documentation fixes removing the Zabbix Server
and replaced it with actual Zabbix Proxy information.
- zabbix_proxy - Added new property 'zabbix_proxy_ip' to determine ip for host
running the Zabbix Proxy.
- zabbix_proxy - The 'interface' option was missing when creating an Proxy via
the API.
- zabbix_template - fixed documentation for ``macros`` argument (https://github.com/ansible-collections/community.zabbix/pull/296).
- zabbix_template - fixed encode error when using Python2 (https://github.com/ansible-collections/community.zabbix/pull/297).
- zabbix_template - fixed issue when importing templates to zabbix version.
>= 5.2
- zabbix_template_info - fixed encode error when using Python2 (https://github.com/ansible-collections/community.zabbix/pull/297).
- zabbix_user - disable no_log warning for option override_password.
- zabbix_user - fixed issue where module couldn't create a user since Zabbix
5.2 (https://github.com/ansible-collections/community.zabbix/pull/260).
- zabbix_web - fixed issue Role cannot install Zabbix web 5.0 on RHEL 7 (https://github.com/ansible-collections/community.zabbix/issues/202).
minor_changes:
- Updated the roles to support Zabbix 5.2.
- zabbix_agent - Added a new property `zabbix_agent_dont_detect_ip` when set
to true, it won't detect the ips and no need to install the python module
`netaddr`.
- zabbix_agent - Added parameter `zabbix_agent_package_remove` when set to `true`
and `zabbix_agent2` is set to `true` it will uninstall the `zabbix-agent`
service and package.
- zabbix_agent - added `zabbix_agent_install_agent_only` Will only install the
Zabbix Agent package and not the `zabbix-sender` or `zabbix-get` packages.
- zabbix_template - Fixed to decode Unicode Escape of multibyte strings in an
importing template data(https://github.com/ansible-collections/community.zabbix/pull/226).
- zabbix_user - added new parameters to set timezone and role_name for users
(https://github.com/ansible-collections/community.zabbix/pull/260).
- zabbix_user - user_medias now defaults to None and is optional (https://github.com/ansible-collections/community.zabbix/pull/264).
- zabbix_web - added `zabbix_web_rhel_release` which enable scl on RHEL (https://github.com/ansible-collections/community.zabbix/pull/266).
- zabbix_web - quality of life improvements when using Nginx (https://github.com/ansible-collections/community.zabbix/pull/304).
release_summary: '| Release date: 2021-01-11 | Last major release to support
Zabbix server 3.X versions in plugins.'
fragments:
- 226-zabbix_template.yaml
- 254-disable-no-log-warning.yml
- 260-zabbix_user.yml
- 264-allow-user_medias-to-be-optional.yaml
- 266-zabbix_web.yml
- 297-zabbix_template_modules.yml
- 309-host-interfaces.yaml
- agent-missing-proxy-task.yaml
- agent-not-detect-ips.yml
- agent-use-version-for-rh.yml
- agent2-psk-fixes.yml
- module-zabbix_host-interfaces-not-required.yaml
- module-zabbix_template-argspec-doc.yaml
- proxy-able-to-use-interface.yaml
- role-agent-allow-uninstall-agent.yaml
- role-agent-userparameter.yaml
- role-agent-windows-service-handling.yaml
- role-agent-work-with-sles.yaml
- role-proxy-sqlite3-zabbix-proxy.yaml
- roles-all-enable-zabbix-disable-rest.yaml
- roles-all-update-to-zabbix-52.yml
- templatescreens-fix.yml
release_date: '2021-01-11'
1.3.0:
changes:
bugfixes:
- zabbix_action - now properly filters discovery rule checks by name (https://github.com/ansible-collections/community.zabbix/pull/349).
- zabbix_agent - corrected version for Windows agents (https://github.com/ansible-collections/community.zabbix/pull/316).
- zabbix_agent - fixed download URL for MacOS (https://github.com/ansible-collections/community.zabbix/pull/325).
- zabbix_server - now installs correct MySQL client packages on RHEL8 systems
(https://github.com/ansible-collections/community.zabbix/pull/343).
- zabbix_template - fixed an issue with Python2 where module wouldn't decode
Unicode characters (https://github.com/ansible-collections/community.zabbix/pull/322).
- zabbix_web - fixed installation of python3-libsemanage package RHEL7 and older
systems (https://github.com/ansible-collections/community.zabbix/pull/330).
- zabbix_web - role should now correctly determine naming of PHP packages on
older systems (https://github.com/ansible-collections/community.zabbix/pull/344).
- zabbix_web - updated default PHP version for Debian10 (https://github.com/ansible-collections/community.zabbix/pull/323).
minor_changes:
- zabbix_agent - added support for installations on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
- zabbix_proxy - now supports configuring StatsAllowedIP (https://github.com/ansible-collections/community.zabbix/pull/337).
- zabbix_server - added support for installtions on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
- zabbix_web - added support for installtions on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
release_summary: '| Release date: 2021-03-20 | Last major release to support
Zabbix server 3.X versions in plugins.'
security_fixes:
- zabbix_action - no longer exposes remote SSH command password used in operations,
recovery & acknowledge operations to system logs (https://github.com/ansible-collections/community.zabbix/pull/345).
- zabbix_discovery_rule - no longer exposes SNMPv3 auth and priv passphrases
to system logs (https://github.com/ansible-collections/community.zabbix/pull/345).
- zabbix_host - no longer exposes SNMPv3 auth and priv passphrases to system
logs (https://github.com/ansible-collections/community.zabbix/pull/345).
fragments:
- 316-zbx-agent-windows-long-version.yaml
- 322-zabbix_template.yml
- 323-zabbix_web.yml
- 325-zbx-agent-macos.yaml
- 330-zabbix_web-selinux.yaml
- 337-zabbix_proxy-statsAllowedIP.yaml
- 343-zabbix_server-rhel8-mysql.yaml
- 344-zabbix_web-legacyphp.yaml
- 345-security-fixes-no_log.yaml
- 349-zabbix_action-dcheck-filter.yaml
- raspberry-server.yaml
- raspberry.yaml
release_date: '2021-03-20'
1.4.0:
changes:
bugfixes:
- zabbix_agent - StatusPort will be configured only when `zabbix_agent2_statusport`
is defined (https://github.com/ansible-collections/community.zabbix/pull/378)
- zabbix_agent - fixed issue preventing installation of zabbix-agent 4.2 on
Ubuntu Focal 20.04 (https://github.com/ansible-collections/community.zabbix/pull/390)
- zabbix_agent - role will now configure correct port for hostinterface in Zabbix
Server if `zabbix_agent2_listenport` is defined (https://github.com/ansible-collections/community.zabbix/pull/400)
- zabbix_agent - should no longer be failing on Windows platform due to re-running
all of the tasks for the 2nd time (https://github.com/ansible-collections/community.zabbix/pull/376)
- zabbix_agent - should no longer fail while cleaning up zabbix_agent installation
if Zabbix Agent2 is being used (https://github.com/ansible-collections/community.zabbix/pull/409)
- zabbix_agent - will no longer install zabbix_get package on Debian systems
when `zabbix_agent_install_agent_only` is defined (https://github.com/ansible-collections/community.zabbix/pull/363)
- zabbix_host - fixed issue where module was idempotent when multiple host interfaces
of the same type were present (https://github.com/ansible-collections/community.zabbix/pull/391)
- zabbix_proxy (role) - will no longer fail on proxy creation in Zabbix Server
when TLS parameters are used (https://github.com/ansible-collections/community.zabbix/pull/388)
- zabbix_server - Removed the removal everything from /tmp directory command
as it removes things that it shouldnt do.
- zabbix_template - first time import of template now works with Zabbix 5.4
(https://github.com/ansible-collections/community.zabbix/pull/407), please
note that rerunning the task will fail as there are breaking changes in Zabbix
5.4 API that module not yet covers.
- zabbix_user - now works with Zabbix 5.4 (https://github.com/ansible-collections/community.zabbix/pull/406)
minor_changes:
- all roles were updated to support Zabbix 5.4 release (https://github.com/ansible-collections/community.zabbix/pull/405)
- new inventory plugin zabbix_inventory (https://github.com/ansible-collections/community.zabbix/pull/373)
- new module plugin zabbix_globalmacro (https://github.com/ansible-collections/community.zabbix/pull/377)
- zabbix_agent - `zabbix_agent_src_reinstall` now defaults to `False` (https://github.com/ansible-collections/community.zabbix/pull/403)
- zabbix_agent - now supports setting AllowKey (https://github.com/ansible-collections/community.zabbix/pull/358)
- zabbix_globalmacros - it is now possible to create global macros using this
module (https://github.com/ansible-collections/community.zabbix/pull/377).
- zabbix_inventory - Created Ansible - Zabbix inventory plugin to create dynamic
inventory from Zabbix.
- zabbix_maintenance - it is now possible to target hosts by their technical
name if it differs from the visible name
- zabbix_proxy - Add MySQL Python 3 package installation.
- zabbix_server - Add MySQL Python 3 package installation.
- zabbix_server - now supports setting StartLLDProcessors (https://github.com/ansible-collections/community.zabbix/pull/361)
- zabbix_user - now supports parameter `username` as an alternative to `alias`
(https://github.com/ansible-collections/community.zabbix/pull/406)
- zabbix_user - removed some of the default values because a configuration should
be changed only if specified as a parameter (https://github.com/ansible-collections/community.zabbix/pull/382).
- zabbix_web - now supports setting SAML certificates (https://github.com/ansible-collections/community.zabbix/pull/408)
fragments:
- 350-zabbix_maintenance-visible_name.yaml
- 373-create_zabbix_inventory.yaml
- 377-create_globalmacros_module.yaml
- 382-zabbix_user.yml
- 391-zabbix_host-intf_idempotency_fix.yml
- zabbix-proxy-package-installation.yaml
- zabbix-server-tmp-dir.yml
- zbx-catch-all.yml
modules:
- description: Create/update/delete Zabbix Global macros
name: zabbix_globalmacro
namespace: ''
plugins:
inventory:
- description: Zabbix Inventory Plugin
name: zabbix_inventory
namespace: null
release_date: '2021-06-29'
1.5.0:
changes:
breaking_changes:
- all roles now reference other roles and modules via their fully qualified
collection names, which makes Ansible 2.10 minimum supported version for roles
(See https://github.com/ansible-collections/community.zabbix/pull/477).
bugfixes:
- all roles now support installing zabbix 4.0 version on Ubuntu 20.04.
- all roles now supports installations on Debian 11.
- zabbix inventory - Change default value for host_zapi_query from list "[]"
to dict "{}".
- zabbix_action - should no longer fail with Zabbix version 5.4.
- zabbix_agent - `zabbix_win_install_dir` no longer ignored for zabbix_agentd.d
and zabbix log directories.
- zabbix_agent - auto-recovery for Windows installation has been fixed (https://github.com/ansible-collections/community.zabbix/pull/470).
- zabbix_agent - deploying zabbix_agent2 under Windows should now be possible
(Thanks to https://github.com/ansible-collections/community.zabbix/pull/433
and https://github.com/ansible-collections/community.zabbix/pull/453).
- zabbix_agent - fixed AutoPSK for Windows deployments (https://github.com/ansible-collections/community.zabbix/pull/450).
- zabbix_host - Fix error when updating hosts caused by Zabbix bug not returning
the inventory_mode field for hosts(https://github.com/ansible-collections/community.zabbix/issues/385).
- zabbix_host - will not break when `tls_psk*` parameters are set with Zabbix
version 5.4.
- zabbix_proxy (module) - now supports configuring `tls_psk*` parameters.
- zabbix_proxy (role) - TLS config should now properly configure certificates.
- zabbix_proxy (role) - should no longer fail on permission problems wren configured
to use SQLite database and now installs correct package sqlite3 on Debian
systems.
- zabbix_web - `zabbix_nginx_vhost_*` parameters are no longer ignored.
- zabbix_web - executing role with `--tags` should now correctly include distribution
specific variables (https://github.com/ansible-collections/community.zabbix/pull/448).
- zabbix_web - now correctly restarts php-fpm service (https://github.com/ansible-collections/community.zabbix/pull/427).
- zabbix_web - permissions for accesing php-fpm socket has been fixed (See https://github.com/ansible-collections/community.zabbix/pull/426).
minor_changes:
- Added requirements.txt to collection root to be used with Ansible Builder.
See https://ansible-builder.readthedocs.io/en/latest/collection_metadata.html
- some roles are now using new naming for API connection parameters (https://github.com/ansible-collections/community.zabbix/pull/492
and https://github.com/ansible-collections/community.zabbix/pull/495).
- some roles can now utilize an option `zabbix_repo_yum_gpgcheck` to enable/disable
GPG check for YUM repository (https://github.com/ansible-collections/community.zabbix/pull/438).
- zabbix inventory - Enabled the usage of environment variables in zabbix inventory
plugin.
- zabbix inventory plugin - can now use environment variables ZABBIX_SERVER,
ZABBIX_USERNAME and ZABBIX_PASSWORD for connection purposes to the Zabbix
API.
- zabbix_agent - `zabbix_agent_loadmodule` can also be configured with a list.
- zabbix_agent - new `zabbix_api_timeout` option.
- zabbix_agent - now supports DenyKeys configuration.
- zabbix_hostmacro - now supports creating macros of type secret and vault.
- zabbix_proxy (role) - new `zabbix_api_timeout` option.
- zabbix_proxy_info - new module that allows to retrieve information about configured
Zabbix Proxies.
- zabbix_server - added support for TimescaleDB (https://github.com/ansible-collections/community.zabbix/pull/428).
fragments:
- 0-copy_ignore_txt.yml
- 415-inventory_mode-fix.yaml
- 456-zabbix-hostmacro-secret-vault.yml
- 505-awx_compatibility-fixes.yml
- zbx-missing-1.5.0.yml
- zbx-proxy-info.yaml
modules:
- description: Gather information about Zabbix proxy
name: zabbix_proxy_info
namespace: ''
release_date: '2021-11-02'
1.5.1:
changes:
bugfixes:
- template - use templateid property when linking templates for ``template.create``
and ``template.update`` API calls.
- zabbix inventory - Moved ZABBIX_VALIDATE_CERTS to correct option, validate_certs.
- zabbix_agent - Create the actual configuration file for Windows setups.
- zabbix_agent - Fix typo for correct using the zabbix_windows_service.exists
- zabbix_agent - tlspsk_auto to support become on Linux and ignore on windows
- zabbix_user - fix zabbix_user require password only on internal.
minor_changes:
- Enabled usage of environment variables for modules by adding a fallback lookup
in the module_utils/helpers.py - zabbix_common_argument_spec
fragments:
- 508-zabbix-env-vars.yml
- 512-inventory-bugfix.yaml
- 521-agent-typo.yaml
- 523-templateid-property.yml
- 527-agent-windows-config-creation.yaml
- 537-TLSPSK.yaml
- 543-internal-user.yaml
release_date: '2021-12-05'
1.6.0:
changes:
bugfixes:
- 'Various modules and plugins - use vendored version of ``distutils.version``
instead of the deprecated Python standard library ``distutils`` (https://github.com/ansible-collections/community.zabbix/pull/603).
This superseedes #597.'
- ZapiWrapper (module_utils) - fix only partial zabbix version is returned.
- zabbix_agent - Install Zabbix packages when zabbix_repo == other is used with
yum.
- zabbix_agent - Install the Agent for MacOSX sooner than its configuration.
- zabbix_agent - The ``Install gpg key`` task for Debian did not work when a
http proxy is configured.
- zabbix_agent - Use the correct URL with correct version.
- zabbix_agent - Use the correct path to determine Zabbix Agent 2 installation
on Windows.
- zabbix_agent - Using the correct hostgroup as default now.
- zabbix_agent - fix for the autopsk, incl. tests with Molecule.
- zabbix_host - Added small notification that an user should have read access
to get hostgroups overview.
- zabbix_host - adapter changed properties for interface comparisson
- zabbix_maintenance - should now work when creating maintenace on Zabbix 6.0
server
- zabbix_proxy - 'zcat' the zipped sql files to /tmp before executing it.
- zabbix_proxy - Check MySQL version before settings mysql_innodb_default_row_format
value.
- zabbix_proxy - Install Zabbix packages when zabbix_repo == other is used with
yum.
- zabbix_server - 'zcat' the zipped sql files to /tmp before executing it.
- zabbix_server - Check MySQL version before settings mysql_innodb_default_row_format
value.
- zabbix_server - Install Zabbix packages when zabbix_repo == other is used
with yum.
- zabbix_template - setting correct null values to fix unintentional changes
- zabbix_web - Added some default variables if the geerlingguys apache role
is not used.
- zabbix_web - Specified the correct versions for php.
minor_changes:
- all modules - prepare for deprecation of distutils LooseVersion.
- collection - Add dependencies to other collections. This helps Ansible Galaxy
automatically downloading collections that this collection relies on to run.
- connection.httpapi (plugin) - add initial httpapi connection plugin.
- httpapi.jsonrpc (plugin) - add initial httpapi for future handling of json-rpc.
- new module zabbix authentication for configuring global authentication settings
in Zabbix Server's Settings section of GUI.
- new module zabbix_autoregister for configuring global autoregistration settings
in Zabbix Server's Settings section of GUI.
- new module zabbix_housekeeping for configuring global housekeeping settings
in Zabbix Server's Settings section of GUI.
- test_zabbix_host_info - fix Template/Group names for 5.4
- test_zabbix_screen - disable testing for screen in 5.4 (deprecated)
- zabbix_action - additional fixes to make module work with Zabbix 6.0 (https://github.com/ansible-collections/community.zabbix/pull/664)
- zabbix_action - module ported to work with Zabbix 6.0 (https://github.com/ansible-collections/community.zabbix/pull/648,
https://github.com/ansible-collections/community.zabbix/pull/653)
- zabbix_action - should now correctly actions with maintenance_status conditions
(https://github.com/ansible-collections/community.zabbix/pull/667)
- zabbix_agent - Check if 'firewalld' exist and is running when handler is executed.
- zabbix_agent - Fixed use of bare variables in conditions (https://github.com/ansible-collections/community.zabbix/pull/663)
- zabbix_agent - Install the correct Python libxml2 package on SLES15
- zabbix_agent - Move inclusion of the apache.yml tasks to later stage during
execution of role.
- zabbix_agent - Prepare for Zabbix 6.0.
- zabbix_agent - Specify a minor version with zabbix_agent_version_minor for
RH systems.
- zabbix_agent - There was no way to configure a specific type for the macro.
- zabbix_agent - Use multiple aliases in the configuration file with ``zabbix_agent_zabbix_alias``
or ``zabbix_agent2_zabbix_alias``.
- zabbix_maintenance - added new module parameter `tags`, which allows configuring
Problem Tags on maintenances.
- zabbix_maintenance - fixed to work with Zabbix 6.0+ and Python 3.9+ (https://github.com/ansible-collections/community.zabbix/pull/665)
- zabbix_proxy - Prepare for Zabbix 6.0.
- zabbix_proxy - Specify a minor version with zabbix_proxy_version_minor for
RH systems.
- zabbix_proxy - Support for Sangoma and treat it like a RHEL system.
- zabbix_server - Check the 'zabbix_server_install_database_client' variable
in RedHat tasks.
- zabbix_server - Prepare for Zabbix 6.0.
- zabbix_server - Specify a minor version with zabbix_server_version_minor for
RH systems.
- zabbix_user - change alias property to username (changed in 5.4) (alias is
now an alias for username)
- zabbix_user_info - change alias property to username (changed in 5.4) (alias
is now an alias for username)
- zabbix_web - Change format ENCRYPTION, VERIFY_HOST from string to boolean.
- zabbix_web - Specify a minor version with zabbix_web_version_minor for RH
systems.
fragments:
- 144-check-if-service-is-running.yml
- 329-only-do-apache-stuff.yml
- 356-zbx-maint-tags.yml
- 360-fix-macos-install.yml
- 367-add-dependencies.yml
- 414-specify-minor-version.yml
- 444-add-initial-httpapi.yml
- 560-prepare-zabbix-60-roles.yml
- 570-fix-autopsk.yml
- 574-fix-windows-url.yml
- 583-change-var-type.yml
- 587-host-cannot-have-same-type.yml
- 588-template-not-found.yml
- 589-failed-to-get-screen.yml
- 591-invalid-parameter.yml
- 592-has-no-attribute.yml
- 597-prepare-distutils.yml
- 599-multiple-aliases.yml
- 603-vendor-distutils.yml
- 612-use-correct-value.yml
- 620-add-macro-type.yml
- 622-fix-environmentsettings.yml
- 630-zabbix-autoreg.yml
- 638-sangoma-rhel.yml
- 645-zabbix-authentication.yml
- 647-zabbix-housekeeping.yml
- 648-653-zbx_action.yaml
- 654-check-zabbix_server_install_database_client-rhel.yml
- 664-zbx_action.yaml
- 665-zbx_maint.yaml
- 668-zabbix_agent-sles15.yml
- various-wd.yml
modules:
- description: Update Zabbix authentication
name: zabbix_authentication
namespace: ''
- description: Update Zabbix autoregistration
name: zabbix_autoregister
namespace: ''
- description: Update Zabbix housekeeping
name: zabbix_housekeeping
namespace: ''
plugins:
connection:
- description: Use httpapi to run command on network appliances
name: httpapi
namespace: null
httpapi:
- description: HttpApi Plugin for Zabbix
name: jsonrpc
namespace: null
release_date: '2022-03-21'
1.7.0:
changes:
bugfixes:
- Include ``PSF-license.txt`` file for ``plugins/module_utils/_version.py``.
- zabbix_action - will no longer wipe `esc_step_to` and `esc_step_from` (https://github.com/ansible-collections/community.zabbix/issues/692)
- zabbix_agent - added support for zabbix-agent on Ubuntu 22.04 (https://github.com/ansible-collections/community.zabbix/pull/681)
- zabbix_agent - now properly creates webroot for issuing LE certificates (https://github.com/ansible-collections/community.zabbix/pull/677,
https://github.com/ansible-collections/community.zabbix/pull/682)
- zabbix_proxy (module) - passive proxy should be now correctly created in Zabbix
6.0 (https://github.com/ansible-collections/community.zabbix/pull/697)
- zabbix_proxy (role) - fixed accidental regression of TLS psk file being generated
for passive agent (#528) caused in (#663) (https://github.com/ansible-collections/community.zabbix/issues/680)
minor_changes:
- helpers.helper_compare_lists() changed logic to not consider the order of
elements in lists. (https://github.com/ansible-collections/community.zabbix/pull/683)
- zabbix_action, zabbix_maintenance, zabbix_mediatype, zabbix_proxy, zabbix_service
- updated to work with Zabbix 6.0. (https://github.com/ansible-collections/community.zabbix/pull/683)
- zabbix_script module added (https://github.com/ansible-collections/community.zabbix/issues/634)
fragments:
- 1.7.0-missing-fragments.yml
- 683-zbx60.yml
- 685-zabbix-script.yml
- 699-proxy-role-regression.yml
- psf-license.yml
modules:
- description: Create/update/delete Zabbix scripts
name: zabbix_script
namespace: ''
release_date: '2022-05-24'
1.8.0:
changes:
bugfixes:
- zabbix_host - fixed idempotency of the module when hostmacros or snmp interfaces
are used
- zabbix_script - fix compatibility with Zabbix <5.4.
- zabbix_script - should no longer fail when description is not set
minor_changes:
- roles - Minimized the config templates for the zabbix_agent, zabbix_javagateway,
zabbix_proxy, and zabbix_server roles to make them version independent.
- roles - Support for Zabbix 6.2 has been added
- roles - Updated the version defaults to select the latest version supported
by an operating system.
- zabbix_action - added another condition operator naming options (contains,
does not contain,...)
- zabbix_agent - Set a ansible_python_interpreter to localhost based on the
env the playbook is executed from.
- zabbix_agent - add option to set host tags using ``zabbix_agent_tags``.
- zabbix_agent - add possiblity to set include file pattern using ``zabbix_agent(2)_include_pattern``
variable.
- zabbix_agent - is now able to manage directories and upload files for TLS
PSK configuration used with Windows operating systems
- zabbix_agent - new options for Windows installations zabbix_win_install_dir_conf/bin
- zabbix_agent - when configuring firewalld, make sure the new rule is applied
immediately
- zabbix_authentication - module updated to support Zabbix 6.2
- zabbix_host - using ``tls_psk_identity`` or ``tls_psk`` parameters with Zabbix
>= 5.4 makes this module non-idempotent
- zabbix_host - will no longer wipe tls_connect en tls_accept settings when
not specified on update
- zabbix_mediatype - added support for time units in ``attempt_interval`` parameter
- zabbix_template - added support for template groups (Zabbix >= 6.2)
- zabbix_template_info - add template_id return value
- zabbix_template_info - add yaml and none formats
- zabbix_user_directory - added new module to support multiple sources for LDAP
authentication
fragments:
- 602-change-intrepeter.yml
- 711-minimize-role-config-templates.yml
- 727-script-compatibility.yml
- 731-template-info-formats.yml
- 738-template-groups.yml
- 741-host-tls-psk-fix.yml
- 743-agent-tags.yml
- 744-mediatype-attemptinterval-timeunits.yml
- 749-action-operator-naming.yml
- 753-host-tls-settings.yml
- 755-user-directory-module.yml
- 770-agent-include-pattern.yml
- 771-auto-select-version.yml
- firewalld_immediate.yaml
- missing.yml
release_date: '2022-08-15'
1.9.0:
changes:
bugfixes:
- The inventory script had insufficient error handling in case the Zabbix API
provided an empty interfaces list. This bugfix checks for an exisiting interfaces
element, then for the minimal length of 1 so that the first interface will
only be accessed when it really exists in the api response. (https://github.com/ansible-collections/community.zabbix/issues/826)
- zabbix-proxy - updated to install correct sources for Debian arm64 family
- zabbix_agent - Filter IPv6 addresses from list of IP as Zabbix host creation
expects IPv4
- zabbix_agent - installation on Windows will no longer fail when zabbix_agent2
is used
- zabbix_host - fix updating of host without interfaces
- zabbix_proxy - correctly provision tls_accept and tls_connect on Zabbix backend
- zabbix_proxy - updated the datafiles_path fact for the zabbix_proxy and zabbix_server
roles due to upstream change
- zabbix_server - move location of the fping(6) variables to distribution specific
files (https://github.com/ansible-collections/community.zabbix/issues/812)
- zabbix_server - updated the datafiles_path fact for the zabbix_proxy and zabbix_server
roles due to upstream change
major_changes:
- all modules are opting away from zabbix-api and using httpapi ansible.netcommon
plugin. We will support zabbix-api for backwards compatibility until next
major release. See our README.md for more information about how to migrate
- zabbix_agent and zabbix_proxy roles are opting away from zabbix-api and use
httpapi ansible.netcommon plugin. We will support zabbix-api for backwards
compatibility until next major release. See our README.md for more information
about how to migrate
minor_changes:
- ansible_zabbix_url_path introduced to be able to specify non-default Zabbix
WebUI path, e.g. http://<FQDN>/zabbixeu
- collection now supports creating ``module_defaults`` for ``group/community.zabbix.zabbix``
(see https://github.com/ansible-collections/community.zabbix/issues/326)
- fixed ``zabbix_server`` role failure running in check_mode (see https://github.com/ansible-collections/community.zabbix/issues/804)
- zabbix_agent - give Zabbix Agent access to the Linux DMI table allowing system.hw.chassis
info to populate.
- zabbix_template - add support for template tags
- zabbix_user_role module added
- zabbix_web - add support for Ubuntu 22.04 jammy
fragments:
- 326-module_defaults-group.yml
- 526-swap-tls-accept-connect-in-proxy.yaml
- 778-zbx-agent2-win.yml
- 784-allow-system.hw.chassis-to-populate-on-linux.yml
- 786-web-add-ubuntu-22-04-support.yml
- 792-update-host-without-iface-fix.yml
- 795-zbx-agent-win-ipv6.yml
- 800-add-template-tags.yml
- 806-httpapi-connection-plugin.yml
- 812-fping-binary-location.yml
- 813-sql-scripts-moved-to-usr-share.yml
- 821-zabbix-proxy-debian-arm64.yml
- 822-roles-to-httpapi.yml
- 823-zabbix_server-role-in-check-mode.yml
- 827-fixing-bug-for-empty-interfaces-list.yml
- module_zabbix-user-role.yml
- modules-url-path.yml
release_date: '2022-11-07'
1.9.1:
changes:
bugfixes:
- all modules - remove deprecation warnings for modules parameters related to
zabbix-api when these parapmeters are not explicetely defined
- all roles and modules integration tests - replace deprecated include module
whith include_tasks
- zabbix_agent, zabbix_proxy roles, all modules - make httpapi connection work
with HTTP Basic Authorization
- zabbix_proxy - do not set ServerPort config parameter which was removed in
Zabbix 6.0
- 'zabbix_server role Debian.yml task - remove warn: arg for shell module as
the arg is deprecated since ansible-core above 2.13'
- zabbix_user_role module - creation of a User Role with Super Admin type
minor_changes:
- zabbix suport for rhel 9
fragments:
- 845-rhel-9-support.yml
- 850-proxy-serverport.yml
- 857-deprecation-warnings.yml
- 859-remove-warn-arg.yml
- 866-user-role-superadmin.yml
- 868-include-to-include-tasks.yml
- fix-httpapi-http-auth.yml
release_date: '2023-01-09'

View File

@@ -0,0 +1,32 @@
---
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: community.zabbix
trivial_section_name: trivial
use_fqcn: true

View File

@@ -0,0 +1,37 @@
---
version: '3.7'
services:
zabbix-db:
image: postgres:13
environment:
POSTGRES_DB: "zabbix"
POSTGRES_USER: "zabbix"
POSTGRES_PASSWORD: "zabbix"
zabbix-server:
image: zabbix/zabbix-server-pgsql:ubuntu-${zabbix_version}-latest
environment:
DB_SERVER_HOST: "zabbix-db"
POSTGRES_USER: "zabbix"
POSTGRES_PASSWORD: "zabbix"
POSTGRES_DB: "zabbix"
depends_on:
- "zabbix-db"
links:
- "zabbix-db"
zabbix-web:
image: zabbix/zabbix-web-nginx-pgsql:ubuntu-${zabbix_version}-latest
environment:
DB_SERVER_HOST: "zabbix-db"
POSTGRES_USER: "zabbix"
POSTGRES_PASSWORD: "zabbix"
POSTGRES_DB: "zabbix"
ZBX_SERVER_HOST: "zabbix-server"
PHP_TZ: "Asia/Tokyo"
depends_on:
- "zabbix-db"
- "zabbix-server"
links:
- "zabbix-db"
- "zabbix-server"
ports:
- "8080:8080"

View File

@@ -0,0 +1,34 @@
---
requires_ansible: '>=2.9.10'
action_groups:
zabbix:
- zabbix_action
- zabbix_authentication
- zabbix_autoregister
- zabbix_discovery_rule
- zabbix_globalmacro
- zabbix_group_facts
- zabbix_group_info
- zabbix_group
- zabbix_host_events_info
- zabbix_host_facts
- zabbix_host_info
- zabbix_hostmacro
- zabbix_host
- zabbix_housekeeping
- zabbix_maintenance
- zabbix_map
- zabbix_mediatype
- zabbix_proxy_info
- zabbix_proxy
- zabbix_screen
- zabbix_script
- zabbix_service
- zabbix_template_info
- zabbix_template
- zabbix_user_directory
- zabbix_usergroup
- zabbix_user_info
- zabbix_user
- zabbix_user_role
- zabbix_valuemap

View File

@@ -0,0 +1,11 @@
# Install CI dependencies for the Zabbix Roles
ansible==4.6.0
ansible-compat==0.5.0
ansible-core==2.11.5
docker==5.0.2
molecule==3.5.1
molecule-docker==1.0.2
netaddr==0.8.0
pytest-testinfra==6.1.0
ipaddr==2.2.0
ipaddress==1.0.23

View File

@@ -0,0 +1,58 @@
---
driver:
name: docker
platforms:
- name: zabbix-agent-${MY_MOLECULE_CONTAINER:-centos}
image: ${MY_MOLECULE_IMAGE:-"geerlingguy/docker-centos8-ansible"}
command: ${MY_MOLECULE_DOCKER_COMMAND:-""}
privileged: true
pre_build_image: true
networks:
- name: zabbix
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
groups:
- agent
provisioner:
name: ansible
lint:
name: ansible-lint
playbooks:
prepare: ../../common/playbooks/prepare.yml
converge: ../../common/playbooks/converge.yml
env:
ANSIBLE_REMOTE_TMP: /tmp/
ANSIBLE_COLLECTIONS_PATHS: $HOME/.ansible/collections/ansible_collections/community/zabbix
ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles
inventory:
group_vars:
all:
zabbix_agent_src_reinstall: false
zabbix_install_pip_packages: false
zabbix_agent_server: 192.168.3.33
zabbix_agent_serveractive: 192.168.3.33
zabbix_agent_listenip: 0.0.0.0
zabbix_agent_tlsconnect: psk
zabbix_agent_tlsaccept: psk
scenario:
test_sequence:
- dependency
- lint
- cleanup
- destroy
- syntax
- create
- prepare
- converge
- idempotence
- side_effect
- verify
- cleanup
- destroy
verifier:
name: testinfra
lint:
name: flake8

View File

@@ -0,0 +1,5 @@
---
- name: Converge
hosts: all
roles:
- role: zabbix_agent

View File

@@ -0,0 +1,86 @@
---
- name: Prepare
hosts: all
tasks:
- name: "Installing packages on CentOS family"
package:
pkg:
- net-tools
- which
state: present
register: zabbix_agent_prepare_packages_install
until: zabbix_agent_prepare_packages_install is succeeded
when:
- ansible_os_family == 'RedHat'
- name: "Installing packages on CentOS (Sangoma) family"
package:
pkg:
- net-tools
- which
state: present
register: zabbix_agent_prepare_packages_install
until: zabbix_agent_prepare_packages_install is succeeded
when:
- ansible_os_family == 'Sangoma'
- name: "Installing packages on Debian family"
apt:
name:
- "{{ 'net-tools' if ansible_distribution_major_version not in ['10','18', '20'] else 'iproute2' }}"
state: present
update_cache: true
register: zabbix_agent_prepare_packages_install
until: zabbix_agent_prepare_packages_install is succeeded
when:
- ansible_os_family == 'Debian'
- name: "Installing packages on Suse family"
shell: zypper install -y python-xml python-libxml2 net-tools which
register: zabbix_agent_prepare_packages_install
until: zabbix_agent_prepare_packages_install is succeeded
when: ansible_os_family == 'Suse'
tags:
- skip_ansible_lint
- name: Prepare
hosts: docker
tasks:
- name: "Download Docker CE repo file"
get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo
mode: 0644
register: zabbix_agent_prepare_docker_repo
until: zabbix_agent_prepare_docker_repo is succeeded
- name: "Installing Epel"
package:
pkg:
- epel-release
state: present
register: zabbix_agent_prepare_docker_install
until: zabbix_agent_prepare_docker_install is succeeded
- name: "Installing Docker"
package:
pkg:
- docker-ce
- python-pip
- python-setuptools
state: present
register: zabbix_agent_prepare_docker_install
until: zabbix_agent_prepare_docker_install is succeeded
- name: "Installing Docker Python"
pip:
name:
- docker
state: present
register: zabbix_agent_prepare_docker_install
until: zabbix_agent_prepare_docker_install is succeeded
- name: "Starting Docker service"
service:
name: docker
state: started

View File

@@ -0,0 +1,12 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent2")
def test_zabbix_agent2_dot_conf(host, zabbix_agent_file):
assert zabbix_agent_file.contains("Plugins.SystemRun.LogRemoteCommands=0")

View File

@@ -0,0 +1,24 @@
import pytest
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbix_agent_dot_conf(host, zabbix_agent_conf):
assert zabbix_agent_conf.contains("TLSAccept=psk")
assert zabbix_agent_conf.contains(
f"TLSPSKIdentity={host.ansible.get_variables()['inventory_hostname']}"
)
assert zabbix_agent_conf.contains("TLSPSKFile=/etc/zabbix/tls_psk_auto.secret")
def test_zabbix_agent_autopsk(host):
psk_file = host.file("/etc/zabbix/tls_psk_auto.secret")
assert psk_file.user == "zabbix"
assert psk_file.group == "zabbix"
assert psk_file.mode == 0o400
assert psk_file.size == 64

View File

@@ -0,0 +1,49 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbixagent_running_and_enabled(host, zabbix_agent_service):
# Find out why this is not working for linuxmint and opensuse
if host.system_info.distribution not in ["linuxmint", "opensuse", "ubuntu"]:
assert zabbix_agent_service.is_running
assert zabbix_agent_service.is_enabled
def test_zabbix_agent_dot_conf(zabbix_agent_conf):
assert zabbix_agent_conf.user == "root"
assert zabbix_agent_conf.group == "root"
assert zabbix_agent_conf.mode == 0o644
assert zabbix_agent_conf.contains("Server=192.168.3.33")
assert zabbix_agent_conf.contains("ServerActive=192.168.3.33")
assert zabbix_agent_conf.contains("DebugLevel=3")
def test_zabbix_include_dir(zabbix_agent_include_dir):
assert zabbix_agent_include_dir.is_directory
assert zabbix_agent_include_dir.user == "root"
assert zabbix_agent_include_dir.group == "zabbix"
def test_socket(host):
# Find out why this is not working for linuxmint and opensus
if host.system_info.distribution not in ["linuxmint", "opensuse"]:
assert host.socket("tcp://0.0.0.0:10050").is_listening
def test_zabbix_package(host, zabbix_agent_package):
assert zabbix_agent_package.is_installed
if host.system_info.distribution == "debian":
if host.system_info.codename in ["bullseye", "focal"]:
assert zabbix_agent_package.version.startswith("1:6.2")
else:
assert zabbix_agent_package.version.startswith("1:6.0")
if host.system_info.distribution == "centos":
assert zabbix_agent_package.version.startswith("6.2")

View File

@@ -0,0 +1,24 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbix_agent_dot_conf(zabbix_agent_conf):
assert zabbix_agent_conf.contains("TLSAccept=psk")
assert zabbix_agent_conf.contains("TLSPSKIdentity=my_Identity")
assert zabbix_agent_conf.contains("TLSPSKFile=/data/certs/zabbix.psk")
def test_zabbix_agent_psk(host):
psk_file = host.file("/data/certs/zabbix.psk")
assert psk_file.user == "zabbix"
assert psk_file.group == "zabbix"
assert psk_file.mode == 0o400
assert psk_file.contains(
"97defd6bd126d5ba7fa5f296595f82eac905d5eda270207a580ab7c0cb9e8eab"
)

View File

@@ -0,0 +1,23 @@
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("docker")
def test_docker_running(host):
zabbixagent = host.docker("zabbix-agent")
zabbixagent.is_running
def test_zabbix_include_dir(host):
zabbixagent = host.file("/etc/zabbix/zabbix_agentd.d")
assert zabbixagent.is_directory
assert zabbixagent.user == "root"
assert zabbixagent.group == "zabbix"
def test_socket(host):
assert host.socket("tcp://0.0.0.0:10050").is_listening

View File

@@ -0,0 +1,19 @@
---
scenario:
name: agent2
provisioner:
name: ansible
inventory:
group_vars:
all:
zabbix_agent2: true
zabbix_agent2_tlsconnect: psk
zabbix_agent2_tlsaccept: psk
zabbix_agent2_tlspskidentity: my_Identity
zabbix_agent2_tlspskfile: /data/certs/zabbix.psk
zabbix_agent2_tlspsk_secret: 97defd6bd126d5ba7fa5f296595f82eac905d5eda270207a580ab7c0cb9e8eab
zabbix_agent2_plugins:
- name: SystemRun
options:
- parameter: LogRemoteCommands
value: 0

View File

@@ -0,0 +1,12 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent2")
def test_zabbix_agent2_dot_conf(host, zabbix_agent_file):
assert zabbix_agent_file.contains("Plugins.SystemRun.LogRemoteCommands=0")

View File

@@ -0,0 +1,49 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbixagent_running_and_enabled(host, zabbix_agent_service):
# Find out why this is not working for linuxmint and opensuse
if host.system_info.distribution not in ["linuxmint", "opensuse", "ubuntu"]:
assert zabbix_agent_service.is_running
assert zabbix_agent_service.is_enabled
def test_zabbix_agent_dot_conf(zabbix_agent_conf):
assert zabbix_agent_conf.user == "root"
assert zabbix_agent_conf.group == "root"
assert zabbix_agent_conf.mode == 0o644
assert zabbix_agent_conf.contains("Server=192.168.3.33")
assert zabbix_agent_conf.contains("ServerActive=192.168.3.33")
assert zabbix_agent_conf.contains("DebugLevel=3")
def test_zabbix_include_dir(zabbix_agent_include_dir):
assert zabbix_agent_include_dir.is_directory
assert zabbix_agent_include_dir.user == "root"
assert zabbix_agent_include_dir.group == "zabbix"
def test_socket(host):
# Find out why this is not working for linuxmint and opensus
if host.system_info.distribution not in ["linuxmint", "opensuse"]:
assert host.socket("tcp://0.0.0.0:10050").is_listening
def test_zabbix_package(host, zabbix_agent_package):
assert zabbix_agent_package.is_installed
if host.system_info.distribution == "debian":
if host.system_info.codename in ["bullseye", "focal"]:
assert zabbix_agent_package.version.startswith("1:6.2")
else:
assert zabbix_agent_package.version.startswith("1:6.0")
if host.system_info.distribution == "centos":
assert zabbix_agent_package.version.startswith("6.2")

View File

@@ -0,0 +1,33 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
@pytest.fixture
def zabbix_agent_conf(host):
if host.system_info.distribution in ["opensuse"]:
passwd = host.file("/etc/zabbix/zabbix-agentd.conf")
else:
passwd = host.file("/etc/zabbix/zabbix_agent2.conf")
return passwd
@pytest.fixture
def zabbix_agent_service(host):
return host.service("zabbix-agent2")
@pytest.fixture
def zabbix_agent_include_dir(host):
return host.file("/etc/zabbix/zabbix_agent2.d")
@pytest.fixture
def zabbix_agent_package(host):
return host.package("zabbix-agent2")

View File

@@ -0,0 +1,24 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbix_agent_dot_conf(zabbix_agent_conf):
assert zabbix_agent_conf.contains("TLSAccept=psk")
assert zabbix_agent_conf.contains("TLSPSKIdentity=my_Identity")
assert zabbix_agent_conf.contains("TLSPSKFile=/data/certs/zabbix.psk")
def test_zabbix_agent_psk(host):
psk_file = host.file("/data/certs/zabbix.psk")
assert psk_file.user == "zabbix"
assert psk_file.group == "zabbix"
assert psk_file.mode == 0o400
assert psk_file.contains(
"97defd6bd126d5ba7fa5f296595f82eac905d5eda270207a580ab7c0cb9e8eab"
)

View File

@@ -0,0 +1,17 @@
---
scenario:
name: agent2autopsk
provisioner:
name: ansible
inventory:
group_vars:
all:
zabbix_agent2: true
zabbix_agent2_tlsconnect: psk
zabbix_agent2_tlsaccept: psk
zabbix_agent2_tlspsk_auto: True
zabbix_agent2_plugins:
- name: SystemRun
options:
- parameter: LogRemoteCommands
value: 0

View File

@@ -0,0 +1,12 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent2")
def test_zabbix_agent2_dot_conf(host, zabbix_agent_file):
assert zabbix_agent_file.contains("Plugins.SystemRun.LogRemoteCommands=0")

View File

@@ -0,0 +1,24 @@
import pytest
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbix_agent_dot_conf(host, zabbix_agent_conf):
assert zabbix_agent_conf.contains("TLSAccept=psk")
assert zabbix_agent_conf.contains(
f"TLSPSKIdentity={host.ansible.get_variables()['inventory_hostname']}"
)
assert zabbix_agent_conf.contains("TLSPSKFile=/etc/zabbix/tls_psk_auto.secret")
def test_zabbix_agent_autopsk(host):
psk_file = host.file("/etc/zabbix/tls_psk_auto.secret")
assert psk_file.user == "zabbix"
assert psk_file.group == "zabbix"
assert psk_file.mode == 0o400
assert psk_file.size == 64

View File

@@ -0,0 +1,49 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbixagent_running_and_enabled(host, zabbix_agent_service):
# Find out why this is not working for linuxmint and opensuse
if host.system_info.distribution not in ["linuxmint", "opensuse", "ubuntu"]:
assert zabbix_agent_service.is_running
assert zabbix_agent_service.is_enabled
def test_zabbix_agent_dot_conf(zabbix_agent_conf):
assert zabbix_agent_conf.user == "root"
assert zabbix_agent_conf.group == "root"
assert zabbix_agent_conf.mode == 0o644
assert zabbix_agent_conf.contains("Server=192.168.3.33")
assert zabbix_agent_conf.contains("ServerActive=192.168.3.33")
assert zabbix_agent_conf.contains("DebugLevel=3")
def test_zabbix_include_dir(zabbix_agent_include_dir):
assert zabbix_agent_include_dir.is_directory
assert zabbix_agent_include_dir.user == "root"
assert zabbix_agent_include_dir.group == "zabbix"
def test_socket(host):
# Find out why this is not working for linuxmint and opensus
if host.system_info.distribution not in ["linuxmint", "opensuse"]:
assert host.socket("tcp://0.0.0.0:10050").is_listening
def test_zabbix_package(host, zabbix_agent_package):
assert zabbix_agent_package.is_installed
if host.system_info.distribution == "debian":
if host.system_info.codename in ["bullseye", "focal"]:
assert zabbix_agent_package.version.startswith("1:6.2")
else:
assert zabbix_agent_package.version.startswith("1:6.0")
if host.system_info.distribution == "centos":
assert zabbix_agent_package.version.startswith("6.2")

View File

@@ -0,0 +1,33 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
@pytest.fixture
def zabbix_agent_conf(host):
if host.system_info.distribution in ["opensuse"]:
passwd = host.file("/etc/zabbix/zabbix-agentd.conf")
else:
passwd = host.file("/etc/zabbix/zabbix_agent2.conf")
return passwd
@pytest.fixture
def zabbix_agent_service(host):
return host.service("zabbix-agent2")
@pytest.fixture
def zabbix_agent_include_dir(host):
return host.file("/etc/zabbix/zabbix_agent2.d")
@pytest.fixture
def zabbix_agent_package(host):
return host.package("zabbix-agent2")

View File

@@ -0,0 +1,9 @@
---
scenario:
name: autopsk
provisioner:
name: ansible
inventory:
group_vars:
all:
zabbix_agent_tlspsk_auto: True

View File

@@ -0,0 +1,24 @@
import pytest
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbix_agent_dot_conf(host, zabbix_agent_conf):
assert zabbix_agent_conf.contains("TLSAccept=psk")
assert zabbix_agent_conf.contains(
f"TLSPSKIdentity={host.ansible.get_variables()['inventory_hostname']}"
)
assert zabbix_agent_conf.contains("TLSPSKFile=/etc/zabbix/tls_psk_auto.secret")
def test_zabbix_agent_autopsk(host):
psk_file = host.file("/etc/zabbix/tls_psk_auto.secret")
assert psk_file.user == "zabbix"
assert psk_file.group == "zabbix"
assert psk_file.mode == 0o400
assert psk_file.size == 64

View File

@@ -0,0 +1,49 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbixagent_running_and_enabled(host, zabbix_agent_service):
# Find out why this is not working for linuxmint and opensuse
if host.system_info.distribution not in ["linuxmint", "opensuse", "ubuntu"]:
assert zabbix_agent_service.is_running
assert zabbix_agent_service.is_enabled
def test_zabbix_agent_dot_conf(zabbix_agent_conf):
assert zabbix_agent_conf.user == "root"
assert zabbix_agent_conf.group == "root"
assert zabbix_agent_conf.mode == 0o644
assert zabbix_agent_conf.contains("Server=192.168.3.33")
assert zabbix_agent_conf.contains("ServerActive=192.168.3.33")
assert zabbix_agent_conf.contains("DebugLevel=3")
def test_zabbix_include_dir(zabbix_agent_include_dir):
assert zabbix_agent_include_dir.is_directory
assert zabbix_agent_include_dir.user == "root"
assert zabbix_agent_include_dir.group == "zabbix"
def test_socket(host):
# Find out why this is not working for linuxmint and opensus
if host.system_info.distribution not in ["linuxmint", "opensuse"]:
assert host.socket("tcp://0.0.0.0:10050").is_listening
def test_zabbix_package(host, zabbix_agent_package):
assert zabbix_agent_package.is_installed
if host.system_info.distribution == "debian":
if host.system_info.codename in ["bullseye", "focal"]:
assert zabbix_agent_package.version.startswith("1:6.2")
else:
assert zabbix_agent_package.version.startswith("1:6.0")
if host.system_info.distribution == "centos":
assert zabbix_agent_package.version.startswith("6.2")

View File

@@ -0,0 +1,33 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
@pytest.fixture
def zabbix_agent_conf(host):
if host.system_info.distribution in ["opensuse"]:
conf_file = host.file("/etc/zabbix/zabbix-agentd.conf")
else:
conf_file = host.file("/etc/zabbix/zabbix_agentd.conf")
return conf_file
@pytest.fixture
def zabbix_agent_service(host):
return host.service("zabbix-agent")
@pytest.fixture
def zabbix_agent_include_dir(host):
return host.file("/etc/zabbix/zabbix_agentd.d")
@pytest.fixture
def zabbix_agent_package(host):
return host.package("zabbix-agent")

View File

@@ -0,0 +1,11 @@
---
scenario:
name: default
provisioner:
name: ansible
inventory:
group_vars:
all:
zabbix_agent_tlspskidentity: my_Identity
zabbix_agent_tlspskfile: /data/certs/zabbix.psk
zabbix_agent_tlspsk_secret: 97defd6bd126d5ba7fa5f296595f82eac905d5eda270207a580ab7c0cb9e8eab

View File

@@ -0,0 +1,49 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbixagent_running_and_enabled(host, zabbix_agent_service):
# Find out why this is not working for linuxmint and opensuse
if host.system_info.distribution not in ["linuxmint", "opensuse", "ubuntu"]:
assert zabbix_agent_service.is_running
assert zabbix_agent_service.is_enabled
def test_zabbix_agent_dot_conf(zabbix_agent_conf):
assert zabbix_agent_conf.user == "root"
assert zabbix_agent_conf.group == "root"
assert zabbix_agent_conf.mode == 0o644
assert zabbix_agent_conf.contains("Server=192.168.3.33")
assert zabbix_agent_conf.contains("ServerActive=192.168.3.33")
assert zabbix_agent_conf.contains("DebugLevel=3")
def test_zabbix_include_dir(zabbix_agent_include_dir):
assert zabbix_agent_include_dir.is_directory
assert zabbix_agent_include_dir.user == "root"
assert zabbix_agent_include_dir.group == "zabbix"
def test_socket(host):
# Find out why this is not working for linuxmint and opensus
if host.system_info.distribution not in ["linuxmint", "opensuse"]:
assert host.socket("tcp://0.0.0.0:10050").is_listening
def test_zabbix_package(host, zabbix_agent_package):
assert zabbix_agent_package.is_installed
if host.system_info.distribution == "debian":
if host.system_info.codename in ["bullseye", "focal"]:
assert zabbix_agent_package.version.startswith("1:6.2")
else:
assert zabbix_agent_package.version.startswith("1:6.0")
if host.system_info.distribution == "centos":
assert zabbix_agent_package.version.startswith("6.2")

View File

@@ -0,0 +1,33 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
@pytest.fixture
def zabbix_agent_conf(host):
if host.system_info.distribution in ["opensuse"]:
conf_file = host.file("/etc/zabbix/zabbix-agentd.conf")
else:
conf_file = host.file("/etc/zabbix/zabbix_agentd.conf")
return conf_file
@pytest.fixture
def zabbix_agent_service(host):
return host.service("zabbix-agent")
@pytest.fixture
def zabbix_agent_include_dir(host):
return host.file("/etc/zabbix/zabbix_agentd.d")
@pytest.fixture
def zabbix_agent_package(host):
return host.package("zabbix-agent")

View File

@@ -0,0 +1,24 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("agent")
def test_zabbix_agent_dot_conf(zabbix_agent_conf):
assert zabbix_agent_conf.contains("TLSAccept=psk")
assert zabbix_agent_conf.contains("TLSPSKIdentity=my_Identity")
assert zabbix_agent_conf.contains("TLSPSKFile=/data/certs/zabbix.psk")
def test_zabbix_agent_psk(host):
psk_file = host.file("/data/certs/zabbix.psk")
assert psk_file.user == "zabbix"
assert psk_file.group == "zabbix"
assert psk_file.mode == 0o400
assert psk_file.contains(
"97defd6bd126d5ba7fa5f296595f82eac905d5eda270207a580ab7c0cb9e8eab"
)

View File

@@ -0,0 +1,6 @@
---
- name: Converge
hosts: all
roles:
- role: zabbix_javagateway
javagateway_pidfile: /tmp/zabbix_java.pid

View File

@@ -0,0 +1,27 @@
---
driver:
name: docker
platforms:
- name: zabbix-javagateway-${MY_MOLECULE_CONTAINER:-centos}
image: ${MY_MOLECULE_IMAGE:-"geerlingguy/docker-centos8-ansible"}
command: ${MY_MOLECULE_DOCKER_COMMAND:-""}
privileged: true
pre_build_image: true
networks:
- name: zabbix
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
lint:
name: ansible-lint
env:
ANSIBLE_COLLECTIONS_PATHS: $HOME/.ansible/collections/ansible_collections/community/zabbix
ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles
verifier:
name: testinfra
lint:
name: flake8

View File

@@ -0,0 +1,57 @@
---
- name: Prepare
hosts: all
pre_tasks:
- name: "Set short version name"
set_fact:
zabbix_python_prefix: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}"
- name: "Installing packages on CentOS"
yum:
name:
- net-tools
- which
- sudo
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family == 'RedHat'
- name: "Make sure the docs can be installed. (Debian)"
lineinfile:
path: /etc/dpkg/dpkg.cfg.d/excludes
state: absent
regexp: 'path-exclude=/usr/share/doc/*'
when:
- ansible_os_family != 'RedHat'
# https://github.com/geerlingguy/ansible-role-java/issues/64
- name: "Apt update"
shell: "apt-get update && mkdir -p /usr/share/man/man1"
args:
warn: false
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- name: "Installing packages on NON-CentOS"
apt:
name:
- net-tools
- apt-utils
- procps
- "{{ zabbix_python_prefix }}-pip"
- gpg-agent
- "{{ zabbix_python_prefix }}-apt"
- sudo
- software-properties-common
- openjdk-11-jdk
update_cache: true
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'

View File

@@ -0,0 +1,23 @@
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_zabbix_running_and_enabled(host):
zabbix = host.service("zabbix-java-gateway")
assert zabbix.is_running
def test_zabbix_java_gateway_dot_conf(host):
zabbix_proxy_conf = host.file("/etc/zabbix/zabbix_java_gateway.conf")
assert zabbix_proxy_conf.user == "zabbix"
assert zabbix_proxy_conf.group == "zabbix"
assert zabbix_proxy_conf.mode == 0o644
assert zabbix_proxy_conf.contains("LISTEN_IP=0.0.0.0")
assert zabbix_proxy_conf.contains("LISTEN_PORT=10052")
assert zabbix_proxy_conf.contains("PID_FILE=/run/zabbix/zabbix_java_gateway.pid")
assert zabbix_proxy_conf.contains("START_POLLERS=5")

View File

@@ -0,0 +1,4 @@
---
- hosts: all
roles:
- role: zabbix_proxy

View File

@@ -0,0 +1,25 @@
---
- name: Destroy
hosts: localhost
connection: local
gather_facts: false
no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
vars:
molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
molecule_yml: "{{ lookup('file', molecule_file) | from_yaml }}"
tasks:
- name: Destroy molecule instance(s)
docker_container:
name: "{{ item.name }}"
state: absent
force_kill: "{{ item.force_kill | default(True) }}"
with_items: "{{ molecule_yml.platforms }}"
- name: Destroy 3rd party instance(s)
docker_container:
name: '{{ item }}'
state: absent
force_kill: true
with_items:
- mysql-host
- postgresql-host

View File

@@ -0,0 +1,56 @@
---
driver:
name: docker
platforms:
- name: zabbix-proxy-${MY_MOLECULE_CONTAINER:-mysql-centos}
image: ${MY_MOLECULE_IMAGE:-"geerlingguy/docker-centos8-ansible"}
command: ${MY_MOLECULE_DOCKER_COMMAND:-""}
privileged: true
pre_build_image: true
networks:
- name: zabbix
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
groups:
- ${MY_MOLECULE_GROUP:-mysql}
provisioner:
name: ansible
lint:
name: ansible-lint
env:
ANSIBLE_COLLECTIONS_PATHS: $HOME/.ansible/collections/ansible_collections/community/zabbix
ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles
inventory:
group_vars:
mysql:
zabbix_proxy_database: mysql
zabbix_proxy_database_long: mysql
zabbix_proxy_dbport: 3306
zabbix_proxy_dbhost: mysql-host
zabbix_proxy_dbhost_run_install: false
zabbix_proxy_privileged_host: '%'
zabbix_proxy_mysql_login_host: mysql-host
zabbix_proxy_mysql_login_user: root
zabbix_proxy_mysql_login_password: changeme
zabbix_proxy_mysql_login_port: 3306
postgresql:
zabbix_proxy_database: pgsql
zabbix_proxy_database_long: postgresql
zabbix_proxy_dbport: 5432
zabbix_proxy_dbhost: postgresql-host
zabbix_proxy_dbhost_run_install: false
zabbix_proxy_pgsql_login_host: postgresql-host
zabbix_proxy_pgsql_login_user: postgres
zabbix_proxy_pgsql_login_password: changeme
zabbix_proxy_pgsql_login_port: 5432
sqlite3:
zabbix_proxy_database: sqlite3
zabbix_proxy_database_long: sqlite3
zabbix_proxy_dbname: /path/to/sqlite3.db
verifier:
name: testinfra
lint:
name: flake8

View File

@@ -0,0 +1,129 @@
---
- name: Prepare
hosts: localhost
connection: local
pre_tasks:
- name: "Create MySQL Container"
docker_container:
name: mysql-host
image: mysql:8.0
state: started
recreate: true
networks:
- name: zabbix
env:
MYSQL_ROOT_PASSWORD: changeme
no_log: true
with_items: "{{ molecule_yml.platforms }}"
when:
- '"mysql" in item.groups'
- name: "Create postgresql Container"
docker_container:
name: postgresql-host
image: postgres:13
state: started
recreate: true
networks:
- name: zabbix
env:
POSTGRES_PASSWORD: changeme
no_log: true
with_items: "{{ molecule_yml.platforms }}"
when:
- '"postgresql" in item.groups'
- name: Prepare
hosts: all
tasks:
- name: "Set short version name"
set_fact:
zabbix_python_prefix: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}"
- name: "Create group for imaginary host"
add_host:
name: imaginary-host
groups:
- mysql
- postgresql
changed_when: false
- name: "Installing packages on CentOS"
yum:
name:
- net-tools
- which
- sudo
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family == 'RedHat'
- name: "Installing packages on CentOS"
yum:
name:
- mysql
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family == 'RedHat'
- inventory_hostname in groups['mysql']
- name: "Apt update"
shell: "apt-get update && echo exit 0 > /usr/sbin/policy-rc.d"
args:
warn: false
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- name: "Installing packages on NON-CentOS"
apt:
name:
- net-tools
- apt-utils
- "{{ zabbix_python_prefix }}-pip"
- gpg-agent
- sudo
- doc-base
update_cache: true
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- name: "Configure SUDO."
lineinfile:
dest: /etc/sudoers
line: "Defaults !requiretty"
state: present
- name: "Make sure the docs can be installed. (RedHat)"
lineinfile:
dest: /etc/yum.conf
line: "tsflags=nodocs"
state: absent
when:
- ansible_os_family == 'RedHat'
- name: "Make sure the docs can be installed. (Debian)"
lineinfile:
path: /etc/dpkg/dpkg.cfg.d/excludes
state: absent
regexp: 'path-exclude=/usr/share/doc/*'
when:
- ansible_os_family != 'RedHat'
- name: PyMySQL
pip:
name: PyMySQL
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- inventory_hostname in groups['mysql']

View File

@@ -0,0 +1,64 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_zabbixproxy_running_and_enabled(host):
zabbix = host.service("zabbix-proxy")
if host.system_info.distribution == "centos":
assert zabbix.is_enabled
assert zabbix.is_running
else:
assert zabbix.is_running
@pytest.mark.parametrize(
"proxy", [("zabbix-proxy-pgsql"), ("zabbix-proxy-mysql"), ("zabbix-proxy-sqlite3")]
)
def test_zabbix_package(host, proxy):
ansible_data = host.ansible.get_variables()
zabbixhost = ansible_data["inventory_hostname"]
zabbixhost = zabbixhost.replace("-centos", "")
zabbixhost = zabbixhost.replace("-debian", "")
zabbixhost = zabbixhost.replace("-ubuntu", "")
if zabbixhost == proxy:
zabbix_proxy = host.package(proxy)
if host.system_info.distribution in ["debian", "ubuntu"]:
assert zabbix_proxy.version.startswith("1:6.2")
elif host.system_info.distribution == "centos":
assert zabbix_proxy.version.startswith("6.2")
assert zabbix_proxy.is_installed
def test_zabbix_proxy_dot_conf(host):
zabbix_proxy_conf = host.file("/etc/zabbix/zabbix_proxy.conf")
assert zabbix_proxy_conf.user == "zabbix"
assert zabbix_proxy_conf.group == "zabbix"
assert zabbix_proxy_conf.mode == 0o644
assert zabbix_proxy_conf.contains("ListenPort=10051")
assert zabbix_proxy_conf.contains("DebugLevel=3")
def test_zabbix_include_dir(host):
zabbix_include_dir = host.file("/etc/zabbix/zabbix_proxy.conf.d")
assert zabbix_include_dir.is_directory
assert zabbix_include_dir.user == "zabbix"
assert zabbix_include_dir.group == "zabbix"
# assert zabbix_include_dir.mode == 0o644
def test_zabbix_proxy_logfile(host):
zabbix_logfile = host.file("/var/log/zabbix/zabbix_proxy.log")
assert not zabbix_logfile.contains("Access denied for user")
assert not zabbix_logfile.contains("database is down: reconnecting")
assert zabbix_logfile.contains("current database version")
assert zabbix_logfile.contains(r"proxy #0 started \[main process\]")

View File

@@ -0,0 +1,5 @@
---
- hosts: all
become: true
roles:
- role: zabbix_server

View File

@@ -0,0 +1,25 @@
---
- name: Destroy
hosts: localhost
connection: local
gather_facts: false
no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
vars:
molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
molecule_yml: "{{ lookup('file', molecule_file) | from_yaml }}"
tasks:
- name: Destroy molecule instance(s)
docker_container:
name: "{{ item.name }}"
state: absent
force_kill: "{{ item.force_kill | default(True) }}"
with_items: "{{ molecule_yml.platforms }}"
- name: Destroy 3rd party instance(s)
docker_container:
name: '{{ item }}'
state: absent
force_kill: true
with_items:
- mysql-host
- postgresql-host

View File

@@ -0,0 +1,52 @@
---
driver:
name: docker
platforms:
- name: zabbix-server-${MY_MOLECULE_CONTAINER:-mysql-centos}
image: ${MY_MOLECULE_IMAGE:-"geerlingguy/docker-centos8-ansible"}
command: ${MY_MOLECULE_DOCKER_COMMAND:-""}
privileged: true
pre_build_image: true
networks:
- name: zabbix
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
groups:
- ${MY_MOLECULE_GROUP:-mysql}
provisioner:
name: ansible
lint:
name: ansible-lint
env:
ANSIBLE_COLLECTIONS_PATHS: $HOME/.ansible/collections/ansible_collections/community/zabbix
ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles
inventory:
group_vars:
mysql:
zabbix_server_database: mysql
zabbix_server_database_long: mysql
zabbix_server_dbport: 3306
zabbix_server_dbhost: mysql-host
zabbix_server_dbhost_run_install: false
zabbix_server_privileged_host: '%'
zabbix_server_mysql_login_host: mysql-host
zabbix_server_mysql_login_user: root
zabbix_server_mysql_login_password: changeme
zabbix_server_mysql_login_port: 3306
postgresql:
zabbix_server_database: pgsql
zabbix_server_database_long: postgresql
zabbix_server_dbport: 5432
zabbix_server_dbhost: postgresql-host
zabbix_server_dbhost_run_install: false
zabbix_server_pgsql_login_host: postgresql-host
zabbix_server_pgsql_login_user: postgres
zabbix_server_pgsql_login_password: changeme
zabbix_server_pgsql_login_port: 5432
verifier:
name: testinfra
lint:
name: flake8

View File

@@ -0,0 +1,116 @@
---
- name: Prepare
hosts: localhost
connection: local
pre_tasks:
- name: "Create MySQL Container"
docker_container:
name: mysql-host
image: mysql:8.0
state: started
recreate: true
networks:
- name: zabbix
env:
MYSQL_ROOT_PASSWORD: changeme
no_log: true
with_items: "{{ molecule_yml.platforms }}"
when:
- '"mysql" in item.groups'
- name: "Create postgresql Container"
docker_container:
name: postgresql-host
image: postgres:13
state: started
recreate: true
networks:
- name: zabbix
env:
POSTGRES_PASSWORD: changeme
no_log: true
with_items: "{{ molecule_yml.platforms }}"
when:
- '"postgresql" in item.groups'
- name: Prepare
hosts: all
tasks:
- name: "Create group for imaginary host"
add_host:
name: imaginary-host
groups:
- mysql
- postgresql
changed_when: false
- name: "Installing packages on CentOS"
yum:
name:
- net-tools
- which
- sudo
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family == 'RedHat'
- name: "Installing packages on CentOS"
yum:
name:
- mysql
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family == 'RedHat'
- inventory_hostname in groups['mysql']
- name: "Apt update"
shell: "apt-get update && echo exit 0 > /usr/sbin/policy-rc.d"
args:
warn: false
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- name: "Installing packages on NON-CentOS"
apt:
name:
- net-tools
- apt-utils
- python3-pip
- gpg-agent
- sudo
update_cache: true
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- name: "Configure SUDO."
lineinfile:
dest: /etc/sudoers
line: "Defaults !requiretty"
state: present
- name: "Make sure the docs are installed."
lineinfile:
dest: /etc/yum.conf
line: "tsflags=nodocs"
state: absent
when:
- ansible_os_family == 'RedHat'
- name: PyMySQL
pip:
name: PyMySQL
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- inventory_hostname in groups['mysql']

View File

@@ -0,0 +1,62 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_zabbiserver_running_and_enabled(host):
zabbix = host.service("zabbix-server")
if host.system_info.distribution == "centos":
assert zabbix.is_enabled
assert zabbix.is_running
else:
assert zabbix.is_running
@pytest.mark.parametrize("server", [("zabbix-server-pgsql"), ("zabbix-server-mysql")])
def test_zabbix_package(host, server):
ansible_data = host.ansible.get_variables()
zabbixhost = ansible_data["inventory_hostname"]
zabbixhost = zabbixhost.replace("-centos", "")
zabbixhost = zabbixhost.replace("-debian", "")
zabbixhost = zabbixhost.replace("-ubuntu", "")
if zabbixhost == server:
zabbix_server = host.package(server)
if host.system_info.distribution in ["debian", "ubuntu"]:
assert zabbix_server.version.startswith("1:6.2")
elif host.system_info.distribution == "centos":
assert zabbix_server.version.startswith("6.2")
assert zabbix_server.is_installed
def test_zabbix_server_dot_conf(host):
zabbix_server_conf = host.file("/etc/zabbix/zabbix_server.conf")
assert zabbix_server_conf.user == "zabbix"
assert zabbix_server_conf.group == "zabbix"
assert zabbix_server_conf.mode == 0o640
assert zabbix_server_conf.contains("ListenPort=10051")
assert zabbix_server_conf.contains("DebugLevel=3")
def test_zabbix_include_dir(host):
zabbix_include_dir = host.file("/etc/zabbix/zabbix_server.conf.d")
assert zabbix_include_dir.is_directory
assert zabbix_include_dir.user == "zabbix"
assert zabbix_include_dir.group == "zabbix"
# assert zabbix_include_dir.mode == 0o644
def test_zabbix_server_logfile(host):
zabbix_logfile = host.file("/var/log/zabbix/zabbix_server.log")
assert not zabbix_logfile.contains("Access denied for user")
assert not zabbix_logfile.contains("database is down: reconnecting")
assert zabbix_logfile.contains("current database version")
assert zabbix_logfile.contains(r"server #0 started \[main process\]")

View File

@@ -0,0 +1,5 @@
---
- name: Converge
hosts: all
roles:
- role: zabbix_web

View File

@@ -0,0 +1,25 @@
---
- name: Destroy
hosts: localhost
connection: local
gather_facts: false
no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
vars:
molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
molecule_yml: "{{ lookup('file', molecule_file) | from_yaml }}"
tasks:
- name: Destroy molecule instance(s)
docker_container:
name: "{{ item.name }}"
state: absent
force_kill: "{{ item.force_kill | default(True) }}"
with_items: "{{ molecule_yml.platforms }}"
- name: Destroy 3rd party instance(s)
docker_container:
name: '{{ item }}'
state: absent
force_kill: true
with_items:
- mysql-host
- postgresql-host

View File

@@ -0,0 +1,95 @@
---
dependency:
name: galaxy
enabled: true
options:
ignore-certs: true
ignore-errors: true
role-file: molecule/zabbix_web/requirements.yml
driver:
name: docker
platforms:
- name: zabbix-web-${MY_MOLECULE_CONTAINER:-mysql-centos8}
image: ${MY_MOLECULE_IMAGE:-"geerlingguy/docker-centos8-ansible"}
command: ${MY_MOLECULE_DOCKER_COMMAND:-""}
privileged: true
pre_build_image: true
networks:
- name: zabbix
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
groups:
- ${MY_MOLECULE_GROUP:-mysql}
provisioner:
name: ansible
lint:
name: ansible-lint
env:
ANSIBLE_COLLECTIONS_PATHS: $HOME/.ansible/collections/ansible_collections/community/zabbix
ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles
inventory:
group_vars:
mysql:
zabbix_server_database: mysql
zabbix_server_database_long: mysql
zabbix_server_dbport: 3306
zabbix_server_dbhost: mysql-host
zabbix_server_dbhost_run_install: false
zabbix_server_privileged_host: "%"
zabbix_server_mysql_login_host: mysql-host
zabbix_server_mysql_login_user: root
zabbix_server_mysql_login_password: changeme
zabbix_server_mysql_login_port: 3306
postgresql:
zabbix_server_database: pgsql
zabbix_server_database_long: postgresql
zabbix_server_dbport: 5432
zabbix_server_dbhost: postgresql-host
zabbix_server_dbhost_run_install: false
zabbix_server_pgsql_login_host: postgresql-host
zabbix_server_pgsql_login_user: postgres
zabbix_server_pgsql_login_password: changeme
zabbix_server_pgsql_login_port: 5432
host_vars:
zabbix-web-pgsql-debian:
zabbix_websrv: apache
zabbix_php_fpm_conf_listen: false
zabbix_api_server_url: zabbix-web-pgsql-debian
zabbix_websrv_servername: zabbix-web-pgsql-debian
zabbix-web-mysql-debian:
zabbix_websrv: apache
zabbix_php_fpm_conf_listen: false
zabbix_api_server_url: zabbix-web-mysql-debian
zabbix_websrv_servername: zabbix-web-mysql-debian
zabbix-web-pgsql-centos8:
ansible_rhn_repo_disable_gpg_check: true
zabbix_websrv: apache
zabbix_php_fpm_conf_listen: false
zabbix_api_server_url: zabbix-web-pgsql-centos8
zabbix_websrv_servername: zabbix-web-pgsql-centos8
zabbix-web-mysql-centos8:
ansible_rhn_repo_disable_gpg_check: true
php_fpm_pool_user: nginx
php_fpm_pool_group: nginx
zabbix_websrv: nginx
zabbix_php_fpm_conf_listen: false
zabbix_api_server_url: zabbix-web-mysql-centos8
zabbix_websrv_servername: zabbix-web-mysql-centos8
zabbix-web-mysql-ubuntu18:
zabbix_websrv: nginx
zabbix_php_fpm_conf_listen: false
zabbix_api_server_url: zabbix-web-mysql-ubuntu18
zabbix_websrv_servername: zabbix-web-mysql-ubuntu18
php_webserver_daemon: nginx
zabbix-web-pgsql-ubuntu20:
zabbix_php_fpm_conf_listen: false
zabbix_websrv: apache
zabbix_api_server_url: zabbix-web-pgsql-ubuntu20
zabbix_websrv_servername: zabbix-web-pgsql-ubuntu20
verifier:
name: testinfra
lint:
name: flake8

View File

@@ -0,0 +1,150 @@
---
- name: Prepare
hosts: localhost
connection: local
pre_tasks:
- name: "Create MySQL Container"
docker_container:
name: mysql-host
image: mysql:8.0
state: started
recreate: true
networks:
- name: zabbix
env:
MYSQL_ROOT_PASSWORD: changeme
no_log: true
with_items: "{{ molecule_yml.platforms }}"
when:
- '"mysql" in item.groups'
- name: "Create postgresql Container"
docker_container:
name: postgresql-host
image: postgres:13
state: started
recreate: true
networks:
- name: zabbix
env:
POSTGRES_PASSWORD: changeme
no_log: true
with_items: "{{ molecule_yml.platforms }}"
when:
- '"postgresql" in item.groups'
- name: Prepare
hosts: all
pre_tasks:
- name: "Create group for imaginary host"
add_host:
name: imaginary-host
groups:
- mysql
- postgresql
changed_when: false
- name: "Installing packages on CentOS"
yum:
name:
- net-tools
- which
- curl
- sudo
- "{{ 'python3-pip' if ansible_distribution_major_version == '8' else 'python-pip' }}"
- "{{ 'python3-libselinux' if ansible_distribution_major_version == '8' else 'libselinux-python' }}"
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family == 'RedHat'
- name: "Installing packages (CentOS7)"
yum:
name:
- centos-release-scl
state: present
register: installation_dependencies
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == '7'
- name: "Installing MySQL on CentOS"
yum:
name:
- mysql
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family == 'RedHat'
- inventory_hostname in groups['mysql']
- name: "Installing packages on NON-CentOS"
apt:
name:
- net-tools
- curl
- apt-utils
- apt-transport-https
- ca-certificates
- gnupg2
- gpg-agent
- sudo
- vim
- "{{ 'python3-apt' if ansible_distribution_major_version in ['10', '11', '18', '20'] else 'python-apt' }}"
- "{{ 'python3-pip' if ansible_distribution_major_version in ['10', '11', '18', '20'] else 'python-pip' }}"
update_cache: true
state: present
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- ansible_os_family != 'RedHat'
- name: "Configure SUDO."
lineinfile:
dest: /etc/sudoers
line: "Defaults !requiretty"
state: present
- name: "Make sure the docs are installed."
lineinfile:
dest: /etc/yum.conf
line: "tsflags=nodocs"
state: absent
when:
- ansible_os_family == 'RedHat'
- name: PyMySQL
pip:
name: PyMySQL
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- inventory_hostname in groups['mysql']
- name: Enabeling PHP 7.4
command: dnf module enable php:7.4 -y
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == "8"
roles:
- role: geerlingguy.apache
when:
- zabbix_websrv == "apache"
- role: geerlingguy.nginx
when:
- zabbix_websrv == "nginx"
- role: geerlingguy.php
when:
- ansible_os_family != 'RedHat' or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == "8")
- role: zabbix_server
post_tasks:
- name: "Remove file"
file:
path: "{{ item }}"
state: absent
with_items:
- /var/www/html/index.html

View File

@@ -0,0 +1,4 @@
---
- src: geerlingguy.apache
- src: geerlingguy.nginx
- src: geerlingguy.php

View File

@@ -0,0 +1,70 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
@pytest.mark.parametrize(
"server, redhat, debian",
[
("zabbix-server-pgsql", "zabbix-web-pgsql", "zabbix-frontend-php"),
("zabbix-server-mysql", "zabbix-web-mysql", "zabbix-frontend-php"),
],
)
def test_zabbix_package(host, server, redhat, debian):
host = host.backend.get_hostname()
host = host.replace("-centos7", "")
host = host.replace("-centos8", "")
host = host.replace("-debian", "")
host = host.replace("-ubuntu", "")
if host == server:
if host.system_info.distribution in ["debian", "ubuntu"]:
zabbix_web = host.package(debian)
assert zabbix_web.version.startswith("1:6.2")
elif host.system_info.distribution == "centos":
zabbix_web = host.package(redhat)
assert zabbix_web.version.startswith("6.2")
assert zabbix_web.is_installed
def test_zabbix_web(host):
zabbix_web = host.file("/etc/zabbix/web/zabbix.conf.php")
ansible_variables = host.ansible.get_variables()
zabbix_websrv = str(ansible_variables["zabbix_websrv"])
if host.system_info.distribution in ["debian", "ubuntu"]:
assert zabbix_web.user == "www-data"
assert zabbix_web.group == "www-data"
elif host.system_info.distribution == "centos":
if zabbix_websrv == "apache":
assert zabbix_web.user == "apache"
assert zabbix_web.group == "apache"
elif zabbix_websrv == "nginx":
assert zabbix_web.user == "nginx"
assert zabbix_web.group == "nginx"
assert zabbix_web.mode == 0o640
def test_zabbix_api(host):
my_host = host.ansible.get_variables()
zabbix_api_server_url = str(my_host["zabbix_api_server_url"])
hostname = "http://" + zabbix_api_server_url + "/api_jsonrpc.php"
post_data = '{"jsonrpc": "2.0", "method": "user.login", "params": { "user": "Admin", "password": "zabbix" }, "id": 1, "auth": null}'
headers = "Content-Type: application/json-rpc"
command = (
"curl -XPOST -H '"
+ str(headers)
+ "' -d '"
+ str(post_data)
+ "' '"
+ hostname
+ "'"
)
cmd = host.run(command)
assert '"jsonrpc":"2.0","result":"' in cmd.stdout

View File

@@ -0,0 +1,59 @@
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r"""
options:
persistent_connect_timeout:
type: int
description:
- Configures, in seconds, the amount of time to wait when trying to initially
establish a persistent connection. If this value expires before the connection
to the remote device is completed, the connection will fail.
default: 30
ini:
- section: persistent_connection
key: connect_timeout
env:
- name: ANSIBLE_PERSISTENT_CONNECT_TIMEOUT
vars:
- name: ansible_connect_timeout
persistent_command_timeout:
type: int
description:
- Configures, in seconds, the amount of time to wait for a command to
return from the remote device. If this timer is exceeded before the
command returns, the connection plugin will raise an exception and
close.
default: 30
ini:
- section: persistent_connection
key: command_timeout
env:
- name: ANSIBLE_PERSISTENT_COMMAND_TIMEOUT
vars:
- name: ansible_command_timeout
persistent_log_messages:
type: boolean
description:
- This flag will enable logging the command executed and response received from
target device in the ansible log file. For this option to work 'log_path' ansible
configuration option is required to be set to a file path with write access.
- Be sure to fully understand the security implications of enabling this
option as it could create a security vulnerability by logging sensitive information in log file.
default: False
ini:
- section: persistent_connection
key: log_messages
env:
- name: ANSIBLE_PERSISTENT_LOG_MESSAGES
vars:
- name: ansible_persistent_log_messages
"""

View File

@@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard documentation fragment
DOCUMENTATION = r'''
options:
server_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.
- This option is deprecated with the move to httpapi connection and will be removed in the next release
required: false
type: str
aliases: [ url ]
login_user:
description:
- Zabbix user name.
- If not set the environment variable C(ZABBIX_USERNAME) will be used.
- This option is deprecated with the move to httpapi connection and will be removed in the next release
type: str
required: false
login_password:
description:
- Zabbix user password.
- If not set the environment variable C(ZABBIX_PASSWORD) will be used.
- This option is deprecated with the move to httpapi connection and will be removed in the next release
type: str
required: false
http_login_user:
description:
- Basic Auth login
type: str
required: false
http_login_password:
description:
- Basic Auth password
type: str
required: false
timeout:
description:
- The timeout of API request (seconds).
- This option is deprecated with the move to httpapi connection and will be removed in the next release
- The default value is C(10)
type: int
validate_certs:
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.
- This option is deprecated with the move to httpapi connection and will be removed in the next release
- The default value is C(true)
type: bool
notes:
- If you use I(login_password=zabbix), the word "zabbix" is replaced by "********" in all module output, because I(login_password) uses C(no_log).
See L(this FAQ,https://docs.ansible.com/ansible/latest/network/user_guide/faq.html#why-is-my-output-sometimes-replaced-with) for more information.
'''

View File

@@ -0,0 +1,209 @@
# (c) 2021, Markus Fischbacher (fischbacher.markus@gmail.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Quick Link to Zabbix API docs: https://www.zabbix.com/documentation/current/manual/api
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
---
name: zabbix
author:
- Markus Fischbacher (@rockaut)
- Evgeny Yurchenko (@BGmot)
short_description: HttpApi Plugin for Zabbix
description:
- This HttpApi plugin provides methods to connect to Zabbix over their HTTP(S)-based api.
version_added: 1.8.0
options:
zabbix_auth_key:
type: str
description:
- Specifies API authentication key
env:
- name: ANSIBLE_ZABBIX_AUTH_KEY
vars:
- name: ansible_zabbix_auth_key
zabbix_url_path:
type: str
description:
- Specifies path portion in Zabbix WebUI URL, e.g. for https://myzabbixfarm.com/zabbixeu zabbix_url_path=zabbixeu
default: zabbix
env:
- name: ANSIBLE_ZABBIX_URL_PATH
vars:
- name: ansible_zabbix_url_path
http_login_user:
type: str
description:
- The http user to access zabbix url with Basic Auth
vars:
- name: http_login_user
http_login_password:
type: str
description:
- The http password to access zabbix url with Basic Auth
vars:
- name: http_login_password
"""
import json
import base64
from uuid import uuid4
from ansible.module_utils.basic import to_text
from ansible.errors import AnsibleConnectionFailure
from ansible.plugins.httpapi import HttpApiBase
from ansible.module_utils.connection import ConnectionError
class HttpApi(HttpApiBase):
zbx_api_version = None
auth_key = None
url_path = '/zabbix' # By default Zabbix WebUI is on http(s)://FQDN/zabbix
def set_become(self, become_context):
"""As this is an http rpc call there is no elevation available
"""
pass
def update_auth(self, response, response_text):
return None
def login(self, username, password):
self.auth_key = self.get_option('zabbix_auth_key')
if self.auth_key:
self.connection._auth = {'auth': self.auth_key}
return
http_login_user = self.get_option('http_login_user')
if http_login_user and http_login_user != '-42':
# Provide "fake" auth so netcommon.connection does not replace our headers
self.connection._auth = {'auth': 'fake'}
payload = self.payload_builder("user.login", user=username, password=password)
code, response = self.send_request(data=payload)
if code == 200 and response != '':
# Replace auth with real api_key we got from Zabbix after successful login
self.connection._auth = {'auth': response}
def logout(self):
if self.connection._auth and not self.auth_key:
payload = self.payload_builder("user.logout")
self.send_request(data=payload)
def api_version(self):
url_path = self.get_option('zabbix_url_path')
if isinstance(url_path, str):
# zabbix_url_path provided (even if it is an empty string)
if url_path == '':
self.url_path = ''
else:
self.url_path = '/' + url_path
if not self.zbx_api_version:
if not hasattr(self.connection, 'zbx_api_version'):
code, version = self.send_request(data=self.payload_builder('apiinfo.version'))
if code == 200 and version != '':
self.connection.zbx_api_version = version
self.zbx_api_version = self.connection.zbx_api_version
return self.zbx_api_version
def send_request(self, data=None, request_method="POST", path="/api_jsonrpc.php"):
path = self.url_path + path
if not data:
data = {}
if self.connection._auth:
data['auth'] = self.connection._auth['auth']
hdrs = {
'Content-Type': 'application/json-rpc',
'Accept': 'application/json',
}
http_login_user = self.get_option('http_login_user')
http_login_password = self.get_option('http_login_password')
if http_login_user and http_login_user != '-42':
# Need to add Basic auth header
credentials = (http_login_user + ':' + http_login_password).encode('ascii')
hdrs['Authorization'] = 'Basic ' + base64.b64encode(credentials).decode("ascii")
if data['method'] in ['user.login', 'apiinfo.version']:
# user.login and apiinfo.version do not need "auth" in data
# we provided fake one in login() method to correctly handle HTTP basic auth header
data.pop('auth', None)
data = json.dumps(data)
try:
self._display_request(request_method, path)
response, response_data = self.connection.send(
path,
data,
method=request_method,
headers=hdrs
)
value = to_text(response_data.getvalue())
try:
json_data = json.loads(value) if value else {}
if "result" in json_data:
json_data = json_data["result"]
# JSONDecodeError only available on Python 3.5+
except ValueError:
raise ConnectionError("Invalid JSON response: %s" % value)
try:
# Some methods return bool not a dict in "result"
iter(json_data)
except TypeError:
# Do not try to find "error" if it is not a dict
return response.getcode(), json_data
if "error" in json_data:
raise ConnectionError("REST API returned %s when sending %s" % (json_data["error"], data))
return response.getcode(), json_data
except AnsibleConnectionFailure as e:
self.connection.queue_message("vvv", "AnsibleConnectionFailure: %s" % e)
if to_text("Could not connect to") in to_text(e):
raise
if to_text("401") in to_text(e):
return 401, "Authentication failure"
else:
return 404, "Object not found"
except Exception as e:
raise e
def _display_request(self, request_method, path):
self.connection.queue_message(
"vvvv",
"Web Services: %s %s/%s" % (request_method, self.connection._url, path),
)
def _get_response_value(self, response_data):
return to_text(response_data.getvalue())
def _response_to_json(self, response_text):
try:
return json.loads(response_text) if response_text else {}
# JSONDecodeError only available on Python 3.5+
except ValueError:
raise ConnectionError("Invalid JSON response: %s" % response_text)
@staticmethod
def payload_builder(method_, auth_=None, **kwargs):
reqid = str(uuid4())
req = {'jsonrpc': '2.0', 'method': method_, 'id': reqid}
req['params'] = (kwargs)
return req
def handle_httperror(self, exc):
# The method defined in ansible.plugins.httpapi
# We need to override it to avoid endless re-tries if HTTP authentication fails
if exc.code == 401:
return False
return exc

View File

@@ -0,0 +1,387 @@
#
# Copyright: (c), Ansible Project
#
# (c) 2013, Greg Buehler
# (c) 2018, Filippo Ferrazini
# (c) 2021, Timothy Test
# Modified from ServiceNow Inventory Plugin and Zabbix inventory Script
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
name: zabbix_inventory
author:
- Timothy Test (@ttestscripting)
short_description: Zabbix Inventory Plugin
version_added: 1.4.0
description:
- Zabbix Inventory plugin
- All vars from zabbix are prefixed with zbx_
requirements:
- "python >= 2.6"
- "zabbix-api >= 0.5.4"
options:
server_url:
description:
- URL of Zabbix server, with protocol (http or https).
C(url) is an alias for C(server_url).
required: true
type: str
aliases: [ url ]
env:
- name: ZABBIX_SERVER
proxy:
description: Proxy server to use for reaching zabbix API
type: string
default: ''
host_zapi_query:
description:
- API query for hosts - see zabbix documentation for more details U(https://www.zabbix.com/documentation/current/manual/api/reference/host/get)
type: dict
default: {}
suboptions:
selectApplications:
type: str
description:
- query
- Return an applications property with host applications.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/application/object) for more details on field names
selectDiscoveries:
type: str
description:
- query
- Return a discoveries property with host low-level discovery rules.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/discoveryrule/object) for more details on field names
selectDiscoveryRule:
type: str
description:
- query
- Return a discoveryRule property with the low-level discovery rule that created the host (from host prototype in VMware monitoring).
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- please see U(https://www.zabbix.com/documentation/current/manual/api/reference/discoveryrule/object) for more details on field names
selectGraphs:
type: str
description:
- query
- Return a discoveries property with host low-level discovery rules.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/graph/object) for more details on field names
selectGroups:
type: str
description:
- query
- Return a groups property with host groups data that the host belongs to.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/hostgroup/object) for more details on field names
selectHostDiscovery:
type: str
description:
- query
- Return a hostDiscovery property with host discovery object data.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/host/get) for more details on field names
selectHttpTests:
type: str
description:
- query
- Return an httpTests property with host web scenarios.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/httptest/object) for more details on field names
selectInterfaces:
type: str
description:
- query
- Return an interfaces property with host interfaces.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/hostinterface/object) for more details on field names
selectInventory:
type: str
description:
- query
- Return an inventory property with host inventory data.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/host/object#host_inventory) for more details on field names
selectItems:
type: str
description:
- query
- Return an items property with host items.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/item/object) for more details on field names
selectMacros:
type: str
description:
- query
- Return a macros property with host macros.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/usermacro/object) for more details on field names
selectParentTemplates:
type: str
description:
- query
- Return a parentTemplates property with templates that the host is linked to
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/template/object) for more details on field names
selectDashboards:
type: str
description:
- query
- Return a dashboards property.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/templatedashboard/object) for more details on field names
selectTags:
type: str
description:
- query
- Return a tags property with host tags.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/host/object#host_tag) for more details on field names
selectInheritedTags:
type: str
description:
- query
- Return an inheritedTags property with tags that are on all templates which are linked to host.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/host/object#host_tag) for more details on field names
selectTriggers:
type: str
description:
- query
- Return a triggers property with host triggers.
- To return all values specify 'extend'
- Can be limited to different fields for example setting the vaule to ['name'] will only return the name
- Additional fields can be specified by comma seperated value ['name', 'field2']
- Please see U(https://www.zabbix.com/documentation/current/manual/api/reference/host/object#host_tag) for more details on field names
login_user:
description:
- Zabbix user name.
type: str
required: true
env:
- name: ZABBIX_USERNAME
login_password:
description:
- Zabbix user password.
type: str
required: true
env:
- name: ZABBIX_PASSWORD
http_login_user:
description:
- Basic Auth login
type: str
http_login_password:
description:
- Basic Auth password
type: str
timeout:
description:
- The timeout of API request (seconds).
type: int
default: 10
validate_certs:
description:
- If set to False, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
type: bool
default: true
env:
- name: ZABBIX_VALIDATE_CERTS
add_zabbix_groups:
description:
- If set to True, hosts will be added to groups based on their zabbix groups
type: bool
default: false
extends_documentation_fragment:
- constructed
- inventory_cache
'''
EXAMPLES = r'''
# Simple Inventory Plugin example
# This will create an inventory with details from zabbix such as applications name, applicaitonids, Parent Template Name, and group membership name
#It will also create 2 ansible inventory groups for enabled and disabled hosts in zabbix based on the status field.
plugin: community.zabbix.zabbix_inventory
server_url: https://zabbix.com
login_user: Admin
login_password: password
host_zapi_query:
selectApplications: ['name', 'applicationid']
selectParentTemplates: ['name']
selectGroups: ['name']
validate_certs: false
groups:
enabled: zbx_status == "0"
disabled: zbx_status == "1"
#Using Keyed Groups
plugin: community.zabbix.zabbix_inventory
server_url: https://zabbix.com
login_user: Admin
login_password: password
validate_certs: false
keyed_groups:
- key: zbx_status | lower
prefix: 'env'
- key: zbx_description | lower
prefix: 'test'
separator: ''
#Using proxy format of proxy is 'http://<user>:<pass>@<proxy>:<port>' or 'http://<proxy>:<port>'
plugin: community.zabbix.zabbix_inventory
server_url: https://zabbix.com
proxy: http://someproxy:8080
login_user: Admin
login_password: password
validate_certs: false
#Organize inventory groups based on zabbix host groups
plugin: community.zabbix.zabbix_inventory
server_url: https://zabbix.com
add_zabbix_groups: true
login_user: Admin
login_password: password
validate_certs: false
#Using compose to modify vars
plugin: community.zabbix.zabbix_inventory
server_url: https://zabbix.com
login_user: Admin
login_password: password
validate_certs: false
compose:
zbx_testvar: zbx_status.replace("1", "Disabled")
'''
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable, to_safe_group_name
import os
import atexit
import traceback
try:
from zabbix_api import ZabbixAPI
HAS_ZABBIX_API = True
except ImportError:
ZBX_IMP_ERR = traceback.format_exc()
HAS_ZABBIX_API = False
class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
NAME = 'community.zabbix.zabbix_inventory'
def login_zabbix(self):
# set proxy information if required
proxy = self.get_option('proxy')
os.environ['http_proxy'] = proxy
os.environ['HTTP_PROXY'] = proxy
os.environ['https_proxy'] = proxy
os.environ['HTTPS_PROXY'] = proxy
server_url = self.get_option('server_url')
http_login_user = self.get_option('login_user')
http_login_password = self.get_option('login_password')
validate_certs = self.get_option('validate_certs')
timeout = self.get_option('timeout')
self._zapi = ZabbixAPI(server_url, timeout=timeout, user=http_login_user, passwd=http_login_password, validate_certs=validate_certs)
self.login()
self._zbx_api_version = self._zapi.api_version()[:5]
def login(self):
# check if api already logged in
if not self._zapi.auth != '':
try:
login_user = self.get_option('login_user')
login_password = self.get_option('login_password')
self._zapi.login(login_user, login_password)
atexit.register(self._zapi.logout)
except Exception as e:
self.display.vvv(msg="Failed to connect to Zabbix server: %s" % e)
def verify_file(self, path):
valid = False
if super(InventoryModule, self).verify_file(path):
if path.endswith(('zabbix_inventory.yaml', 'zabbix_inventory.yml')):
valid = True
else:
self.display.vvv(
'Skipping due to inventory source not ending in "zabbix_inventory.yaml" nor "zabbix_inventory.yml"')
return valid
def parse(self, inventory, loader, path,
cache=True): # Plugin interface (2)
super(InventoryModule, self).parse(inventory, loader, path)
self._read_config_data(path)
self.cache_key = self.get_cache_key(path)
self.use_cache = self.get_option('cache') and cache
self.update_cache = self.get_option('cache') and not cache
self.login_zabbix()
zapi_query = self.get_option('host_zapi_query')
content = self._zapi.host.get(zapi_query)
strict = self.get_option('strict')
for record in content:
# add host to inventory
host_name = self.inventory.add_host(record['host'])
# set variables for host
for k in record.keys():
self.inventory.set_variable(host_name, 'zbx_%s' % k, record[k])
# added for compose vars and keyed groups
self._set_composite_vars(
self.get_option('compose'),
self.inventory.get_host(host_name).get_vars(), host_name, strict)
self._add_host_to_composed_groups(self.get_option('groups'), dict(), host_name, strict)
self._add_host_to_keyed_groups(self.get_option('keyed_groups'), dict(), host_name, strict)
# organize inventory by zabbix groups
if self.get_option('add_zabbix_groups'):
content = self._zapi.host.get({'selectGroups': ['name']})
for record in content:
host_name = record['host']
if len(record['groups']) >= 1:
for group in record['groups']:
group_name = to_safe_group_name(group['name'])
self.inventory.add_group(group_name)
self.inventory.add_child(group_name, host_name)

Some files were not shown because too many files have changed in this diff Show More