-
Notifications
You must be signed in to change notification settings - Fork 3
/
playbook-metrics.yaml
168 lines (150 loc) · 4.18 KB
/
playbook-metrics.yaml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
---
- hosts: all
become: true
remote_user: mirror
handlers:
- import_tasks: handlers.yaml
tasks:
- name: Check collectd_password
debug:
msg: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_hostname|lower }}.yml"
- default.yml
paths:
- 'vault'
- name: "Load OS specific vault"
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_hostname|lower }}.yml"
- default.yml
paths:
- 'vault'
- name: Set SE type on mirror data dir
sefcontext:
target: "/data2?/mirror(/.*)?"
setype: "public_content_t"
state: present
notify: restorecon
- name: Metrics- copy over rsyslog.d
copy:
src: files/rsyslog.d/
dest: /etc/rsyslog.d/
notify: restart rsyslog
- name: Ensure that the ca-bundle exists
file:
src: /etc/ssl/certs/ca-bundle.crt
dest: /etc/ssl/certs/ca-certificates.crt
state: link
- name: Metrics- setup selinux contexts
copy:
src: files/selinux
dest: /root/
- name: Metrics- selinux module from template
include_role:
name: mwojtowicz.semodule
tasks_from: semodule.yml
vars:
selinux_module: "{{ metrics_module_templates }}"
loop_control:
loop_var: metrics_module_templates
loop:
- my-nginx
- my-rsyslogd
- my-collectd
- my-collectd-1
- my-collectd-2
- my-collectd-3
- my-collectd-4
- my-reader0
- my-reader0-1
- my-reader0-2
- my-reader1
- my-reader1-1
- my-reader1-2
- my-reader2
- my-reader2-1
- my-reader3
- my-reader3-2
- my-reader3-3
- my-reader3-4
- my-reader3-5
- my-reader3-6
- my-reader3-7
- my-reader3-8
- my-reader4
- my-reader4-1
- name: Metrics- selinux - enable logging to non-security directories
seboolean:
name: logging_syslogd_list_non_security_dirs
state: yes
persistent: yes
when:
ansible_distribution != 'Fedora'
and
(
ansible_distribution_file_variety == 'RedHat'
or
ansible_distribution == 'CentOS'
or
ansible_distribution == 'Red Hat Enterprise Linux'
)
and
ansible_facts['distribution_major_version']|int == 8
- name: Metrics- selinux - enable logging to non-security directories
seboolean:
name: logging_syslogd_append_public_content
state: yes
persistent: yes
when:
ansible_distribution != 'Fedora'
and
(
ansible_distribution_file_variety == 'RedHat'
or
ansible_distribution == 'CentOS'
or
ansible_distribution == 'Red Hat Enterprise Linux'
)
and
ansible_facts['distribution_major_version']|int == 9
- name: Metrics- selinux - collectd enable tcp network connect
seboolean:
name: collectd_tcp_network_connect
state: yes
persistent: yes
- name: Metrics- selinux - collectd enable tcp network connect
seboolean:
name: domain_kernel_load_modules
state: yes
persistent: yes
- name: Cockpit- enable socket
systemd:
name: cockpit.socket
state: started
enabled: yes
masked: no
- name: Check collectd_password
debug:
msg: Collectd password-{{ collectd_password }}
- name: Setup Collectd
include_role:
name: collectd
vars:
collectd_server: "gauss.monkeyblade.net"
collectd_username: "{{ ansible_hostname|lower }}"
#collectd_password: "{{ collectd_password }}"
- name: Collectd- remove ipmi, we don't have it
file:
path: "{{ metrics_collected_config_removals }}"
state: absent
loop_control:
loop_var: metrics_collected_config_removals
loop:
- "/etc/collectd.d/ipmi.conf"
notify:
- Restart collectd