-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yml
75 lines (69 loc) · 1.84 KB
/
main.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
---
- name: Base
hosts: all
become: yes
vars_files:
- vars.yml
vars:
ufw_reset: yes
ufw_applications:
- name: "OpenSSH"
roles:
- weareinteractive.ufw
tasks:
- name: Ensure wrong hostname is not in hosts file
lineinfile:
dest: /etc/hosts
regexp: '{{ ansible_hostname }}$'
state: absent
backup: yes
when: ansible_hostname != inventory_hostname_short
- name: Ensure Hostname
hostname:
name: '{{ inventory_hostname_short }}'
when: ansible_hostname != inventory_hostname_short
- name: Ensure Hostname in hosts file
lineinfile:
dest: /etc/hosts
regexp: '{{ inventory_hostname_short }}$'
line: '{{ ansible_default_ipv4.address }} {{ inventory_hostname }} {{ inventory_hostname_short }}'
state: present
when: ansible_default_ipv4.address is defined
- name: disable unattended updates
debconf:
name: unattended-upgrades
question: unattended-upgrades/enable_auto_updates
value: 'false'
vtype: boolean
- name: Ensure qemu-guest-agent and htop are installed
apt:
update_cache: yes
name:
- qemu-guest-agent
- htop
state: present
- name: Monitored host
hosts: all
become: yes
vars_files:
- vars.yml
vars:
ufw_reset: no
ufw_applications:
- name: "node-exporter"
pre_tasks:
- name: Ensure node-exporter config for ufw
copy:
content: |
[node-exporter]
title=node-exporter
description=prometheus node exporter
ports=9100/tcp
mode: 0644
dest: /etc/ufw/applications.d/node-exporter
roles:
- cloudalchemy.node_exporter
- weareinteractive.ufw
- import_playbook: bbb.yml
- import_playbook: bbb_exporter.yml
- import_playbook: loadbalancer.yml