forked from paregupt/ucs_traffic_monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprereq.yml
66 lines (52 loc) · 1.37 KB
/
prereq.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
---
# file: prereq.yml (ref: https://www.since2k7.com/blog/2020/02/29/cisco-ucs-monitoring-using-grafana-influxdb-telegraf-utm-installation)
- hosts: utm
become: yes
become_user: root
tasks:
- name: Add user utm
user:
name: utm
comment: UTM
uid: 2000
groups: wheel
- name: Create a 2048-bit SSH key for user utm ~utm/.ssh/id_rsa
user:
name: utm
generate_ssh_key: yes
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa
- name: Set timezone to {{ timezone }}
timezone:
name: "{{ timezone }}"
- name: Install required package - BASE
yum:
name: "{{ packages }}"
state: latest
vars:
packages:
- epel-release
- chrony
- name: Install optionnal package - BASE
yum:
name: firewalld
state: latest
when: enable_linux_fw|bool
- name: Enable service chronyd
service:
name: firewalld
enabled: yes
state: started
when: enable_linux_fw|bool
- name: Get current firewalld zone
shell: firewall-cmd --get-active-zones | head -n 1
register: firewalld_zone
changed_when: false
when: enable_linux_fw|bool
- name: Add grafana (port 3000) to firewalld - current zone {{ firewalld_zone.stdout }}
firewalld:
port: 3000/tcp
permanent: yes
immediate: yes
state: enabled
when: enable_linux_fw|bool