-
Notifications
You must be signed in to change notification settings - Fork 2
/
playbook.yml
97 lines (87 loc) · 2.46 KB
/
playbook.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
# code: language=ansible
---
- name: Install thirdparties
hosts: trento-server
become: true
pre_tasks:
- name: Check SLES distribution and version
ansible.builtin.fail:
msg: "This playbook only runs on SLES for SAP 15 SP3 or above. Detected: {{ ansible_distribution }} {{ ansible_distribution_version }}"
when: >
((ansible_distribution != "SLES_SAP") and
(ansible_distribution != "openSUSE Leap")) or
(ansible_distribution_version is version('15.3', '<'))
tasks:
- name: Install installation prerequisites
community.general.zypper:
name:
- gcc
- sudo
- name: Install python prerequisites
community.general.zypper:
name:
- python3-setuptools
- python3-pip
- python3-pexpect
- python3-devel
- python3-rpm
state: present
update_cache: true
- name: Check firewalld package on prometheus and trento-server hosts
hosts: prometheus-hosts:trento-server
tasks:
- name: Collect package facts
ansible.builtin.package_facts:
manager: auto
- name: Check if a specific package is installed
ansible.builtin.set_fact:
firewalld_installed: "{{ 'firewalld' in ansible_facts.packages }}"
# This task is required because immediate: true does not work with offline
# This should be fixed in newer ansible versions and could be removed in the future
- name: Check the status of firewalld
ansible.builtin.systemd:
name: firewalld.service
register: firewalld_status
- name: Provision postgres
become: true
vars:
provision_postgres: "true"
hosts: postgres-hosts
roles:
- role: postgres
when: provision_postgres == 'true'
become: true
- name: Provision prometheus
become: true
vars:
provision_prometheus: "true"
hosts: prometheus-hosts
roles:
- role: prometheus
when: provision_prometheus == 'true'
become: true
- name: Provision rabbitmq
become: true
vars:
provision_rabbitmq: "true"
hosts: rabbitmq-hosts
roles:
- role: rabbitmq
when: provision_rabbitmq == 'true'
- name: Configure trento components
vars:
provision_proxy: "true"
hosts: trento-server
become: true
roles:
- role: app
become: true
- role: proxy
when: provision_proxy == 'true'
become: true
- name: Configure trento agents
hosts: agents
become: true
roles:
- role: agent
become: true