-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservers.yml
63 lines (50 loc) · 1.37 KB
/
servers.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
# From: https://github.com/ansible/ansible-examples/blob/master/lamp_simple/site.yml
#
### Begin Ansible Dependencies
# Ansible needs some dependencies: http://docs.ansible.com/ansible/intro_installation.html
# Detect if the client has python-apt. If not, install all listed dependencies.
- name: Install Ansible Dependencies
hosts: ubuntuservers
remote_user: root
gather_facts: no
pre_tasks:
- raw: if [ 1 -gt $(grep -c 'install ok installed' <<< `dpkg -s python-apt`) ]; then apt-get update; apt-get -y install python-simplejson python-apt; fi;
### End Ansible Dependencies
- name: apply common configuration to all nodes
hosts: ubuntuservers
remote_user: root
roles:
- common
- sshdconfig
- pip
- sudo
- adminuser
- dotfiles
- swapfile
- journalctl
- unattended-upgrades
- name: deploy apache2 configured for vhosts
hosts: apache2servers
remote_user: root
roles:
- apache2servers
- name: deploy MySQL and configure the databases
hosts: mysqlservers
remote_user: root
roles:
- mysqlservers
- name: deploy WordPress dependencies
hosts: wpservers
remote_user: root
roles:
- wpservers
- name: deploy frontend nodejs dependencies
hosts: nodejs
remote_user: root
roles:
- nodejs
- name: check restart status and restart if required
hosts: ubuntuservers
remote_user: root
roles:
- rebooter