This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaybook.yml
151 lines (136 loc) · 3.11 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
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
- hosts: all
become: true
become_method: sudo
pre_tasks:
- name: Instalando epel-release
yum:
name: "epel-release"
state: latest
- name: Atualizando pacotes
yum:
name: "*"
state: latest
- name: Instalando PIP
yum:
name: "python-pip"
state: latest
- name: Update pip
pip:
name: pip
state: latest
- name: Limpa regras do IPTables
iptables:
chain: "{{ item }}"
flush: yes
with_items:
- INPUT
- FORWARD
- OUTPUT
- name: Limpa regras do IPTables (NAT)
iptables:
table: nat
chain: '{{ item }}'
flush: yes
with_items:
- INPUT
- OUTPUT
- PREROUTING
- POSTROUTING
tasks:
- name: Remove swap of /etc/fstab
mount:
name: swap
fstype: swap
state: absent
- name: Disable swap
command: swapoff -a
- name: Add NTP role to linux
include_role:
name: geerlingguy.ntp
vars:
ntp_timezone: America/Sao_Paulo
ntp_manage_config: true
ntp_servers:
- "pool.ntp.br iburst"
- "ntp.cais.rnp.br iburst"
- "ntp.ufsc.br iburst"
- name: Install Docker dependencies
yum:
name: "{{ packages }}"
state: latest
vars:
packages:
- yum-utils
- device-mapper-persistent-data
- lvm2
- ntpdate
- name: Add docker repository
get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docer-ce.repo
mode: 0644
force: yes
become: yes
- name: Install Docker
yum:
name: "{{ packages }}"
state: latest
vars:
packages:
- docker-ce
- docker-ce-cli
- containerd.io
- name: "Add 'axt' user to 'docker' group"
user:
name: axt
groups: docker
append: yes
- name: "Starting and Enabling services"
service:
name: "{{ item }}"
state: started
enabled: yes
with_items:
- docker
- ntpd
- name: active 'net.bridge.bridge-nf-call-iptables'
sysctl:
name: net.bridge.bridge-nf-call-iptables
value: "1"
sysctl_set: yes
- name: Carrega modulos rke
modprobe:
name: "{{ item }}"
state: present
with_items:
- br_netfilter
- ip6_udp_tunnel
- ip_set
- ip_set_hash_ip
- ip_set_hash_net
- iptable_filter
- iptable_nat
- iptable_mangle
- iptable_raw
- nf_conntrack_netlink
- nf_conntrack
- nf_conntrack_ipv4
- nf_defrag_ipv4
- nf_nat
- nf_nat_ipv4
- nf_nat_masquerade_ipv4
- nfnetlink
- udp_tunnel
- veth
- vxlan
- x_tables
- xt_addrtype
- xt_conntrack
- xt_comment
- xt_mark
- xt_multiport
- xt_nat
- xt_recent
- xt_set
- xt_statistic
- xt_tcpudp