-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.yml
51 lines (45 loc) · 1.22 KB
/
deploy.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
---
- name: Create Users
hosts: all
roles:
- role: ansible_galaxy_role.motd
- { role: ansible_galaxy_role.users, users_list: '{{homeco_admins}}', sudo_access: 'yes' }
- { role: ansible_galaxy_role.users, users_list: '{{homeco_developers}}' }
- { role: ansible_galaxy_role.users, users_list: '{{users_old}}', delete_users: 'yes' }
# Setup prompt to include the instance custom name
- name: Setup prompt
hosts: all
tasks:
- name: cp prompt.sh
copy:
src: prompt.sh
dest: /etc/profile.d/prompt.sh
owner: root
group: root
mode: 0644
- name: Disable root login
hosts: all
tasks:
- name: edit /etc/ssh/sshd_config
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^.*PermitRootLogin .*'
line: 'PermitRootLogin no'
state: present
notify:
- Restart ssh
handlers:
- name: Restart ssh
service: name=sshd state=restarted
- name: Setup FirewallD
hosts: all
tags: setup_firewalld
tasks:
- name: systemctl start firewalld
service: name=firewalld enabled=yes state=started
- name: Allow SSH
firewalld:
permanent: yes
immediate: yes
service: ssh
state: enabled