-
Notifications
You must be signed in to change notification settings - Fork 27
/
zabbix.yml
105 lines (88 loc) · 2.79 KB
/
zabbix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
# copyright Utrecht University
# This playbook provisions Yoda instance with the Zabbix agent, PostgreSQL monitoring and Zabbix user access to the database.
- name: Check Ansible version
hosts: localhost
gather_facts: false
pre_tasks:
- name: Verify Ansible version meets requirements
ansible.builtin.assert:
that: "ansible_version.full is version('2.9', '>=')"
msg: >
"You must update Ansible to at least 2.9 to deploy Yoda."
- name: Check repository branches
hosts: all
gather_facts: false
pre_tasks:
- name: Determine whether yoda version matches playbook version (branch or lightweight tag)
ansible.builtin.shell: |
set -o pipefail
git show-ref | grep "^$(git rev-parse HEAD) " | \
grep -E "refs/(heads|tags)/" | cut -d '/' -f 3 | grep "^{{ yoda_version }}$"
delegate_to: localhost
register: check_git_bltags
changed_when: false
failed_when: check_git_bltags.rc > 1
check_mode: false
args:
executable: /bin/bash
- name: Determine whether yoda version matches playbook version (annotated or lightweight tag)
ansible.builtin.shell: |
set -o pipefail
git tag --points-at HEAD | grep "^{{ yoda_version }}$"
delegate_to: localhost
register: check_git_tags
changed_when: false
failed_when: check_git_tags.rc > 1
check_mode: false
args:
executable: /bin/bash
- name: Abort if Yoda repository is not on correct branch or tag
ansible.builtin.fail:
msg: "Make sure your Yoda repository is on branch {{ yoda_version }} or a tag pointing at the current commit. (git checkout {{ yoda_version }})"
when: check_git_bltags.rc != 0 and check_git_tags.rc != 0 and yoda_environment != "development"
- name: Provision portal server with Zabbix agent
hosts: portals
become: true
roles:
- yoda_zabbix_portal
tags:
- portal
- name: Provision iCAT server with Zabbix agent and Yoda monitoring
hosts: icats
become: true
roles:
- yoda_zabbix_icat
- yoda_zabbix_irodscommon
tags:
- zabbix
- name: Provision database server with Zabbix agent and PostgreSQL monitoring
hosts: databases
become: true
roles:
- role: yoda_zabbix_database
zabbix_database_name: "{{ irods_database_name }}"
tags:
- database
- name: Provision resource server with Zabbix agent
hosts: resources
become: true
roles:
- yoda_zabbix_irodscommon
tags:
- resource
- name: Provision public server with Zabbix agent
hosts: publics
become: true
roles:
- yoda_zabbix_system
tags:
- public
- name: Provision external user service server with Zabbix agent
hosts: eus
become: true
roles:
- role: yoda_zabbix_database
zabbix_database_name: "{{ eus_db_name }}"
tags:
- eus