-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
153 lines (153 loc) · 4.51 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
152
153
---
- hosts: clustercloudera
tasks:
- name: Seta SELinux para permissivo
selinux:
policy: targeted
state: permissive
- name: Desabilita SELinux
selinux:
state: disabled
- name: Confgura Regras de Firewall
firewalld:
permanent: yes
state: enabled
port: '{{ item }}'
loop:
- 7180/tcp
- 7181/tcp
- 7182/tcp
- 9000/tcp
- 9001/tcp
- 9002/tcp
- 7432/tcp
- 9083/tcp
- 9082/tcp
- 9093/tcp
- 2181/tcp
- 8020/tcp
- 5432/tcp
- name: Instala Pacotes
yum:
state: present
name: '{{ item }}'
loop:
- wget
- curl
- vim
- telnet
- net-tools
- bash-completion
- name: Adiciona Repositorio Cloudera
shell:
cmd: wget https://archive.cloudera.com/cm5/redhat/7/x86_64/cm/cloudera-manager.repo -P /etc/yum.repos.d/
warn: false
- name: Adiciona Configuração /etc/hosts
copy:
src: ./hosts/hosts
dest: /etc/hosts
owner: root
group: root
mode: '0644'
- name: Reboot Servidores Para setar Configuração SELinux
reboot:
test_command: whoami
- hosts: clouderacm
tasks:
- name: Adiciona binario Cloudera Manager
copy:
src: ./cloudera5.16.2_bin/cloudera-manager-installer.bin
dest: /opt/
owner: root
group: root
mode: '0775'
- hosts: clouderadb
tasks:
- name: Instala PostgreSQL e psycopg2
yum:
state: present
name: '{{ item }}'
loop:
- postgresql-server
- python-psycopg2
- name: Configura initdb PostgreSQL
shell:
cmd: postgresql-setup initdb
warn: false
- name: Configura PostgreSQL locale.conf
copy:
src: ./postgresql_config/locale.conf
dest: /etc/locale.conf
owner: root
group: root
mode: '0644'
- name: Configura PostgreSQL postgresql.conf
copy:
src: ./postgresql_config/postgresql.conf
dest: /var/lib/pgsql/data/
owner: postgres
group: postgres
mode: '0600'
- name: Configura PostgreSQL pg_hba.conf
copy:
src: ./postgresql_config/pg_hba.conf
dest: /var/lib/pgsql/data/
owner: postgres
group: postgres
mode: '0600'
- name: Inicia Serviço PostgreSQL
systemd:
name: postgresql
state: restarted
enabled: yes
- name: Cria Usuario Cloudera Manager
postgresql_user:
name: scm
password: scm123
- name: Cria Database Cloudera Manager
postgresql_db:
name: scm
owner: scm
encoding: UTF-8
- name: Cria Usuario Activity Monitor
postgresql_user:
name: actmonitor
password: actmonitor123
- name: Cria Database Activity Monitor
postgresql_db:
name: actmonitor
owner: actmonitor
encoding: UTF-8
- name: Cria Usuario hive
postgresql_user:
name: hive
password: hive123
- name: Cria Database metastore hive
postgresql_db:
name: metastore
owner: hive
encoding: UTF-8
- name: Cria Usuario hue
postgresql_user:
name: hue
password: hue123
- name: Cria Database hue
postgresql_db:
name: hue
owner: hue
lc_collate: en_US.UTF-8
template: template0
- name: Cria Usuario oozie
postgresql_user:
name: oozie
password: oozie123
role_attr_flags: NOSUPERUSER,INHERIT,CREATEDB,NOCREATEROLE
- name: Cria Database oozie
postgresql_db:
name: oozie
encoding: UTF-8
tablespace: pg_default
lc_collate: en_US.UTF-8
lc_ctype: en_US.UTF-8
template: template0
conn_limit: "-1"