You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2022/08/02 20:37:22 UTC
[airavata] branch master updated: AIRAVATA-3609 Zabbix role updated for Ansible 2.13/RL8
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/master by this push:
new a7ee6ee294 AIRAVATA-3609 Zabbix role updated for Ansible 2.13/RL8
a7ee6ee294 is described below
commit a7ee6ee294197a4d6342a292db4e4ebf681b0b0e
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Aug 2 16:37:11 2022 -0400
AIRAVATA-3609 Zabbix role updated for Ansible 2.13/RL8
---
dev-tools/ansible/roles/zabbix/defaults/main.yml | 1 +
.../main.yml => tasks/install_deps_CentOS_7.yml} | 18 ++++++++++++--
.../main.yml => tasks/install_deps_Rocky_8.yml} | 19 ++++++++++++--
dev-tools/ansible/roles/zabbix/tasks/main.yml | 29 +---------------------
4 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/dev-tools/ansible/roles/zabbix/defaults/main.yml b/dev-tools/ansible/roles/zabbix/defaults/main.yml
index a20ac95ef0..73f93381b9 100644
--- a/dev-tools/ansible/roles/zabbix/defaults/main.yml
+++ b/dev-tools/ansible/roles/zabbix/defaults/main.yml
@@ -22,5 +22,6 @@
zabbix_server: localhost
zabbix_yum_repository: https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
+zabbix_rpm_key: https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591
...
diff --git a/dev-tools/ansible/roles/zabbix/defaults/main.yml b/dev-tools/ansible/roles/zabbix/tasks/install_deps_CentOS_7.yml
similarity index 65%
copy from dev-tools/ansible/roles/zabbix/defaults/main.yml
copy to dev-tools/ansible/roles/zabbix/tasks/install_deps_CentOS_7.yml
index a20ac95ef0..f646a4b987 100644
--- a/dev-tools/ansible/roles/zabbix/defaults/main.yml
+++ b/dev-tools/ansible/roles/zabbix/tasks/install_deps_CentOS_7.yml
@@ -20,7 +20,21 @@
---
-zabbix_server: localhost
-zabbix_yum_repository: https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
+- name: Update CA Certificates
+ yum: name=ca-certificates state=latest
+ become: yes
+
+- name: Install Zabbix RPM key
+ rpm_key:
+ state: present
+ key: https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX
+
+- name: Install Zabbix yum repository
+ yum: name={{ zabbix_yum_repository }} state=present update_cache=yes
+ become: yes
+
+- name: Install Zabbix Agent
+ yum: name=zabbix-agent state=latest update_cache=yes
+ become: yes
...
diff --git a/dev-tools/ansible/roles/zabbix/defaults/main.yml b/dev-tools/ansible/roles/zabbix/tasks/install_deps_Rocky_8.yml
similarity index 65%
copy from dev-tools/ansible/roles/zabbix/defaults/main.yml
copy to dev-tools/ansible/roles/zabbix/tasks/install_deps_Rocky_8.yml
index a20ac95ef0..111d37234a 100644
--- a/dev-tools/ansible/roles/zabbix/defaults/main.yml
+++ b/dev-tools/ansible/roles/zabbix/tasks/install_deps_Rocky_8.yml
@@ -20,7 +20,22 @@
---
-zabbix_server: localhost
-zabbix_yum_repository: https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
+- name: Update CA Certificates
+ dnf: name=ca-certificates state=latest
+ become: yes
+
+- name: Install Zabbix RPM key
+ rpm_key:
+ state: present
+ key: "{{ zabbix_rpm_key }}"
+ become: yes
+
+- name: Install Zabbix yum repository
+ dnf: name={{ zabbix_yum_repository }} state=present update_cache=yes
+ become: yes
+
+- name: Install Zabbix Agent
+ dnf: name=zabbix-agent state=latest update_cache=yes
+ become: yes
...
diff --git a/dev-tools/ansible/roles/zabbix/tasks/main.yml b/dev-tools/ansible/roles/zabbix/tasks/main.yml
index ce929297b2..dc2c7a04a1 100644
--- a/dev-tools/ansible/roles/zabbix/tasks/main.yml
+++ b/dev-tools/ansible/roles/zabbix/tasks/main.yml
@@ -20,34 +20,7 @@
---
-# Note: Following two tasks are needed to downgrade from 4.2.x -> 4.0.x. Once
-# all servers are updated these uninstall tasks can be removed.
-- name: Uninstall Zabbix yum repository
- yum: name=zabbix-release state=absent
- become: yes
- when: ansible_os_family == "RedHat"
-
-- name: Uninstall Zabbix Agent
- yum: name=zabbix-agent state=absent
- become: yes
- when: ansible_os_family == "RedHat"
-
-
-
-- name: Update CA Certificates
- yum: name=ca-certificates state=latest
- become: yes
- when: ansible_os_family == "RedHat"
-
-- name: Install Zabbix yum repository
- yum: name={{ zabbix_yum_repository }} state=present update_cache=yes
- become: yes
- when: ansible_os_family == "RedHat"
-
-- name: Install Zabbix Agent
- yum: name=zabbix-agent state=latest update_cache=yes
- become: yes
- when: ansible_os_family == "RedHat"
+- include_tasks: install_deps_{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml
- name: Copy Zabbix configuration
template: src=zabbix_agentd.conf.j2 dest=/etc/zabbix/zabbix_agentd.conf backup=yes