diff --git a/.github/workflows/proxy.yml b/.github/workflows/proxy.yml index c13634afc..1234b0724 100644 --- a/.github/workflows/proxy.yml +++ b/.github/workflows/proxy.yml @@ -19,38 +19,32 @@ jobs: strategy: fail-fast: false matrix: - molecule_distro: - - container: mysql-centos - image: geerlingguy/docker-rockylinux8-ansible:latest - group: mysql - - container: pgsql-centos - image: geerlingguy/docker-rockylinux8-ansible:latest - group: postgresql - - container: sqlite-centos - image: geerlingguy/docker-rockylinux8-ansible:latest - group: sqlite3 - - container: mysql-ubuntu - image: geerlingguy/docker-ubuntu2004-ansible - group: mysql - - container: pgsql-ubuntu - image: geerlingguy/docker-ubuntu2004-ansible - group: postgresql - command: /sbin/init - - container: sqlite-ubuntu - image: geerlingguy/docker-ubuntu2004-ansible - group: sqlite3 - command: /sbin/init - - container: mysql-debian - image: geerlingguy/docker-debian11-ansible - group: mysql - - container: pgsql-debian - image: geerlingguy/docker-debian11-ansible - group: postgresql - - container: sqlite-debian - image: geerlingguy/docker-debian11-ansible - group: sqlite3 + container: + - rockylinux9 + - rockylinux8 + - centos7 + - ubuntu2204 + - ubuntu2004 + - ubuntu1804 + - debian11 + - debian10 collection_role: - zabbix_proxy + database: + - mysql + - pgsql + - sqlite3 + version: + - v62 + - v60 + - v50 + include: + - interpreter: python3 + - interpreter: python + container: centos7 + exclude: + - container: rockylinux9 + version: v50 steps: - name: Check out code uses: actions/checkout@v1 @@ -75,8 +69,10 @@ jobs: - name: Run role tests run: >- - MY_MOLECULE_CONTAINER=${{ matrix.molecule_distro.container }} - MY_MOLECULE_IMAGE=${{ matrix.molecule_distro.image }} - MY_MOLECULE_GROUP=${{ matrix.molecule_distro.group }} - MY_MOLECULE_DOCKER_COMMAND=${{ matrix.molecule_distro.command }} + MY_MOLECULE_CONTAINER=${{ matrix.container }} + MY_MOLECULE_IMAGE=${{ matrix.container }} + MY_MOLECULE_VERSION=${{ matrix.version }} + MY_MOLECULE_DATABASE=${{ matrix.database }} + MY_MOLECULE_INTERPRETER=${{ matrix.interpreter }} + MY_MOLECULE_DOCKER_COMMAND=${{ matrix.command }} molecule test -s ${{ matrix.collection_role }} diff --git a/molecule/zabbix_proxy/molecule.yml b/molecule/zabbix_proxy/molecule.yml index f50e368ba..183cb09e4 100644 --- a/molecule/zabbix_proxy/molecule.yml +++ b/molecule/zabbix_proxy/molecule.yml @@ -1,19 +1,19 @@ --- - 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:-""} + - name: zabbix-proxy-${MY_MOLECULE_CONTAINER:-centos} + image: geerlingguy/docker-${MY_MOLECULE_IMAGE:-"centos8"}-ansible:latest privileged: true pre_build_image: true + command: ${MOLECULE_DOCKER_COMMAND:-""} networks: - name: zabbix volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro groups: - - ${MY_MOLECULE_GROUP:-mysql} + - ${MY_MOLECULE_DATABASE:-mysql} + - ${MY_MOLECULE_VERSION:-v62} provisioner: name: ansible @@ -24,22 +24,31 @@ provisioner: ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles inventory: group_vars: - all: + python3: ansible_python_interpreter: /usr/bin/python3 + python: + ansible_python_interpreter: /usr/bin/python + v62: + zabbix_proxy_version: 6.2 + v60: + zabbix_proxy_version: 6.0 + v50: + zabbix_proxy_version: 5.0 mysql: + zabbix_proxy_dbname: zabbix + zabbix_proxy_dbuser: zabbix-dbuser 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_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_install_database_client: false + pgsql: zabbix_proxy_database: pgsql - zabbix_proxy_database_long: postgresql zabbix_proxy_dbport: 5432 zabbix_proxy_dbhost: postgresql-host zabbix_proxy_dbhost_run_install: false @@ -51,7 +60,6 @@ provisioner: zabbix_proxy_database: sqlite3 zabbix_proxy_database_long: sqlite3 zabbix_proxy_dbname: /path/to/sqlite3.db - verifier: name: testinfra lint: diff --git a/molecule/zabbix_proxy/prepare.yml b/molecule/zabbix_proxy/prepare.yml index 0fc4ef320..442a5fc58 100644 --- a/molecule/zabbix_proxy/prepare.yml +++ b/molecule/zabbix_proxy/prepare.yml @@ -3,7 +3,6 @@ hosts: localhost connection: local pre_tasks: - - name: "Create MySQL Container" docker_container: name: mysql-host @@ -32,12 +31,11 @@ no_log: true with_items: "{{ molecule_yml.platforms }}" when: - - '"postgresql" in item.groups' + - '"pgsql" 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 %}" @@ -62,17 +60,6 @@ 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: Check if warn parameter can be used for shell module set_fact: produce_warn: False @@ -121,7 +108,7 @@ lineinfile: path: /etc/dpkg/dpkg.cfg.d/excludes state: absent - regexp: 'path-exclude=/usr/share/doc/*' + regexp: "path-exclude=/usr/share/doc/*" when: - ansible_os_family != 'RedHat' @@ -132,3 +119,48 @@ until: installation_dependencies is succeeded when: - inventory_hostname in groups['mysql'] + + - name: Install MariaDB (RHEL) + block: + - name: Add MariaDB Repo + ansible.builtin.yum_repository: + name: mariadb + description: MariaDB 10.8 CentOS repository list + file: mariadb + baseurl: "https://mirror.rackspace.com/mariadb/yum/10.8/centos{{ ansible_distribution_major_version }}-amd64" + gpgcheck: no + when: ansible_distribution_major_version <= '8' + + - name: Install MariaDB Client + yum: + name: + - "{{ 'mariadb' if ansible_distribution_major_version >= '8' else 'MariaDB-client' }}" + - "{{ 'python3-PyMySQL' if ansible_distribution_major_version >= '8' else 'MySQL-python' }}" + when: + - ansible_os_family == 'RedHat' + - zabbix_proxy_database == 'mysql' + + - name: Install MariaDB (Debian) + block: + - name: Add an Apt signing key, uses whichever key is at the URL + ansible.builtin.apt_key: + url: https://mariadb.org/mariadb_release_signing_key.asc + state: present + + - name: Add specified repository into sources list + ansible.builtin.apt_repository: + repo: "deb https://mirror.rackspace.com/mariadb/repo/10.8/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main" + state: present + validate_certs: false + + - name: Install MariaDB Client + ansible.builtin.apt: + name: + - mariadb-client + - "{{ zabbix_python_prefix }}-mysqldb" + state: present + update_cache: true + allow_unauthenticated: true + when: + - ansible_os_family == 'Debian' + - zabbix_proxy_database == 'mysql' diff --git a/molecule/zabbix_proxy/tests/test_default.py b/molecule/zabbix_proxy/tests/test_default.py index d0a15307a..84eb616f6 100644 --- a/molecule/zabbix_proxy/tests/test_default.py +++ b/molecule/zabbix_proxy/tests/test_default.py @@ -38,9 +38,19 @@ def test_zabbix_package(host, proxy): 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" + found = False + for file_name in [ + "/etc/zabbix/zabbix_proxy.conf", + "/etc/zabbix_proxy.conf", + ]: + if host.file(file_name).exists: + found = True + break + + assert found + zabbix_proxy_conf = host.file(file_name) + assert zabbix_proxy_conf.user in ["zabbix", "zabbixsrv"] + assert zabbix_proxy_conf.group in ["zabbix", "zabbixsrv"] assert zabbix_proxy_conf.mode == 0o644 assert zabbix_proxy_conf.contains("ListenPort=10051") @@ -50,14 +60,24 @@ def test_zabbix_proxy_dot_conf(host): 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.user in ["zabbix", "zabbixsrv"] + assert zabbix_include_dir.group in ["zabbix", "zabbixsrv"] # assert zabbix_include_dir.mode == 0o644 def test_zabbix_proxy_logfile(host): - zabbix_logfile = host.file("/var/log/zabbix/zabbix_proxy.log") - + found = False + for file_name in [ + "/var/log/zabbix/zabbix_proxy.log", + "/var/log/zabbixsrv/zabbix_proxy.log", + ]: + if host.file(file_name).exists: + found = True + break + + assert found + + zabbix_logfile = host.file(file_name) 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") diff --git a/roles/zabbix_proxy/defaults/main.yml b/roles/zabbix_proxy/defaults/main.yml index c88e22980..0ceccfbce 100644 --- a/roles/zabbix_proxy/defaults/main.yml +++ b/roles/zabbix_proxy/defaults/main.yml @@ -1,21 +1,14 @@ --- # defaults file for zabbix_proxy - -# zabbix_proxy_version: 6.0 +zabbix_os_user: zabbix +zabbix_proxy_config: /etc/zabbix/zabbix_proxy.conf +zabbix_proxy_version: zabbix_proxy_version_minor: "*" -zabbix_version: "{{ zabbix_proxy_version }}" zabbix_selinux: false -# These variables are optional. They specify the version of Zabbix proxy package. - -# zabbix_proxy_rhel_version: 4.4.4 -# zabbix_proxy_debian_version: 1:4.4.4-1+stretch -# zabbix_proxy_ubuntu_version: 1:4.4.4-1+xenial - zabbix_repo: zabbix zabbix_proxy_apt_priority: zabbix_proxy_package_state: present -zabbix_proxy_install_recommends: true zabbix_proxy_install_database_client: true zabbix_install_pip_packages: true zabbix_repo_yum_schema: https @@ -26,7 +19,7 @@ zabbix_repo_yum_enabled: [] zabbix_repo_yum: - name: zabbix description: Zabbix Official Repository - $basearch - baseurl: "{{ zabbix_repo_yum_schema }}://repo.zabbix.com/zabbix/{{ zabbix_version | regex_search('^[0-9]+.[0-9]+') }}/rhel/{{ ansible_distribution_major_version }}/$basearch/" + baseurl: "{{ zabbix_repo_yum_schema }}://repo.zabbix.com/zabbix/{{ zabbix_proxy_version | regex_search('^[0-9]+.[0-9]+') }}/rhel/{{ ansible_distribution_major_version }}/$basearch/" gpgcheck: "{{ zabbix_repo_yum_gpgcheck }}" mode: "0644" gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX @@ -43,10 +36,8 @@ zabbix_repo_yum: zabbix_proxy_username: zabbix zabbix_proxy_groupname: zabbix -zabbix_server_host: 192.168.1.1 # Will be deprecated in 2.0.0 -zabbix_proxy_server: "{{ zabbix_server_host }}" -zabbix_server_port: 10051 # Will be deprecated in 2.0.0 -zabbix_proxy_serverport: "{{ zabbix_server_port }}" +zabbix_proxy_server: 192.168.1.1 +zabbix_proxy_serverport: 10051 zabbix_database_creation: true zabbix_database_sqlload: true zabbix_proxy_dbtlsconnect: @@ -59,11 +50,8 @@ zabbix_proxy_allowunsupporteddbversions: 0 # Some role specific vars zabbix_proxy_database: mysql -zabbix_proxy_database_long: mysql # zabbix_proxy_database: pgsql -# zabbix_proxy_database_long: postgresql # zabbix_proxy_database: sqlite3 -# zabbix_proxy_database_long: sqlite3 # zabbix-proxy specific vars zabbix_proxy_mode: 0 @@ -86,14 +74,11 @@ zabbix_proxy_dbuser: zabbix_proxy zabbix_proxy_dbpassword: zabbix_proxy zabbix_proxy_dbsocket: zabbix_proxy_dbport: 5432 -zabbix_proxy_dbpassword_hash_method: md5 zabbix_proxy_startodbcpollers: 1 zabbix_proxy_dbhost_run_install: true zabbix_proxy_privileged_host: localhost -zabbix_proxy_localbuffer: 0 # Will be deprecated in 2.0.0 -zabbix_proxy_proxylocalbuffer: "{{ zabbix_proxy_localbuffer }}" -zabbix_proxy_offlinebuffer: 1 # Will be deprecated in 2.0.0 -zabbix_proxy_proxyofflinebuffer: "{{ zabbix_proxy_offlinebuffer }}" +zabbix_proxy_proxylocalbuffer: 0 +zabbix_proxy_proxyofflinebuffer: 1 zabbix_proxy_heartbeatfrequency: 60 zabbix_proxy_configfrequency: 3600 zabbix_proxy_datasenderfrequency: 1 @@ -107,19 +92,19 @@ zabbix_proxy_starthttppollers: 1 zabbix_proxy_startpreprocessors: 3 zabbix_proxy_javagateway: zabbix_proxy_javagatewayport: 10052 -zabbix_proxy_startjavapollers: 5 +zabbix_proxy_startjavapollers: zabbix_proxy_startvmwarecollector: 0 zabbix_proxy_vmwarefrequency: 60 -zabbix_proxy_vmwarecachesize: 8 +zabbix_proxy_vmwarecachesize: 8M zabbix_proxy_snmptrapperfile: /tmp/zabbix_traps.tmp zabbix_proxy_snmptrapper: 0 zabbix_proxy_listenip: zabbix_proxy_housekeepingfrequency: 1 -zabbix_proxy_cachesize: 8 +zabbix_proxy_cachesize: 8M zabbix_proxy_startdbsyncers: 4 -zabbix_proxy_historycachesize: 8 -zabbix_proxy_historyindexcachesize: 4 -zabbix_proxy_historytextcachesize: 16 +zabbix_proxy_historycachesize: 8M +zabbix_proxy_historyindexcachesize: 4M +zabbix_proxy_historytextcachesize: 16M zabbix_proxy_timeout: 3 zabbix_proxy_trappertimeout: 300 zabbix_proxy_unreachableperiod: 45 @@ -150,7 +135,6 @@ zabbix_proxy_tlscafile: zabbix_proxy_tlscrlfile: zabbix_proxy_tlsservercertissuer: zabbix_proxy_tlsservercertsubject: -zabbix_proxy_tls_subject: "{{ zabbix_proxy_tlsservercertsubject }}" # FIXME this is not correct and should be removed with 2.0.0, here only to prevent regression zabbix_proxy_tlscertfile: zabbix_proxy_tlskeyfile: zabbix_proxy_tlspskidentity: @@ -161,31 +145,15 @@ zabbix_proxy_tls_config: cert: "certificate" # Zabbix API stuff -zabbix_validate_certs: true # Will be deprecated in 2.0.0 -zabbix_api_validate_certs: "{{ zabbix_validate_certs }}" -zabbix_url: http://localhost # Will be deprecated in 2.0.0 -zabbix_api_server_url: "{{ zabbix_url }}" -zabbix_api_server_host: "{{ zabbix_api_server_url | urlsplit('hostname') }}" -zabbix_api_port_from_url: "{{ zabbix_api_server_port | default(zabbix_api_server_url | urlsplit('port')) }}" -zabbix_api_scheme_from_url: "{{ zabbix_api_server_url | urlsplit('scheme') }}" -zabbix_api_port_from_shema: "{{ (zabbix_api_scheme_from_url == 'https') | ternary(443, 80) }}" -# zabbix_http_user: admin # Will be deprecated in 2.0.0 -# zabbix_http_password: admin # Will be deprecated in 2.0.0 -# zabbix_api_http_user: admin -# zabbix_api_http_password: admin -zabbix_api_user: Admin # Will be deprecated in 2.0.0 -zabbix_api_pass: !unsafe zabbix # Will be deprecated in 2.0.0 +zabbix_api_validate_certs: true +zabbix_api_server_url: http://localhost +zabbix_api_http_user: admin +zabbix_api_http_password: admin zabbix_api_login_user: "{{ zabbix_api_user }}" zabbix_api_login_pass: "{{ zabbix_api_pass }}" -ansible_httpapi_pass: "{{ zabbix_api_login_pass }}" -ansible_network_os: community.zabbix.zabbix -ansible_httpapi_port: "{{ (zabbix_api_port_from_url == '') | ternary(zabbix_api_port_from_shema, zabbix_api_port_from_url) }}" -ansible_httpapi_use_ssl: "{{ zabbix_api_use_ssl | default((zabbix_api_scheme_from_url == 'https') | ternary(true, false)) }}" -ansible_httpapi_validate_certs: "{{ zabbix_api_validate_certs }}" zabbix_api_create_proxy: false zabbix_api_timeout: 30 -zabbix_create_proxy: present # or absent # Will be deprecated in 2.0.0 -zabbix_proxy_state: "{{ zabbix_create_proxy }}" +zabbix_proxy_state: present zabbix_proxy_status: active # or passive zabbix_useuip: 1 @@ -195,3 +163,5 @@ zabbix_proxy_interface: ip: "{{ zabbix_proxy_ip }}" dns: "{{ ansible_fqdn }}" port: "{{ zabbix_proxy_listenport }}" + +zabbix_proxy_cat_cmd: cat diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml index fae6b5b96..933600bc6 100644 --- a/roles/zabbix_proxy/tasks/Debian.yml +++ b/roles/zabbix_proxy/tasks/Debian.yml @@ -1,59 +1,19 @@ --- -- name: "Include Zabbix gpg ids" +- name: "Debian | Include Zabbix gpg ids" include_vars: zabbix.yml -- name: "Set some variables" +- name: "Debian | Set short version name" set_fact: - zabbix_short_version: "{{ zabbix_version | regex_replace('\\.', '') }}" - zabbix_proxy_apt_repository: - - "http://repo.zabbix.com/zabbix/{{ zabbix_version }}/{{ ansible_distribution.lower() }}/" - - "{{ ansible_distribution_release }}" - - "main" - zabbix_underscore_version: "{{ zabbix_version | regex_replace('\\.', '_') }}" + zabbix_short_version: "{{ zabbix_proxy_version | regex_replace('\\.', '') }}" zabbix_python_prefix: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}" - when: - - ansible_machine != "aarch64" - -- name: "Set some variables" - set_fact: - zabbix_short_version: "{{ zabbix_version | regex_replace('\\.', '') }}" - zabbix_proxy_apt_repository: - - "http://repo.zabbix.com/zabbix/{{ zabbix_version }}/{{ ansible_distribution.lower() }}-arm64/" - - "{{ ansible_distribution_release }}" - - "main" - zabbix_underscore_version: "{{ zabbix_version | regex_replace('\\.', '_') }}" - zabbix_python_prefix: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}" - when: - - ansible_machine == "aarch64" + zabbix_underscore_version: "{{ zabbix_proxy_version | regex_replace('\\.', '_') }}" -- name: "Debian | Set some facts" - set_fact: - apache_log: apache2 - datafiles_path: "/usr/share/zabbix-proxy-{{ zabbix_proxy_database }}" - when: - - zabbix_version is version_compare('3.0', '<') - tags: - - zabbix-proxy - - init - - config - -- name: "Debian | Set some facts for Zabbix >= 3.0 && < 5.4" +- name: "Debian | Set some facts for Zabbix < 6.0" set_fact: apache_log: apache2 datafiles_path: /usr/share/doc/zabbix-proxy-{{ zabbix_proxy_database }} when: - - zabbix_version is version('3.0', '>=') - - zabbix_version is version('5.4', '<') - tags: - - zabbix-proxy - - init - - config - -- name: "Debian | Set some facts for Zabbix == 5.4" - set_fact: - datafiles_path: /usr/share/doc/zabbix-sql-scripts/{{ zabbix_proxy_database_long }} - when: - - zabbix_version is version('5.4', '==') + - zabbix_proxy_version is version('6.0', '<') tags: - zabbix-proxy - init @@ -61,11 +21,11 @@ - name: "Debian | Set some facts for Zabbix >= 6.0" set_fact: - datafiles_path: /usr/share/zabbix-sql-scripts/{{ zabbix_proxy_database_long }} + datafiles_path: /usr/share/doc/zabbix-sql-scripts/{{ zabbix_proxy_db_long }} when: - - zabbix_version is version('6.0', '>=') + - zabbix_proxy_version is version('6.0', '>=') tags: - - zabbix-proxy + - zabbix-server - init - config @@ -98,7 +58,7 @@ - name: "Debian | Installing repository {{ ansible_distribution }}" apt_repository: - repo: "{{ item }} {{ zabbix_proxy_apt_repository | join(' ') }}" + repo: "{{ item }} http://repo.zabbix.com/zabbix/{{ zabbix_proxy_version }}/{{ ansible_distribution.lower() }}/ {{ ansible_distribution_release }} main" state: present when: zabbix_repo == "zabbix" become: true @@ -108,16 +68,16 @@ tags: - zabbix-proxy - init - + - name: "Debian | Create /etc/apt/preferences.d/" file: path: /etc/apt/preferences.d/ state: directory - mode: '0755' + mode: "0755" when: - zabbix_proxy_apt_priority | int become: true - + - name: "Debian | Configuring the weight for APT" copy: dest: "/etc/apt/preferences.d/zabbix-proxy-{{ zabbix_proxy_database }}" @@ -126,61 +86,25 @@ Pin: origin repo.zabbix.com Pin-Priority: {{ zabbix_proxy_apt_priority }} owner: root - mode: '0644' + mode: "0644" when: - zabbix_proxy_apt_priority | int become: true -- name: Check if warn parameter can be used for shell module - set_fact: - produce_warn: False - when: ansible_version.full is version("2.14", "<") - -- name: apt-get clean - shell: apt-get clean; apt-get update - args: - warn: "{{ produce_warn | default(omit) }}" - changed_when: false - become: true - tags: - - skip_ansible_lint - -# On certain 18.04 images, such as docker or lxc, dpkg is configured not to -# install files into paths /usr/share/doc/* -# Since this is where Zabbix installs its database schemas, we need to allow -# files to be installed to /usr/share/doc/zabbix* -- name: Check for the dpkg exclude line - command: grep -F 'path-exclude=/usr/share/doc/*' /etc/dpkg/dpkg.cfg.d/excludes - register: dpkg_exclude_line - failed_when: false - changed_when: false - check_mode: false - -- name: Allow Zabbix dpkg installs to /usr/share/doc/zabbix* - lineinfile: - path: /etc/dpkg/dpkg.cfg.d/excludes - line: 'path-include=/usr/share/doc/zabbix*' - become: true - when: - - dpkg_exclude_line.rc == 0 - - name: "Debian | Installing zabbix-proxy-{{ zabbix_proxy_database }}" apt: - pkg: zabbix-proxy-{{ zabbix_proxy_database }} - state: "{{ zabbix_proxy_package_state }}" + pkg: "zabbix-proxy-{{ zabbix_proxy_database }}" update_cache: true - cache_valid_time: 0 - install_recommends: "{{ zabbix_proxy_install_recommends }}" + cache_valid_time: 3600 + force: true + state: "{{ zabbix_proxy_package_state }}" default_release: "{{ ansible_distribution_release }}" environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - register: zabbix_proxy_package_installed - until: zabbix_proxy_package_installed is succeeded + register: is_zabbix_proxy_package_installed + until: is_zabbix_proxy_package_installed is succeeded become: true - tags: - - zabbix-proxy - - init - name: "Debian | Installing zabbix-sql-scripts" apt: @@ -195,10 +119,10 @@ register: zabbix_proxy_package_sql_installed until: zabbix_proxy_package_sql_installed is succeeded when: - - zabbix_version is version('5.4', '>=') + - zabbix_proxy_version is version('6.0', '>=') become: true tags: - - zabbix-proxy + - zabbix-server - init - name: "Debian | Install Ansible module dependencies" @@ -214,35 +138,12 @@ when: - zabbix_database_creation tags: - - zabbix-proxy + - zabbix-server - init - name: "Debian | Install Mysql Client package" apt: - name: - - default-mysql-client - - "{{ zabbix_python_prefix }}-mysqldb" - state: present - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - register: zabbix_proxy_dependencies_installed - until: zabbix_proxy_dependencies_installed is succeeded - become: true - when: - - zabbix_proxy_database == 'mysql' - - zabbix_proxy_install_database_client - - ansible_distribution_release != "buster" - tags: - - zabbix-proxy - - init - - database - -- name: "Debian 10 | Install Mysql Client package" - apt: - name: - - mariadb-client - - "{{ zabbix_python_prefix }}-mysqldb" + name: "{{ mysql_client_pkgs[ansible_distribution_major_version] }}" state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" @@ -253,9 +154,8 @@ when: - zabbix_proxy_database == 'mysql' - zabbix_proxy_install_database_client - - ansible_distribution_release == "buster" tags: - - zabbix-proxy + - zabbix-server - init - database diff --git a/roles/zabbix_proxy/tasks/RedHat.yml b/roles/zabbix_proxy/tasks/RedHat.yml index 34a40396e..72397e489 100644 --- a/roles/zabbix_proxy/tasks/RedHat.yml +++ b/roles/zabbix_proxy/tasks/RedHat.yml @@ -1,84 +1,67 @@ --- # Tasks specific for RedHat systems -- name: "Set short version name" +- name: "RedHat | Set short version name" set_fact: - zabbix_short_version: "{{ zabbix_version | regex_replace('\\.', '') }}" + zabbix_short_version: "{{ zabbix_proxy_version | regex_replace('\\.', '') }}" - name: "RedHat | Use EPEL package name" set_fact: - zabbix_proxy_package: "zabbix{{ zabbix_version | regex_replace('\\.', '') }}-proxy" + zabbix_proxy_package: "zabbix{{ zabbix_proxy_version | regex_replace('\\.', '') }}-proxy" when: - zabbix_repo == "epel" tags: - zabbix-proxy - init -- name: "RedHat | Define package with version" - set_fact: - zabbix_proxy_package: "zabbix{{ zabbix_short_version }}-proxy-{{ zabbix_proxy_database }}" - cacheable: true - when: - - zabbix_proxy_rhel_version is defined - - zabbix_repo != "epel" - - name: "RedHat | Define package without version" set_fact: zabbix_proxy_package: "zabbix-proxy-{{ zabbix_proxy_database }}" cacheable: true when: - - zabbix_proxy_rhel_version is not defined - zabbix_repo != "epel" -- name: "RedHat | Set some facts Zabbix < 3.0" +- name: "RedHat | Set facts for Zabbix < 6.0" set_fact: apache_log: httpd - datafiles_path: "/usr/share/doc/zabbix-proxy-{{ zabbix_proxy_database }}-{{ zabbix_version }}*/create" + datafiles_path: "/usr/share/doc/zabbix-proxy-{{ zabbix_proxy_database }}-{{ zabbix_proxy_version }}*" when: - - zabbix_version is version('3.0', '<') + - zabbix_proxy_version is version('6.0', '<') tags: - zabbix-proxy -- name: "RedHat | Set facts for Zabbix >= 3.0 && < 5.4" - set_fact: - apache_log: httpd - datafiles_path: "/usr/share/doc/zabbix-proxy-{{ zabbix_proxy_database }}-{{ zabbix_version }}*" - when: - - zabbix_version is version('3.0', '>=') - - zabbix_version is version('5.4', '<') - tags: - - zabbix-proxy - -- name: "RedHat | Set facts for Zabbix == 5.4" - set_fact: - datafiles_path: "/usr/share/doc/zabbix-sql-scripts/{{ zabbix_proxy_database_long }}" - when: - - zabbix_version is version('5.4', '==') - tags: - - zabbix-server - - name: "RedHat | Set facts for Zabbix >= 6.0" set_fact: - datafiles_path: "/usr/share/zabbix-sql-scripts/{{ zabbix_proxy_database_long }}" + datafiles_path: "/usr/share/doc/zabbix-sql-scripts/{{ zabbix_proxy_db_long }}" when: - - zabbix_version is version('6.0', '>=') + - zabbix_proxy_version is version('6.0', '>=') tags: - zabbix-server -- name: "RedHat | Set facts for Zabbix >= 3.0 and RedHat 8" +- name: "RedHat | Set facts for Zabbix < 6.0 and RedHat 8" set_fact: apache_log: httpd datafiles_path: "/usr/share/doc/zabbix-proxy-{{ zabbix_proxy_database }}" when: - - zabbix_version is version('3.0', '>=') - - zabbix_version is version('5.4', '<') + - zabbix_proxy_version is version('6.0', '<') - ansible_distribution_major_version == '8' tags: - zabbix-proxy +- name: "RedHat | Set Zabbix user/group (RHEL 9)" + set_fact: + zabbix_os_user: zabbixsrv + zabbix_proxy_config: /etc/zabbix_proxy.conf + zabbix_proxy_logfile: /var/log/zabbixsrv/zabbix_proxy.log + zabbix_proxy_pidfile: /tmp/zabbix_proxy.pid + zabbix_proxy_socketdir: /tmp + when: + - ansible_distribution_major_version == "9" + - zabbix_proxy_version is version('6.0', '<=') + - name: "RedHat | Set some facts EPEL" set_fact: - datafiles_path: "/usr/share/zabbix-{{ zabbix_proxy_database_long }}" + datafiles_path: "/usr/share/zabbix-{{ zabbix_proxy_db_long }}" when: - zabbix_repo == "epel" tags: @@ -103,7 +86,7 @@ when: - zabbix_repo == "epel" -- name: "Make sure old file is absent" +- name: "RedHat | Make sure old file is absent" file: path: /etc/yum.repos.d/zabbix-supported.repo state: absent @@ -117,7 +100,7 @@ gpgcheck: "{{ item.gpgcheck }}" gpgkey: "{{ item.gpgkey }}" mode: "{{ item.mode | default('0644') }}" - priority: "{{ item.priority | default('98') }}" + priority: "{{ item.priority | default('99') }}" state: "{{ item.state | default('present') }}" proxy: "{{ zabbix_http_proxy | default(omit) }}" with_items: "{{ zabbix_repo_yum }}" @@ -130,65 +113,66 @@ tags: - zabbix-agent -- name: "RedHat | Installing zabbix-proxy-{{ zabbix_proxy_database }}" - package: - pkg: "{{ zabbix_proxy_package }}-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}" - state: "{{ zabbix_proxy_package_state }}" - disablerepo: "{{ '*' if (zabbix_repo_yum_enabled | length>0) else omit }}" - enablerepo: "{{ zabbix_repo_yum_enabled if zabbix_repo_yum_enabled is iterable and (zabbix_repo_yum_enabled | length>0) else omit }}" - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - become: true - when: - zabbix_repo != "other" - register: is_zabbix_proxy_package_installed - until: is_zabbix_proxy_package_installed is succeeded +- name: Install packages for Zabbix Repository + block: + - name: "RedHat | Installing zabbix-proxy-{{ zabbix_proxy_database }}" + yum: + pkg: "{{ zabbix_proxy_package }}-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}" + state: "{{ zabbix_proxy_package_state }}" + disablerepo: "{{ '*' if (zabbix_repo_yum_enabled | length>0) else omit }}" + enablerepo: "{{ zabbix_repo_yum_enabled if zabbix_repo_yum_enabled is iterable and (zabbix_repo_yum_enabled | length>0) else omit }}" + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" + become: true + register: is_zabbix_proxy_package_installed + until: is_zabbix_proxy_package_installed is succeeded -- name: "RedHat | Installing zabbix-proxy-{{ zabbix_proxy_database }} (When zabbix_repo == other)" - package: - pkg: "{{ zabbix_proxy_package }}-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}" - state: "{{ zabbix_proxy_package_state }}" - become: true - when: - zabbix_repo == "other" - register: is_zabbix_proxy_package_installed - until: is_zabbix_proxy_package_installed is succeeded - -- name: "RedHat | Installing zabbix-sql-scripts" - package: - pkg: "zabbix-sql-scripts-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}" - state: "{{ zabbix_proxy_package_state }}" - disablerepo: "{{ '*' if (zabbix_repo_yum_enabled | length>0) else omit }}" - enablerepo: "{{ zabbix_repo_yum_enabled if zabbix_repo_yum_enabled is iterable and (zabbix_repo_yum_enabled | length>0) else omit }}" - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - register: zabbix_proxy_sql_package_installed - until: zabbix_proxy_sql_package_installed is succeeded - when: - - zabbix_version is version('5.4', '>=') - - zabbix_repo != "other" - become: true + - name: "RedHat | Installing zabbix-sql-scripts" + yum: + pkg: "zabbix-sql-scripts-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}" + state: "{{ zabbix_proxy_package_state }}" + disablerepo: "{{ '*' if (zabbix_repo_yum_enabled | length>0) else omit }}" + enablerepo: "{{ zabbix_repo_yum_enabled if zabbix_repo_yum_enabled is iterable and (zabbix_repo_yum_enabled | length>0) else omit }}" + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" + register: zabbix_proxy_sql_package_installed + until: zabbix_proxy_sql_package_installed is succeeded + when: + - zabbix_proxy_version is version('6.0', '>=') + become: true + when: zabbix_repo != "other" tags: - zabbix-server -- name: "RedHat | Installing zabbix-sql-scripts (When zabbix_repo == other)" - package: - pkg: "zabbix-sql-scripts-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}" - state: "{{ zabbix_proxy_package_state }}" - register: zabbix_proxy_sql_package_installed - until: zabbix_proxy_sql_package_installed is succeeded - when: - - zabbix_version is version('5.4', '>=') - - zabbix_repo == "other" - become: true +- name: Install packages for Other Repository + block: + - name: "RedHat | Installing zabbix-proxy-{{ zabbix_proxy_database }} (When zabbix_repo == other)" + yum: + pkg: "{{ zabbix_proxy_package }}-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}" + state: "{{ zabbix_proxy_package_state }}" + become: true + when: zabbix_repo == "other" + register: is_zabbix_proxy_package_installed + until: is_zabbix_proxy_package_installed is succeeded + + - name: "RedHat | Installing zabbix-sql-scripts (When zabbix_repo == other)" + yum: + pkg: "zabbix-sql-scripts-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}" + state: "{{ zabbix_proxy_package_state }}" + register: zabbix_proxy_sql_package_installed + until: zabbix_proxy_sql_package_installed is succeeded + when: + - zabbix_proxy_version is version('6.0', '>=') + become: true + when: zabbix_repo == "other" tags: - zabbix-server -- name: "RedHat | Install Ansible PostgreSQL module dependencies" +- name: "RedHat | Install Ansible PostgreSQL Client package" yum: - name: python-psycopg2 + name: "{{ pgsql_depenencies[ansible_distribution_major_version] }}" state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" @@ -199,33 +183,13 @@ when: - zabbix_database_creation or zabbix_database_sqlload - zabbix_proxy_database == 'pgsql' - - ansible_distribution_major_version == "7" or ansible_distribution_major_version == "6" tags: - zabbix-proxy - init -- name: "RedHat | Install Ansible module dependencies on RHEL9 or RHEL8" +- name: "RedHat | Install Mysql Client package" yum: - name: python3-psycopg2 - state: present - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - register: zabbix_proxy_dependencies_installed - until: zabbix_proxy_dependencies_installed is succeeded - become: true - when: - - zabbix_database_creation - - zabbix_proxy_database == 'pgsql' - - ansible_distribution_major_version|int >= 8 - tags: - - zabbix-server - -- name: "RedHat | Install Mysql Client package RHEL7" - yum: - name: - - mariadb - - MySQL-python + name: "{{ mysql_client_pkgs[ansible_distribution_major_version] }}" state: installed environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" @@ -235,17 +199,16 @@ until: are_zabbix_proxy_dependency_packages_installed is succeeded when: - zabbix_database_creation or zabbix_database_sqlload + - zabbix_proxy_install_database_client - zabbix_proxy_database == 'mysql' - - ansible_distribution_major_version == '7' tags: - zabbix-proxy - init -- name: "RedHat | Install Mysql Client packages RHEL9 or RHEL8" +- name: "RedHat | Install sqlite3" yum: name: - - mysql - - python3-PyMySQL + - sqlite state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" @@ -254,70 +217,43 @@ until: zabbix_proxy_dependencies_installed is succeeded become: true when: - - zabbix_proxy_database == 'mysql' - - ansible_distribution_major_version|int >= 8 + - zabbix_proxy_database == 'sqlite3' tags: - zabbix-proxy - - init -- name: "RedHat | Install Mysql Client package RHEL5 - 6" - yum: - name: - - mysql - - MySQL-python - state: present - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - become: true - register: are_zabbix_proxy_dependency_packages_installed - until: are_zabbix_proxy_dependency_packages_installed is succeeded - when: - - zabbix_database_creation or zabbix_database_sqlload - - zabbix_proxy_database == 'mysql' - - ansible_distribution_major_version == "6" or ansible_distribution_major_version == "5" - - zabbix_proxy_install_database_client - tags: - - zabbix-proxy - - init - - database +- name: "Ensure Service has Hard Link (Zabbix 6 RHEL 9 Only)" + block: + - name: Checking Source File + stat: + path: /etc/alternatives/zabbix-proxy-systemd + register: src_stat -- name: "RedHat | Install PostgreSQL client package" - yum: - name: postgresql - state: present - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - become: true - register: are_zabbix_proxy_dependency_packages_installed - until: are_zabbix_proxy_dependency_packages_installed is succeeded - when: - - zabbix_database_creation or zabbix_database_sqlload - - zabbix_proxy_database == 'pgsql' - - zabbix_proxy_install_database_client - tags: - - zabbix-proxy - - init - - database + - name: Checkiong Target File + stat: + path: /usr/lib/systemd/system/zabbix-proxy.service + register: dest_stat -- name: "RedHat | Install sqlite3" - yum: - name: - - sqlite - state: present - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - register: zabbix_proxy_dependencies_installed - until: zabbix_proxy_dependencies_installed is succeeded - become: true + - name: Updating File + block: + - name: Deleting Soft Link + file: + path: /usr/lib/systemd/system/zabbix-proxy.service + state: absent + + - name: Adding Hard Link + file: + src: /etc/alternatives/zabbix-proxy-systemd + dest: /usr/lib/systemd/system/zabbix-proxy.service + state: hard + owner: root + group: root + mode: 0644 + when: dest_stat.stat.inode | default(1) != src_stat.stat.inode | default(100) when: - - zabbix_proxy_database == 'sqlite3' - tags: - - zabbix-proxy + - zabbix_proxy_version is version('6.0', '==') + - ansible_distribution_major_version == "9" - name: "Configure SELinux when enabled" - include_tasks: selinux.yml + include: selinux.yml when: - zabbix_selinux | bool diff --git a/roles/zabbix_proxy/tasks/main.yml b/roles/zabbix_proxy/tasks/main.yml index 58ac3b5fa..4d407aeff 100644 --- a/roles/zabbix_proxy/tasks/main.yml +++ b/roles/zabbix_proxy/tasks/main.yml @@ -5,14 +5,23 @@ - name: Determine Latest Supported Zabbix Version set_fact: - zabbix_proxy_version: "{{ zabbix_valid_proxy_versions[ansible_distribution_major_version][0] | default(6.0) }}" - when: zabbix_proxy_version is not defined + zabbix_proxy_version: "{{ zabbix_valid_proxy_versions[ansible_distribution_major_version][0] | default(6.2) }}" + when: zabbix_proxy_version is not defined or zabbix_proxy_version is none -- name: "Replace Sangoma with RedHat task" +- name: Set More Variables set_fact: - ansible_os_family: "RedHat" - when: - - ansible_os_family == 'Sangoma' + zabbix_proxy_db_long: "{{ 'postgresql' if zabbix_proxy_database == 'pgsql' else zabbix_proxy_database }}" + zabbix_valid_version: "{{ zabbix_proxy_version in zabbix_valid_proxy_versions[ansible_distribution_major_version] }}" + zabbix_short_version: "{{ zabbix_proxy_version | regex_replace('\\.', '') }}" + +- name: Stopping Install of Invalid Version + fail: + msg: Zabbix version {{ zabbix_proxy_version }} is not supported on {{ ansible_distribution }} {{ ansible_distribution_major_version }} + when: not zabbix_valid_version + +- name: Set Path to SQL File + set_fact: + datafile_path: "{{ db_file_path[zabbix_short_version] }}" - name: "Set default ip address for zabbix_proxy_ip" set_fact: @@ -21,23 +30,28 @@ - zabbix_proxy_ip is not defined - "'ansible_default_ipv4' in hostvars[inventory_hostname]" -- name: "Set OS dependent variables" - include_vars: "{{ item }}" - with_first_found: - - "../vars/{{ ansible_distribution }}.yml" - - "../vars/main.yml" +- name: "Complete OS Specific Tasks" + include: "{{ ansible_os_family }}.yml" -- name: "Install the correct repository" - include_tasks: "{{ ansible_os_family }}.yml" +- name: "Get the file for database schema" + shell: ls -1 {{ db_file_path[zabbix_short_version] }} + changed_when: false + when: + - zabbix_database_sqlload + - zabbix_repo != "epel" + register: ls_output_schema + tags: + - zabbix-proxy + - database -- name: "Installing the {{ zabbix_proxy_database_long }} database" - include_tasks: "{{ zabbix_proxy_database_long }}.yml" +- name: "Installing the database" + include: "{{ zabbix_proxy_db_long }}.yml" - name: "Create include dir zabbix-proxy" file: path: "{{ zabbix_proxy_include }}" - owner: zabbix - group: zabbix + owner: "{{ zabbix_os_user }}" + group: "{{ zabbix_os_user }}" mode: "{{ zabbix_proxy_include_mode }}" state: directory become: true @@ -45,8 +59,8 @@ - name: "Create module dir zabbix-proxy" file: path: "{{ zabbix_proxy_loadmodulepath }}" - owner: zabbix - group: zabbix + owner: "{{ zabbix_os_user }}" + group: "{{ zabbix_os_user }}" state: directory mode: "0755" become: true @@ -64,8 +78,8 @@ copy: dest: "{{ zabbix_proxy_tlspskfile }}" content: "{{ zabbix_proxy_tlspsk_secret }}" - owner: zabbix - group: zabbix + owner: "{{ zabbix_os_user }}" + group: "{{ zabbix_os_user }}" mode: 0400 become: true when: @@ -74,30 +88,12 @@ notify: - restart zabbix-proxy -- name: "Allow zabbix-proxy to open connections (SELinux)" - ansible.posix.seboolean: - name: zabbix_can_network - persistent: true - state: true - become: true - when: ansible_selinux.status == "enabled" - tags: selinux - -- name: "Allow zabbix-proxy to connect to zabbix_proxy_preprocessing.sock (SELinux)" - ansible.posix.seboolean: - name: daemons_enable_cluster_mode - persistent: true - state: true - become: true - when: ansible_selinux.status == "enabled" - tags: selinux - - name: "Configure zabbix-proxy" template: src: zabbix_proxy.conf.j2 - dest: /etc/zabbix/zabbix_proxy.conf - owner: zabbix - group: zabbix + dest: "{{ zabbix_proxy_config }}" + owner: "{{ zabbix_os_user }}" + group: "{{ zabbix_os_user }}" mode: "{{ zabbix_proxy_conf_mode }}" notify: restart zabbix-proxy become: true @@ -106,8 +102,8 @@ vars: gather_facts: false ansible_user: "{{ zabbix_api_login_user }}" + ansible_network_os: community.zabbix.zabbix ansible_connection: httpapi - # Can't think of a way to make http_login_* vars be undefined -( http_login_user: "{{ zabbix_api_http_user | default(zabbix_http_user | default(-42)) }}" http_login_password: "{{ zabbix_api_http_password | default(zabbix_http_password | default(-42)) }}" community.zabbix.zabbix_proxy: diff --git a/roles/zabbix_proxy/tasks/mysql.yml b/roles/zabbix_proxy/tasks/mysql.yml index 6d699ea83..fb6ece500 100644 --- a/roles/zabbix_proxy/tasks/mysql.yml +++ b/roles/zabbix_proxy/tasks/mysql.yml @@ -1,18 +1,18 @@ --- # task file for mysql -- name: "Set the correct delegated_dbhost (to support MySQL db deployment on a remote dbhost)" +- name: "MySQL | Set the correct delegated_dbhost (to support MySQL db deployment on a remote dbhost)" set_fact: delegated_dbhost: "{{ zabbix_proxy_dbhost if (zabbix_proxy_dbhost != 'localhost') else inventory_hostname }}" when: - zabbix_proxy_dbhost_run_install -- name: "Set the correct delegated_dbhost (to support MySQL db deployment on a remote dbhost)" +- name: "MySQL | Set the correct delegated_dbhost (to support MySQL db deployment on a remote dbhost)" set_fact: delegated_dbhost: "{{ inventory_hostname }}" when: - not zabbix_proxy_dbhost_run_install -- name: "Override delegated_dbhost with real dbhost when dbhost is behind loadbalancer" +- name: "MySQL | Override delegated_dbhost with real dbhost when dbhost is behind loadbalancer" set_fact: delegated_dbhost: "{{ zabbix_proxy_real_dbhost }}" when: zabbix_proxy_real_dbhost | default(false) @@ -54,18 +54,7 @@ - zabbix-proxy - database -- name: "Get the file for schema.sql" - shell: ls -1 {{ datafiles_path }}/{{ 'schema' if zabbix_version is version('6.0', '<') else 'proxy' }}.sq* - changed_when: false - when: - - zabbix_database_sqlload - - zabbix_repo != "epel" - register: ls_output_create - tags: - - zabbix-proxy - - database - -- name: "Check if we have done files" +- name: "MySQL | Check if we have done files" stat: path: /etc/zabbix/schema.done register: done_file @@ -113,7 +102,6 @@ login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}" login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}" when: - - zabbix_version is version('3.0', '>=') - zabbix_database_sqlload | bool - zabbix_repo != "epel" - not done_file.stat.exists @@ -135,7 +123,7 @@ encoding: "{{ zabbix_proxy_dbencoding }}" collation: "{{ zabbix_proxy_dbcollation }}" state: import - target: "{{ ls_output_create.stdout }}" + target: "{{ ls_output_schema.stdout }}" when: - zabbix_database_sqlload - zabbix_repo != "epel" @@ -148,14 +136,13 @@ - name: "MySQL | Revert innodb_default_row_format to previous value" community.mysql.mysql_variables: variable: innodb_default_row_format - value: '{{ mysql_innodb_default_row_format.msg }}' + value: "{{ mysql_innodb_default_row_format.msg }}" login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}" login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}" login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}" login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}" login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}" when: - - zabbix_version is version('3.0', '>=') - zabbix_database_sqlload | bool - zabbix_repo != "epel" - not done_file.stat.exists @@ -165,11 +152,11 @@ - zabbix-proxy - database -- name: "Create done file" +- name: "MySQL | Create done file" file: path: /etc/zabbix/schema.done state: touch - mode: '0644' + mode: "0644" when: - zabbix_database_sqlload - zabbix_repo != "epel" diff --git a/roles/zabbix_proxy/tasks/postgresql.yml b/roles/zabbix_proxy/tasks/postgresql.yml index 559f77bc2..ca7e18bc6 100644 --- a/roles/zabbix_proxy/tasks/postgresql.yml +++ b/roles/zabbix_proxy/tasks/postgresql.yml @@ -1,13 +1,13 @@ --- # task file for postgresql -- name: "Set the correct delegated_dbhost (to support postgres db deployment on a remote dbhost)" +- name: "PostgreSQL | Set the correct delegated_dbhost (to support postgres db deployment on a remote dbhost)" set_fact: delegated_dbhost: "{{ zabbix_proxy_dbhost if (zabbix_proxy_dbhost != 'localhost') else inventory_hostname }}" when: - zabbix_proxy_dbhost_run_install -- name: "Set the correct delegated_dbhost (to support postgres db deployment on a remote dbhost)" +- name: "PostgreSQL | Set the correct delegated_dbhost (to support postgres db deployment on a remote dbhost)" set_fact: delegated_dbhost: "{{ inventory_hostname }}" when: @@ -20,11 +20,12 @@ name: "{{ zabbix_proxy_dbname }}" port: "{{ zabbix_proxy_dbport }}" state: present + - name: "PostgreSQL | Delegated | Create database user" - postgresql_user: + community.postgresql.postgresql_user: db: "{{ zabbix_proxy_dbname }}" name: "{{ zabbix_proxy_dbuser }}" - password: "{{ ('md5' + (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5')) if zabbix_proxy_dbpassword_hash_method == 'md5' else zabbix_proxy_dbpassword }}" + password: "md5{{ (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5') }}" port: "{{ zabbix_proxy_dbport }}" priv: ALL state: present @@ -51,13 +52,13 @@ port: "{{ zabbix_proxy_dbport }}" state: present - name: "PostgreSQL | Remote | Create database user" - postgresql_user: + community.postgresql.postgresql_user: login_host: "{{ zabbix_proxy_pgsql_login_host | default(omit) }}" login_user: "{{ zabbix_proxy_pgsql_login_user | default(omit) }}" login_password: "{{ zabbix_proxy_pgsql_login_password | default(omit) }}" db: "{{ zabbix_proxy_dbname }}" name: "{{ zabbix_proxy_dbuser }}" - password: "{{ ('md5' + (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5')) if zabbix_proxy_dbpassword_hash_method == 'md5' else zabbix_proxy_dbpassword }}" + password: "md5{{ (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5') }}" port: "{{ zabbix_proxy_dbport }}" priv: ALL state: present @@ -69,24 +70,20 @@ - zabbix-server - database +- name: "PostgreSQL | Handle Compressed Schema File" + set_fact: + zabbix_proxy_cat_cmd: zcat + when: "'.gz' in ls_output_schema.stdout" + - name: "PostgreSQL | Importing schema file" shell: | set -euxo pipefail - FILE={{ 'schema.sql' if zabbix_version is version('6.0', '<') else 'proxy.sql' }} - cd {{ datafiles_path }} - if [ -f ${FILE}.gz ] - then zcat ${FILE}.gz > /tmp/schema.sql - else - cp ${FILE} /tmp/schema.sql - fi - cat /tmp/schema.sql | psql -h '{{ zabbix_proxy_dbhost }}' -U '{{ zabbix_proxy_dbuser }}' \ - -d '{{ zabbix_proxy_dbname }}' + {{ zabbix_proxy_cat_cmd }} {{ ls_output_schema.stdout }} | psql -h '{{ zabbix_proxy_dbhost }}' -U '{{ zabbix_proxy_dbuser }}' -d '{{ zabbix_proxy_dbname }}' touch /etc/zabbix/schema.done - rm -f /tmp/schema.sql args: creates: /etc/zabbix/schema.done executable: /bin/bash environment: - PGPASSWORD: '{{ zabbix_proxy_dbpassword }}' + PGPASSWORD: "{{ zabbix_proxy_dbpassword }}" when: - zabbix_database_creation diff --git a/roles/zabbix_proxy/tasks/selinux.yml b/roles/zabbix_proxy/tasks/selinux.yml index 02fb4ebaf..606cafbbe 100644 --- a/roles/zabbix_proxy/tasks/selinux.yml +++ b/roles/zabbix_proxy/tasks/selinux.yml @@ -1,30 +1,7 @@ --- - - name: "SELinux | RedHat | Install related SELinux package to fix issues" yum: - name: - - policycoreutils-python - - libsemanage-python - - checkpolicy - state: present - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - register: zabbix_proxy_dependencies_installed - until: zabbix_proxy_dependencies_installed is succeeded - become: true - when: - - ansible_os_family == "RedHat" - - ansible_distribution_major_version == "7" or ansible_distribution_major_version == "6" - tags: - - zabbix-proxy - -- name: "SELinux | RedHat | Install related SELinux package to fix issues on RHEL8" - yum: - name: - - policycoreutils - - checkpolicy - - python3-libsemanage + name: "{{ selinux_pkgs[ansible_distribution_major_version] }}" state: present environment: http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" @@ -32,9 +9,6 @@ register: zabbix_proxy_dependencies_installed until: zabbix_proxy_dependencies_installed is succeeded become: true - when: - - ansible_os_family == "RedHat" - - ansible_distribution_major_version|int >= 8 tags: - zabbix-proxy @@ -44,7 +18,23 @@ args: creates: /etc/selinux/targeted/active/modules/400/zabbix_proxy_add/cil become: true - when: - - ansible_os_family == "RedHat" tags: - zabbix-proxy + +- name: "Allow zabbix-proxy to open connections (SELinux)" + ansible.posix.seboolean: + name: zabbix_can_network + persistent: true + state: true + become: true + when: ansible_selinux.status == "enabled" + tags: selinux + +- name: "Allow zabbix-proxy to connect to zabbix_proxy_preprocessing.sock (SELinux)" + ansible.posix.seboolean: + name: daemons_enable_cluster_mode + persistent: true + state: true + become: true + when: ansible_selinux.status == "enabled" + tags: selinux diff --git a/roles/zabbix_proxy/tasks/sqlite3.yml b/roles/zabbix_proxy/tasks/sqlite3.yml index 03fbf6fb3..e774335fa 100644 --- a/roles/zabbix_proxy/tasks/sqlite3.yml +++ b/roles/zabbix_proxy/tasks/sqlite3.yml @@ -11,8 +11,8 @@ file: name: "{{ zabbix_proxy_dbname | dirname }}" mode: 0744 - owner: zabbix - group: zabbix + owner: "{{ zabbix_os_user }}" + group: "{{ zabbix_os_user }}" seuser: system_u serole: object_r setype: zabbix_var_lib_t @@ -21,29 +21,26 @@ when: - zabbix_database_creation +- name: "Sqlite3 | Handle Compressed Schema File" + set_fact: + zabbix_proxy_cat_cmd: zcat + when: "'.gz' in ls_output_schema.stdout" + - name: "Sqlite3 | Importing schema file" become: true - become_user: zabbix + become_user: "{{ zabbix_os_user }}" shell: | - set -o pipefail - FILE={{ 'schema.sql' if zabbix_version is version('6.0', '<') else 'proxy.sql' }} - cd {{ datafiles_path }} - if [ -f ${FILE}.gz ] - then zcat ${FILE}.gz > /tmp/schema.sql - else - cp ${FILE} /tmp/schema.sql - fi - cat /tmp/schema.sql | sqlite3 {{ zabbix_proxy_dbname }} - rm -f /tmp/schema.sql + set -euxo pipefail + {{ zabbix_proxy_cat_cmd }} {{ ls_output_schema.stdout }} | sqlite3 {{ zabbix_proxy_dbname }} args: creates: "{{ zabbix_proxy_dbname }}" executable: /bin/bash environment: - PGPASSWORD: '{{ zabbix_proxy_dbpassword }}' + PGPASSWORD: "{{ zabbix_proxy_dbpassword }}" when: - zabbix_database_creation -- name: "Fix zabbix db file permission (SELinux)" +- name: "Sqlite3 | Fix zabbix db file permission (SELinux)" file: path: "{{ zabbix_proxy_dbname }}" state: file diff --git a/roles/zabbix_proxy/templates/zabbix_proxy.conf.j2 b/roles/zabbix_proxy/templates/zabbix_proxy.conf.j2 index e99c7c734..0b40f6980 100644 --- a/roles/zabbix_proxy/templates/zabbix_proxy.conf.j2 +++ b/roles/zabbix_proxy/templates/zabbix_proxy.conf.j2 @@ -4,189 +4,123 @@ # This configuration file is "minimalized", which means all the original comments # are removed. The full documentation for your Zabbix Proxy can be found here: -# https://www.zabbix.com/documentation/{{ zabbix_version }}/en/manual/appendix/config/zabbix_proxy +# https://www.zabbix.com/documentation/{{ zabbix_proxy_version }}/en/manual/appendix/config/zabbix_proxy -ProxyMode={{ zabbix_proxy_mode }} -Server={{ zabbix_proxy_server }} -{% if zabbix_version is version('6.0', '<') %} -ServerPort={{ zabbix_proxy_serverport }} -{% endif %} -{% if zabbix_proxy_hostname is defined and zabbix_proxy_hostname %} -Hostname={{ zabbix_proxy_hostname }} -{% endif %} -{% if zabbix_proxy_hostnameitem is defined and zabbix_proxy_hostnameitem %} -HostnameItem={{ zabbix_proxy_hostnameitem }} -{% endif %} -ListenPort={{ zabbix_proxy_listenport }} -{% if zabbix_proxy_sourceip is defined and zabbix_proxy_sourceip %} -SourceIP={{ zabbix_proxy_sourceip }} -{% endif %} -{% if zabbix_version is version('6.0', '>=') %} -LogType={{ zabbix_proxy_logtype }} -{% endif %} -LogFile={{ zabbix_proxy_logfile }} -LogFileSize={{ zabbix_proxy_logfilesize }} -EnableRemoteCommands={{ zabbix_proxy_enableremotecommands }} -DebugLevel={{ zabbix_proxy_debuglevel }} -PidFile={{ zabbix_proxy_pidfile }} -{% if zabbix_version is version('3.2', '>') %} -SocketDir={{ zabbix_proxy_socketdir }} -{% endif %} -DBHost={{ zabbix_proxy_dbhost }} -DBName={{ zabbix_proxy_dbname }} -{% if zabbix_proxy_dbschema is defined and zabbix_proxy_dbschema %} -DBSchema={{ zabbix_proxy_dbschema }} -{% endif %} -DBUser={{ zabbix_proxy_dbuser }} -DBPassword={{ zabbix_proxy_dbpassword }} -DBPort={{ zabbix_proxy_dbport }} -{% if zabbix_version is version('6.0', '>=') %} -AllowUnsupportedDBVersions={{ zabbix_proxy_allowunsupporteddbversions }} -{% endif %} -ProxyLocalBuffer={{ zabbix_proxy_proxylocalbuffer }} -ProxyOfflineBuffer={{ zabbix_proxy_proxyofflinebuffer }} -HeartbeatFrequency={{ zabbix_proxy_heartbeatfrequency }} -{% if zabbix_proxy_configfrequency is defined and zabbix_proxy_configfrequency is not none %} -ConfigFrequency={{ zabbix_proxy_configfrequency }} -{% else %} -{% if zabbix_version is version('6.2', '<') %} -ConfigFrequency=3600 -{% else %} -ConfigFrequency=300 -{% endif %} -{% endif %} -DataSenderFrequency={{ zabbix_proxy_datasenderfrequency }} -StartPollers={{ zabbix_proxy_startpollers }} -StartIPMIPollers={{ zabbix_proxy_startipmipollers }} -{% if zabbix_version is version('4.2', '>=') %} -StartPreprocessors={{ zabbix_proxy_startpreprocessors }} -{% endif %} -StartPollersUnreachable={{ zabbix_proxy_startpollersunreachable }} -StartTrappers={{ zabbix_proxy_starttrappers }} -StartPingers={{ zabbix_proxy_startpingers }} -StartDiscoverers={{ zabbix_proxy_startdiscoverers }} -StartHTTPPollers={{ zabbix_proxy_starthttppollers }} -{% if zabbix_proxy_javagateway is defined and zabbix_proxy_javagateway %} -JavaGateway={{ zabbix_proxy_javagateway }} -JavaGatewayPort={{ zabbix_proxy_javagatewayport }} -StartJavaPollers={{ zabbix_proxy_startjavapollers }} -{% endif %} -{% if zabbix_version is version_compare('2.4', '>=') %} -StartVMwareCollectors={{ zabbix_proxy_startvmwarecollector }} -VMwareFrequency={{ zabbix_proxy_vmwarefrequency }} -VMwareCacheSize={{ zabbix_proxy_vmwarecachesize -}}M -{% endif %} -SNMPTrapperFile={{ zabbix_proxy_snmptrapperfile }} -StartSNMPTrapper={{ zabbix_proxy_snmptrapper }} -{% if zabbix_proxy_listenip is defined and zabbix_proxy_listenip %} -ListenIP={{ zabbix_proxy_listenip }} -{% endif %} -HousekeepingFrequency={{ zabbix_proxy_housekeepingfrequency }} -CacheSize={{ zabbix_proxy_cachesize -}}M -StartDBSyncers={{ zabbix_proxy_startdbsyncers }} -HistoryCacheSize={{ zabbix_proxy_historycachesize -}}M -{% if zabbix_version is version_compare('3.2', '>=') %} -HistoryIndexCacheSize={{ zabbix_proxy_historyindexcachesize -}}M -{% endif %} -{% if zabbix_version is version_compare('2.4', '<') %} -HistoryTextCacheSize={{ zabbix_proxy_historytextcachesize -}}M -{% endif %} -Timeout={{ zabbix_proxy_timeout }} -TrapperTimeout={{ zabbix_proxy_trappertimeout }} -UnreachablePeriod={{ zabbix_proxy_unreachableperiod }} -UnavailableDelay={{ zabbix_proxy_unavaliabledelay }} -UnreachableDelay={{ zabbix_proxy_unreachabedelay }} -{% if zabbix_version is version_compare('6.2', '>=') %} -StartODBCPollers={{ zabbix_proxy_startodbcpollers }} -{% endif %} -ExternalScripts={{ zabbix_proxy_externalscripts }} -FpingLocation={{ zabbix_proxy_fpinglocation }} -Fping6Location={{ zabbix_proxy_fping6location }} -{% if zabbix_proxy_sshkeylocation is defined and zabbix_proxy_sshkeylocation %} -SSHKeyLocation={{ zabbix_proxy_sshkeylocation }} -{% endif %} -LogSlowQueries={{ zabbix_proxy_loglowqueries }} -TmpDir={{ zabbix_proxy_tmpdir }} -{% if zabbix_version is version_compare('2.4', '<') %} -AllowRoot={{ zabbix_proxy_allowroot }} -{% endif %} -Include={{ zabbix_proxy_include }} -{% if zabbix_version is version_compare('3.0', '<') %} -LoadModulePath={{ zabbix_proxy_loadmodulepath }} -{% endif %} -{% if zabbix_proxy_loadmodule is defined and zabbix_proxy_loadmodule %} -LoadModule={{ zabbix_proxy_loadmodule }} -{% endif %} -{% if zabbix_version is version_compare('4.0', '>=') %} -StatsAllowedIP={{ zabbix_proxy_statsallowedip }} -{% endif %} -{% if zabbix_version is version_compare('3.0', '>=') %} -{% if zabbix_proxy_tlsconnect is defined and zabbix_proxy_tlsconnect %} -TLSConnect={{ zabbix_proxy_tlsconnect }} -{% endif %} -{% if zabbix_proxy_tlsaccept is defined and zabbix_proxy_tlsaccept %} -TLSAccept={{ zabbix_proxy_tlsaccept }} -{% endif %} -{% if zabbix_proxy_tlscafile is defined and zabbix_proxy_tlscafile %} -TLSCAFile={{ zabbix_proxy_tlscafile }} -{% endif %} -{% if zabbix_proxy_tlscrlfile is defined and zabbix_proxy_tlscrlfile %} -TLSCRLFile={{ zabbix_proxy_tlscrlfile }} -{% endif %} -{% if zabbix_proxy_tlsservercertissuer is defined and zabbix_proxy_tlsservercertissuer %} -TLSServerCertIssuer={{ zabbix_proxy_tlsservercertissuer }} -{% endif %} -{% if zabbix_proxy_tlsservercertsubject is defined and zabbix_proxy_tlsservercertsubject %} -TLSServerCertSubject={{ zabbix_proxy_tlsservercertsubject }} -{% endif %} -{% if zabbix_proxy_tlscertfile is defined and zabbix_proxy_tlscertfile %} -TLSCertFile={{ zabbix_proxy_tlscertfile }} -{% endif %} -{% if zabbix_proxy_tlskeyfile is defined and zabbix_proxy_tlskeyfile %} -TLSKeyFile={{ zabbix_proxy_tlskeyfile }} -{% endif %} -{% if zabbix_proxy_tlspskidentity is defined and zabbix_proxy_tlspskidentity %} -TLSPSKIdentity={{ zabbix_proxy_tlspskidentity }} -{% endif %} -{% if zabbix_proxy_tlspskfile is defined and zabbix_proxy_tlspskfile %} -TLSPSKFile={{ zabbix_proxy_tlspskfile }} -{% endif %} -{% endif %} -{% if zabbix_proxy_dbtlsconnect is defined and zabbix_proxy_dbtlsconnect is not none %} -DBTLSConnect={{ zabbix_proxy_dbtlsconnect }} -{% endif %} -{% if zabbix_proxy_dbtlscafile is defined and zabbix_proxy_dbtlscafile is not none %} -DBTLSCAFile={{ zabbix_proxy_dbtlscafile }} -{% endif %} -{% if zabbix_proxy_dbtlscertfile is defined and zabbix_proxy_dbtlscertfile is not none %} -DBTLSCertFile={{ zabbix_proxy_dbtlscertfile }} -{% endif %} -{% if zabbix_proxy_dbtlskeyfile is defined and zabbix_proxy_dbtlskeyfile is not none %} -DBTLSKeyFile={{ zabbix_proxy_dbtlskeyfile }} -{% endif %} -{% if zabbix_proxy_dbtlscipher is defined and zabbix_proxy_dbtlscipher is not none %} -DBTLSCipher={{ zabbix_proxy_dbtlscipher }} -{% endif %} -{% if zabbix_proxy_dbtlscipher13 is defined and zabbix_proxy_dbtlscipher13 is not none %} -DBTLSCipher13={{ zabbix_proxy_dbtlscipher13 }} -{% endif %} -{% if zabbix_version is version('6.0', '>=') %} -{% if zabbix_proxy_vaulttoken is defined and zabbix_proxy_vaulttoken is not none %} -VaultToken={{ zabbix_proxy_vaulttoken }} -{% endif %} -{% if zabbix_proxy_vaulturl is defined and zabbix_proxy_vaulturl is not none %} -VaultURL={{ zabbix_proxy_vaulturl }} -{% endif %} -{% if zabbix_proxy_vaultdbpath is defined and zabbix_proxy_vaultdbpath is not none %} -VaultDBPath={{ zabbix_proxy_vaultdbpath }} -{% endif %} -{% if zabbix_proxy_vaulttlscertfile is defined and zabbix_proxy_vaulttlscertfile is not none %} -VaultTLSKeyFile={{ zabbix_proxy_vaulttlscertfile }} -{% endif %} -{% if zabbix_proxy_vaulttlskeyfile is defined and zabbix_proxy_vaulttlskeyfile is not none %} -VaultTLSCertFile={{ zabbix_proxy_vaulttlskeyfile }} -{% endif %} -{% if zabbix_proxy_listenbacklog is defined and zabbix_proxy_listenbacklog is not none %} -ListenBacklog={{ zabbix_proxy_listenbacklog }} -{% endif %} -{% endif %} \ No newline at end of file +{{ (zabbix_proxy_allowroot is defined and zabbix_proxy_allowroot is not none) | ternary('','# ') }}AllowRoot={{ zabbix_proxy_allowroot | default('') }} +{% if zabbix_proxy_version is version('6.0', '>=') %} +{{ (zabbix_proxy_allowunsupporteddbversions is defined and zabbix_proxy_allowunsupporteddbversions is not none) | ternary('','# ') }}AllowUnsupportedDBVersions={{ zabbix_proxy_allowunsupporteddbversions | default('') }} +{% endif %} +{{ (zabbix_proxy_cachesize is defined and zabbix_proxy_cachesize is not none) | ternary('','# ') }}CacheSize={{ zabbix_proxy_cachesize | default('') }} +{{ (zabbix_proxy_configfrequency is defined and zabbix_proxy_configfrequency is not none) | ternary('','# ') }}ConfigFrequency={{ zabbix_proxy_configfrequency | default('') }} +{{ (zabbix_proxy_datasenderfrequency is defined and zabbix_proxy_datasenderfrequency is not none) | ternary('','# ') }}DataSenderFrequency={{ zabbix_proxy_datasenderfrequency | default('') }} +{{ (zabbix_proxy_dbhost is defined and zabbix_proxy_dbhost is not none) | ternary('','# ') }}DBHost={{ zabbix_proxy_dbhost | default('') }} +{{ (zabbix_proxy_dbname is defined and zabbix_proxy_dbname is not none) | ternary('','# ') }}DBName={{ zabbix_proxy_dbname | default('') }} +{{ (zabbix_proxy_dbpassword is defined and zabbix_proxy_dbpassword is not none) | ternary('','# ') }}DBPassword={{ zabbix_proxy_dbpassword | default('') }} +{{ (zabbix_proxy_dbschema is defined and zabbix_proxy_dbschema is not none) | ternary('','# ') }}DBSchema={{ zabbix_proxy_dbschema | default('') }} +{{ (zabbix_proxy_dbsocket is defined and zabbix_proxy_dbsocket is not none) | ternary('','# ') }}DBSocket={{ zabbix_proxy_dbsocket | default('') }} +{{ (zabbix_proxy_dbtlscafile is defined and zabbix_proxy_dbtlscafile is not none) | ternary('','# ') }}DBTLSCAFile={{ zabbix_proxy_dbtlscafile | default('') }} +{{ (zabbix_proxy_dbtlscertfile is defined and zabbix_proxy_dbtlscertfile is not none) | ternary('','# ') }}DBTLSCertFile={{ zabbix_proxy_dbtlscertfile | default('') }} +{{ (zabbix_proxy_dbtlscipher is defined and zabbix_proxy_dbtlscipher is not none) | ternary('','# ') }}DBTLSCipher={{ zabbix_proxy_dbtlscipher | default('') }} +{{ (zabbix_proxy_dbtlscipher13 is defined and zabbix_proxy_dbtlscipher13 is not none) | ternary('','# ') }}DBTLSCipher13={{ zabbix_proxy_dbtlscipher13 | default('') }} +{{ (zabbix_proxy_dbtlsconnect is defined and zabbix_proxy_dbtlsconnect is not none) | ternary('','# ') }}DBTLSConnect={{ zabbix_proxy_dbtlsconnect | default('') }} +{{ (zabbix_proxy_dbtlskeyfile is defined and zabbix_proxy_dbtlskeyfile is not none) | ternary('','# ') }}DBTLSKeyFile={{ zabbix_proxy_dbtlskeyfile | default('') }} +{{ (zabbix_proxy_dbuser is defined and zabbix_proxy_dbuser is not none) | ternary('','# ') }}DBUser={{ zabbix_proxy_dbuser | default('') }} +{{ (zabbix_proxy_debuglevel is defined and zabbix_proxy_debuglevel is not none) | ternary('','# ') }}DebugLevel={{ zabbix_proxy_debuglevel | default('') }} +{{ (zabbix_proxy_enableremotecommands is defined and zabbix_proxy_enableremotecommands is not none) | ternary('','# ') }}EnableRemoteCommands={{ zabbix_proxy_enableremotecommands | default('') }} +{{ (zabbix_proxy_externalscripts is defined and zabbix_proxy_externalscripts is not none) | ternary('','# ') }}ExternalScripts={{ zabbix_proxy_externalscripts | default('') }} +{{ (zabbix_proxy_fping6location is defined and zabbix_proxy_fping6location is not none) | ternary('','# ') }}Fping6Location={{ zabbix_proxy_fping6location | default('') }} +{{ (zabbix_proxy_fpinglocation is defined and zabbix_proxy_fpinglocation is not none) | ternary('','# ') }}FpingLocation={{ zabbix_proxy_fpinglocation | default('') }} +{{ (zabbix_proxy_heartbeatfrequency is defined and zabbix_proxy_heartbeatfrequency is not none) | ternary('','# ') }}HeartbeatFrequency={{ zabbix_proxy_heartbeatfrequency | default('') }} +{{ (zabbix_proxy_historycachesize is defined and zabbix_proxy_historycachesize is not none) | ternary('','# ') }}HistoryCacheSize={{ zabbix_proxy_historycachesize | default('') }} +{{ (zabbix_proxy_historyindexcachesize is defined and zabbix_proxy_historyindexcachesize is not none) | ternary('','# ') }}HistoryIndexCacheSize={{ zabbix_proxy_historyindexcachesize | default('') }} +{{ (zabbix_proxy_hostname is defined and zabbix_proxy_hostname is not none) | ternary('','# ') }}Hostname={{ zabbix_proxy_hostname | default('') }} +{{ (zabbix_proxy_hostnameitem is defined and zabbix_proxy_hostnameitem is not none) | ternary('','# ') }}HostnameItem={{ zabbix_proxy_hostnameitem | default('') }} +{{ (zabbix_proxy_housekeepingfrequency is defined and zabbix_proxy_housekeepingfrequency is not none) | ternary('','# ') }}HousekeepingFrequency={{ zabbix_proxy_housekeepingfrequency | default('') }} +{{ (zabbix_proxy_include is defined and zabbix_proxy_include is not none) | ternary('','# ') }}Include={{ zabbix_proxy_include | default('') }} +{{ (zabbix_proxy_javagateway is defined and zabbix_proxy_javagateway is not none) | ternary('','# ') }}JavaGateway={{ zabbix_proxy_javagateway | default('') }} +{{ (zabbix_proxy_javagatewayport is defined and zabbix_proxy_javagatewayport is not none) | ternary('','# ') }}JavaGatewayPort={{ zabbix_proxy_javagatewayport | default('') }} +{{ (zabbix_proxy_listenbacklog is defined and zabbix_proxy_listenbacklog is not none) | ternary('','# ') }}ListenBacklog={{ zabbix_proxy_listenbacklog | default('') }} +{{ (zabbix_proxy_listenip is defined and zabbix_proxy_listenip is not none) | ternary('','# ') }}ListenIP={{ zabbix_proxy_listenip | default('') }} +{{ (zabbix_proxy_listenport is defined and zabbix_proxy_listenport is not none) | ternary('','# ') }}ListenPort={{ zabbix_proxy_listenport | default('') }} +{{ (zabbix_proxy_loadmodule is defined and zabbix_proxy_loadmodule is not none) | ternary('','# ') }}LoadModule={{ zabbix_proxy_loadmodule | default('') }} +{{ (zabbix_proxy_loadmodulepath is defined and zabbix_proxy_loadmodulepath is not none) | ternary('','# ') }}LoadModulePath={{ zabbix_proxy_loadmodulepath | default('') }} +{{ (zabbix_proxy_logfile is defined and zabbix_proxy_logfile is not none) | ternary('','# ') }}LogFile={{ zabbix_proxy_logfile | default('') }} +{{ (zabbix_proxy_logfilesize is defined and zabbix_proxy_logfilesize is not none) | ternary('','# ') }}LogFileSize={{ zabbix_proxy_logfilesize | default('') }} +{{ (zabbix_proxy_logremotecommands is defined and zabbix_proxy_logremotecommands is not none) | ternary('','# ') }}LogRemoteCommands={{ zabbix_proxy_logremotecommands | default('') }} +{{ (zabbix_proxy_logslowqueries is defined and zabbix_proxy_logslowqueries is not none) | ternary('','# ') }}LogSlowQueries={{ zabbix_proxy_logslowqueries | default('') }} +{{ (zabbix_proxy_logtype is defined and zabbix_proxy_logtype is not none) | ternary('','# ') }}LogType={{ zabbix_proxy_logtype | default('') }} +{{ (zabbix_proxy_pidfile is defined and zabbix_proxy_pidfile is not none) | ternary('','# ') }}PidFile={{ zabbix_proxy_pidfile | default('') }} +{{ (zabbix_proxy_proxylocalbuffer is defined and zabbix_proxy_proxylocalbuffer is not none) | ternary('','# ') }}ProxyLocalBuffer={{ zabbix_proxy_proxylocalbuffer | default('') }} +{{ (zabbix_proxy_proxymode is defined and zabbix_proxy_proxymode is not none) | ternary('','# ') }}ProxyMode={{ zabbix_proxy_proxymode | default('') }} +{{ (zabbix_proxy_proxyofflinebuffer is defined and zabbix_proxy_proxyofflinebuffer is not none) | ternary('','# ') }}ProxyOfflineBuffer={{ zabbix_proxy_proxyofflinebuffer | default('') }} +{{ (zabbix_proxy_server is defined and zabbix_proxy_server is not none) | ternary('','# ') }}Server={{ zabbix_proxy_server | default('') }} +{% if zabbix_proxy_version is version('6.0', '<') %} +{{ (zabbix_proxy_serverport is defined and zabbix_proxy_serverport is not none) | ternary('','# ') }}ServerPort={{ zabbix_proxy_serverport | default('') }} +{% endif %} +{{ (zabbix_proxy_snmptrapperfile is defined and zabbix_proxy_snmptrapperfile is not none) | ternary('','# ') }}SNMPTrapperFile={{ zabbix_proxy_snmptrapperfile | default('') }} +{{ (zabbix_proxy_socketdir is defined and zabbix_proxy_socketdir is not none) | ternary('','# ') }}SocketDir={{ zabbix_proxy_socketdir | default('') }} +{{ (zabbix_proxy_sourceip is defined and zabbix_proxy_sourceip is not none) | ternary('','# ') }}SourceIP={{ zabbix_proxy_sourceip | default('') }} +{{ (zabbix_proxy_sshkeylocation is defined and zabbix_proxy_sshkeylocation is not none) | ternary('','# ') }}SSHKeyLocation={{ zabbix_proxy_sshkeylocation | default('') }} +{{ (zabbix_proxy_sslcalocation is defined and zabbix_proxy_sslcalocation is not none) | ternary('','# ') }}SSLCALocation={{ zabbix_proxy_sslcalocation | default('') }} +{{ (zabbix_proxy_sslcertlocation is defined and zabbix_proxy_sslcertlocation is not none) | ternary('','# ') }}SSLCertLocation={{ zabbix_proxy_sslcertlocation | default('') }} +{{ (zabbix_proxy_sslkeylocation is defined and zabbix_proxy_sslkeylocation is not none) | ternary('','# ') }}SSLKeyLocation={{ zabbix_proxy_sslkeylocation | default('') }} +{{ (zabbix_proxy_startdbsyncers is defined and zabbix_proxy_startdbsyncers is not none) | ternary('','# ') }}StartDBSyncers={{ zabbix_proxy_startdbsyncers | default('') }} +{{ (zabbix_proxy_startdiscoverers is defined and zabbix_proxy_startdiscoverers is not none) | ternary('','# ') }}StartDiscoverers={{ zabbix_proxy_startdiscoverers | default('') }} +{% if zabbix_proxy_version is version('6.0', '==') %} +{{ (zabbix_proxy_starthistorypollers is defined and zabbix_proxy_starthistorypollers is not none) | ternary('','# ') }}={{ zabbix_proxy_starthistorypollers | default('') }} +{% endif %} +{{ (zabbix_proxy_starthttppollers is defined and zabbix_proxy_starthttppollers is not none) | ternary('','# ') }}StartHTTPPollers={{ zabbix_proxy_starthttppollers | default('') }} +{{ (zabbix_proxy_startipmipollers is defined and zabbix_proxy_startipmipollers is not none) | ternary('','# ') }}StartIPMIPollers={{ zabbix_proxy_startipmipollers | default('') }} +{{ (zabbix_proxy_startjavapollers is defined and zabbix_proxy_startjavapollers is not none) | ternary('','# ') }}StartJavaPollers={{ zabbix_proxy_startjavapollers | default('') }} +{% if zabbix_proxy_version is version('6.0', '>=') %} +{{ (zabbix_proxy_startodbcpollers is defined and zabbix_proxy_startodbcpollers is not none) | ternary('','# ') }}StartODBCPollers={{ zabbix_proxy_startodbcpollers | default('') }} +{% endif %} +{{ (zabbix_proxy_startpingers is defined and zabbix_proxy_startpingers is not none) | ternary('','# ') }}StartPingers={{ zabbix_proxy_startpingers | default('') }} +{{ (zabbix_proxy_startpollers is defined and zabbix_proxy_startpollers is not none) | ternary('','# ') }}StartPollers={{ zabbix_proxy_startpollers | default('') }} +{{ (zabbix_proxy_startpollersunreachable is defined and zabbix_proxy_startpollersunreachable is not none) | ternary('','# ') }}StartPollersUnreachable={{ zabbix_proxy_startpollersunreachable | default('') }} +{{ (zabbix_proxy_startpreprocessors is defined and zabbix_proxy_startpreprocessors is not none) | ternary('','# ') }}StartPreprocessors={{ zabbix_proxy_startpreprocessors | default('') }} +{{ (zabbix_proxy_startsnmptrapper is defined and zabbix_proxy_startsnmptrapper is not none) | ternary('','# ') }}StartSNMPTrapper={{ zabbix_proxy_startsnmptrapper | default('') }} +{{ (zabbix_proxy_starttrappers is defined and zabbix_proxy_starttrappers is not none) | ternary('','# ') }}StartTrappers={{ zabbix_proxy_starttrappers | default('') }} +{{ (zabbix_proxy_startvmwarecollectors is defined and zabbix_proxy_startvmwarecollectors is not none) | ternary('','# ') }}StartVMwareCollectors={{ zabbix_proxy_startvmwarecollectors | default('') }} +{{ (zabbix_proxy_statsallowedip is defined and zabbix_proxy_statsallowedip is not none) | ternary('','# ') }}StatsAllowedIP={{ zabbix_proxy_statsallowedip | default('') }} +{{ (zabbix_proxy_timeout is defined and zabbix_proxy_timeout is not none) | ternary('','# ') }}Timeout={{ zabbix_proxy_timeout | default('') }} +{{ (zabbix_proxy_tlsaccept is defined and zabbix_proxy_tlsaccept is not none) | ternary('','# ') }}TLSAccept={{ zabbix_proxy_tlsaccept | default('') }} +{{ (zabbix_proxy_tlscafile is defined and zabbix_proxy_tlscafile is not none) | ternary('','# ') }}TLSCAFile={{ zabbix_proxy_tlscafile | default('') }} +{{ (zabbix_proxy_tlscertfile is defined and zabbix_proxy_tlscertfile is not none) | ternary('','# ') }}TLSCertFile={{ zabbix_proxy_tlscertfile | default('') }} +{{ (zabbix_proxy_tlscipherall is defined and zabbix_proxy_tlscipherall is not none) | ternary('','# ') }}TLSCipherAll={{ zabbix_proxy_tlscipherall | default('') }} +{{ (zabbix_proxy_tlscipherall13 is defined and zabbix_proxy_tlscipherall13 is not none) | ternary('','# ') }}TLSCipherAll13={{ zabbix_proxy_tlscipherall13 | default('') }} +{{ (zabbix_proxy_tlsciphercert is defined and zabbix_proxy_tlsciphercert is not none) | ternary('','# ') }}TLSCipherCert={{ zabbix_proxy_tlsciphercert | default('') }} +{{ (zabbix_proxy_tlsciphercert13 is defined and zabbix_proxy_tlsciphercert13 is not none) | ternary('','# ') }}TLSCipherCert13={{ zabbix_proxy_tlsciphercert13 | default('') }} +{{ (zabbix_proxy_tlscipherpsk is defined and zabbix_proxy_tlscipherpsk is not none) | ternary('','# ') }}TLSCipherPSK={{ zabbix_proxy_tlscipherpsk | default('') }} +{{ (zabbix_proxy_tlscipherpsk13 is defined and zabbix_proxy_tlscipherpsk13 is not none) | ternary('','# ') }}TLSCipherPSK13={{ zabbix_proxy_tlscipherpsk13 | default('') }} +{{ (zabbix_proxy_tlsconnect is defined and zabbix_proxy_tlsconnect is not none) | ternary('','# ') }}TLSConnect={{ zabbix_proxy_tlsconnect | default('') }} +{{ (zabbix_proxy_tlscrlfile is defined and zabbix_proxy_tlscrlfile is not none) | ternary('','# ') }}TLSCRLFile={{ zabbix_proxy_tlscrlfile | default('') }} +{{ (zabbix_proxy_tlskeyfile is defined and zabbix_proxy_tlskeyfile is not none) | ternary('','# ') }}TLSKeyFile={{ zabbix_proxy_tlskeyfile | default('') }} +{{ (zabbix_proxy_tlspskfile is defined and zabbix_proxy_tlspskfile is not none) | ternary('','# ') }}TLSPSKFile={{ zabbix_proxy_tlspskfile | default('') }} +{{ (zabbix_proxy_tlspskidentity is defined and zabbix_proxy_tlspskidentity is not none) | ternary('','# ') }}TLSPSKIdentity={{ zabbix_proxy_tlspskidentity | default('') }} +{{ (zabbix_proxy_tlsservercertissuer is defined and zabbix_proxy_tlsservercertissuer is not none) | ternary('','# ') }}TLSServerCertIssuer={{ zabbix_proxy_tlsservercertissuer | default('') }} +{{ (zabbix_proxy_tlsservercertsubject is defined and zabbix_proxy_tlsservercertsubject is not none) | ternary('','# ') }}TLSServerCertSubject={{ zabbix_proxy_tlsservercertsubject | default('') }} +{{ (zabbix_proxy_tmpdir is defined and zabbix_proxy_tmpdir is not none) | ternary('','# ') }}TmpDir={{ zabbix_proxy_tmpdir | default('') }} +{{ (zabbix_proxy_trappertimeout is defined and zabbix_proxy_trappertimeout is not none) | ternary('','# ') }}TrapperTimeout={{ zabbix_proxy_trappertimeout | default('') }} +{{ (zabbix_proxy_unavailabledelay is defined and zabbix_proxy_unavailabledelay is not none) | ternary('','# ') }}UnavailableDelay={{ zabbix_proxy_unavailabledelay | default('') }} +{{ (zabbix_proxy_unreachabledelay is defined and zabbix_proxy_unreachabledelay is not none) | ternary('','# ') }}UnreachableDelay={{ zabbix_proxy_unreachabledelay | default('') }} +{{ (zabbix_proxy_unreachableperiod is defined and zabbix_proxy_unreachableperiod is not none) | ternary('','# ') }}UnreachablePeriod={{ zabbix_proxy_unreachableperiod | default('') }} +{{ (zabbix_proxy_user is defined and zabbix_proxy_user is not none) | ternary('','# ') }}User={{ zabbix_proxy_user | default('') }} +{% if zabbix_proxy_version is version('6.2', '>=') %} +{{ (zabbix_proxy_vault is defined and zabbix_proxy_vault is not none) | ternary('','# ') }}Vault={{ zabbix_proxy_vault | default('') }} +{% endif %} +{% if zabbix_proxy_version is version('6.0', '>=') %} +{{ (zabbix_proxy_vaultdbpath is defined and zabbix_proxy_vaultdbpath is not none) | ternary('','# ') }}VaultDBPath={{ zabbix_proxy_vaultdbpath | default('') }} +{% endif %} +{% if zabbix_proxy_version is version('6.2', '>=') %} +{{ (zabbix_proxy_vaulttlscertfile is defined and zabbix_proxy_vaulttlscertfile is not none) | ternary('','# ') }}VaultTLSCertFile={{ zabbix_proxy_vaulttlscertfile | default('') }} +{{ (zabbix_proxy_vaulttlskeyfile is defined and zabbix_proxy_vaulttlskeyfile is not none) | ternary('','# ') }}VaultTLSKeyFile={{ zabbix_proxy_vaulttlskeyfile | default('') }} +{% endif %} +{% if zabbix_proxy_version is version('6.0', '>=') %} +{{ (zabbix_proxy_vaulttoken is defined and zabbix_proxy_vaulttoken is not none) | ternary('','# ') }}VaultToken={{ zabbix_proxy_vaulttoken | default('') }} +{{ (zabbix_proxy_vaulturl is defined and zabbix_proxy_vaulturl is not none) | ternary('','# ') }}VaultURL={{ zabbix_proxy_vaulturl | default('') }} +{% endif %} +{{ (zabbix_proxy_vmwarecachesize is defined and zabbix_proxy_vmwarecachesize is not none) | ternary('','# ') }}VMwareCacheSize={{ zabbix_proxy_vmwarecachesize | default('') }} +{{ (zabbix_proxy_vmwarefrequency is defined and zabbix_proxy_vmwarefrequency is not none) | ternary('','# ') }}VMwareFrequency={{ zabbix_proxy_vmwarefrequency | default('') }} +{{ (zabbix_proxy_vmwareperffrequency is defined and zabbix_proxy_vmwareperffrequency is not none) | ternary('','# ') }}VMwarePerfFrequency={{ zabbix_proxy_vmwareperffrequency | default('') }} +{{ (zabbix_proxy_vmwaretimeout is defined and zabbix_proxy_vmwaretimeout is not none) | ternary('','# ') }}VMwareTimeout={{ zabbix_proxy_vmwaretimeout | default('') }} \ No newline at end of file diff --git a/roles/zabbix_proxy/vars/Amazon.yml b/roles/zabbix_proxy/vars/Amazon.yml deleted file mode 100644 index 605be3896..000000000 --- a/roles/zabbix_proxy/vars/Amazon.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -ansible_distribution_major_version: "6" diff --git a/roles/zabbix_proxy/vars/Debian.yml b/roles/zabbix_proxy/vars/Debian.yml index cc58f9c95..c1e7c65ea 100644 --- a/roles/zabbix_proxy/vars/Debian.yml +++ b/roles/zabbix_proxy/vars/Debian.yml @@ -4,23 +4,42 @@ zabbix_valid_proxy_versions: - 6.2 - 6.0 - 5.0 - - 4.0 "10": + - 6.2 - 6.0 - 5.0 - - 4.0 - "9": - - 4.0 - # Ubuntu "22": - 6.2 - 6.0 + - 5.0 "20": - 6.2 - 6.0 - 5.0 - - 4.0 "18": + - 6.2 - 6.0 - 5.0 - - 4.0 + +mysql_client_pkgs: + # Debian + "11": + - mycli + - "{{ zabbix_python_prefix }}-mysqldb" + "10": + - mariadb-client + - "{{ zabbix_python_prefix }}-mysqldb" + # Ubuntu + "22": + - mycli + - "{{ zabbix_python_prefix }}-mysqldb" + "20": + - mycli + - "{{ zabbix_python_prefix }}-mysqldb" + "18": + - mycli + - "{{ zabbix_python_prefix }}-mysqldb" + +mysql_plugin: + "18": mysql_native_password + "10": mysql_native_password diff --git a/roles/zabbix_proxy/vars/RedHat.yml b/roles/zabbix_proxy/vars/RedHat.yml index c86934295..710faea7b 100644 --- a/roles/zabbix_proxy/vars/RedHat.yml +++ b/roles/zabbix_proxy/vars/RedHat.yml @@ -6,7 +6,46 @@ zabbix_valid_proxy_versions: - 6.2 - 6.0 - 5.0 - - 4.0 "7": + - 6.2 + - 6.0 - 5.0 - - 4.0 + +pgsql_depenencies: + "9": + - python3-psycopg2 + - postgresql + "8": + - python3-psycopg2 + - postgresql + "7": + - python-psycopg2 + - postgresql + +mysql_client_pkgs: + "9": + - mysql + - python3-PyMySQL + "8": + - mysql + - python3-PyMySQL + "7": + - mariadb + - MySQL-python + +selinux_pkgs: + "9": + - policycoreutils + - checkpolicy + - python3-libsemanage + "8": + - policycoreutils + - checkpolicy + - python3-libsemanage + "7": + - policycoreutils-python + - libsemanage-python + - checkpolicy + +mysql_plugin: + "7": mysql_native_password diff --git a/roles/zabbix_proxy/vars/main.yml b/roles/zabbix_proxy/vars/main.yml index ea434bdc4..3423b84b7 100644 --- a/roles/zabbix_proxy/vars/main.yml +++ b/roles/zabbix_proxy/vars/main.yml @@ -1,2 +1,6 @@ --- # vars file for zabbix_proxy +db_file_path: + "62": "/usr/share/zabbix-sql-scripts/{{ zabbix_proxy_db_long }}/proxy.sql" + "60": "/usr/share/zabbix-sql-scripts/{{ zabbix_proxy_db_long }}/proxy.sql" + "50": "/usr/share/doc/zabbix-proxy-{{ zabbix_proxy_database }}*/schema.sql.gz" diff --git a/roles/zabbix_proxy/vars/zabbix.yml b/roles/zabbix_proxy/vars/zabbix.yml index aa7ac93b4..17fa8354f 100644 --- a/roles/zabbix_proxy/vars/zabbix.yml +++ b/roles/zabbix_proxy/vars/zabbix.yml @@ -5,16 +5,10 @@ sign_keys: sign_key: E709712C buster: sign_key: E709712C - stretch: - sign_key: E709712C focal: sign_key: E709712C bionic: sign_key: E709712C - xenial: - sign_key: E709712C - trusty: - sign_key: E709712C jammy: sign_key: E709712C "60": @@ -22,217 +16,20 @@ sign_keys: sign_key: E709712C buster: sign_key: E709712C - stretch: - sign_key: E709712C focal: sign_key: E709712C bionic: sign_key: E709712C - xenial: - sign_key: E709712C - trusty: - sign_key: E709712C jammy: sign_key: E709712C - "54": - bullseye: - sign_key: E709712C - buster: - sign_key: E709712C - jessie: - sign_key: E709712C - stretch: - sign_key: E709712C - focal: - sign_key: E709712C - bionic: - sign_key: E709712C - xenial: - sign_key: E709712C - trusty: - sign_key: E709712C - tricia: - sign_key: E709712C - "52": - # bullseye: not available upstream - buster: - sign_key: E709712C - jessie: - sign_key: E709712C - stretch: - sign_key: E709712C - focal: - sign_key: E709712C - bionic: - sign_key: E709712C - xenial: - sign_key: E709712C - trusty: - sign_key: E709712C - tricia: - sign_key: E709712C "50": bullseye: sign_key: E709712C buster: sign_key: E709712C - jessie: - sign_key: E709712C - stretch: - sign_key: E709712C focal: sign_key: E709712C bionic: sign_key: E709712C - xenial: - sign_key: E709712C - trusty: - sign_key: E709712C - tricia: - sign_key: E709712C - "44": - buster: - sign_key: A14FE591 - jessie: - sign_key: 79EA5ED4 - stretch: - sign_key: A14FE591 - focal: - sign_key: A14FE591 - eoan: - sign_key: A14FE591 - cosmic: - sign_key: A14FE591 - bionic: - sign_key: A14FE591 - sonya: - sign_key: A14FE591 - serena: - sign_key: A14FE591 - trusty: - sign_key: 79EA5ED4 - xenial: - sign_key: E709712C - "42": - buster: - sign_key: A14FE591 - jessie: - sign_key: 79EA5ED4 - stretch: - sign_key: A14FE591 - eoan: - sign_key: A14FE591 - cosmic: - sign_key: A14FE591 - bionic: - sign_key: A14FE591 - sonya: - sign_key: A14FE591 - serena: - sign_key: A14FE591 - trusty: - sign_key: 79EA5ED4 - xenial: - sign_key: E709712C - "40": - bullseye: - sign_key: A14FE591 - buster: - sign_key: A14FE591 - jessie: - sign_key: 79EA5ED4 - stretch: - sign_key: A14FE591 - focal: - sign_key: A14FE591 - bionic: - sign_key: A14FE591 - sonya: - sign_key: A14FE591 - serena: - sign_key: A14FE591 - trusty: - sign_key: 79EA5ED4 - xenial: - sign_key: E709712C - "34": - jessie: - sign_key: 79EA5ED4 - stretch: - sign_key: A14FE591 - wheezy: - sign_key: A14FE591 - bionic: - sign_key: A14FE591 - sonya: - sign_key: A14FE591 - serena: - sign_key: A14FE591 - trusty: - sign_key: 79EA5ED4 - xenial: - sign_key: E709712C - "32": - stretch: - sign_key: A14FE591 - wheezy: - sign_key: 79EA5ED4 - bionic: - sign_key: A14FE591 - sonya: - sign_key: 79EA5ED4 - serena: - sign_key: 79EA5ED4 - trusty: - sign_key: 79EA5ED4 - xenial: - sign_key: E709712C - "30": - buster: - sign_key: A14FE591 - jessie: - sign_key: 79EA5ED4 - stretch: - sign_key: A14FE591 - wheezy: - sign_key: 79EA5ED4 - bionic: - sign_key: A14FE591 - trusty: - sign_key: 79EA5ED4 - xenial: + jammy: sign_key: E709712C - "24": - jessie: - sign_key: 79EA5ED4 - wheezy: - sign_key: 79EA5ED4 - precise: - sign_key: 79EA5ED4 - trusty: - sign_key: 79EA5ED4 - "22": - squeeze: - sign_key: 79EA5ED4 - wheezy: - sign_key: 79EA5ED4 - precise: - sign_key: 79EA5ED4 - trusty: - sign_key: 79EA5ED4 - lucid: - sign_key: 79EA5ED4 - -suse: - "openSUSE Leap": - "42": - name: server:monitoring - url: http://download.opensuse.org/repositories/server:/monitoring/openSUSE_Leap_{{ ansible_distribution_version }}/ - "openSUSE": - "12": - name: server_monitoring - url: http://download.opensuse.org/repositories/server:/monitoring/openSUSE_{{ ansible_distribution_version }} - "SLES": - "11": - name: server_monitoring - url: http://download.opensuse.org/repositories/server:/monitoring/SLE_11_SP3/