This repository has been archived by the owner on Jun 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.yml
148 lines (126 loc) · 3.75 KB
/
setup.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
---
- hosts: vagrant
remote_user: vagrant
become: true
vars_files:
- vars/deployment_vars.yml
- vars/deployment_vars_local.yml
tasks:
- name: FUEL | Install unzip
apt: pkg=unzip state=latest update_cache=yes
- name: FUEL | Install MySQL client, server and related libraries
apt: pkg={{ item }} state=latest
with_items:
- mysql-client
- mysql-server
- python-mysqldb
- name: FUEL | Install PHP and its modules
apt: pkg={{ item }} state=latest
with_items:
- php5
- php5-cli
- php5-curl
- php5-gd
- php5-imagick
- php5-mysql
- php5-xmlrpc
- name: FUEL | Change PHP upload_max_filesize
ini_file: dest=/etc/php5/apache2/php.ini
section=PHP
option=upload_max_filesize
value=500M
state=present
backup=yes
follow=yes
- name: FUEL | Change PHP post_max_size
ini_file: dest=/etc/php5/apache2/php.ini
section=PHP
option=post_max_size
value=500M
state=present
backup=yes
follow=yes
- name: FUEL | Install Apache and its modules
apt: pkg={{ item }} state=latest
with_items:
- apache2
- libapache2-mod-php5
- name: FUEL | Activate mod_rewrite
apache2_module: name=rewrite state=present
- name: FUEL | Start MySQL service
service:
name: "mysql"
state: started
enabled: yes
- name: FUEL | Setup MySQL root password
mysql_user:
name: "root"
password: "mysql"
host: "{{ item }}"
state: present
with_items:
- "{{ ansible_hostname }}"
- 127.0.0.1
- ::1
- localhost
- name: FUEL | Setup MySQL creds for root user
template:
src: "{{ mysqlTemplatePath }}"
dest: "/root/.my.cnf"
owner: "root"
mode: 0600
- name: FUEL | Delete blank MySQL users
mysql_user:
name: ""
host: "{{ item }}"
state: absent
with_items:
- "{{ ansible_hostname }}"
- 127.0.0.1
- ::1
- localhost
- name: FUEL | Drop MySQL test database
mysql_db: name=test state=absent
- name: FUEL | Setup empty database for WordPress
mysql_db:
name: "wordpress"
encoding: "utf8"
collation: "utf8_unicode_ci"
state: "present"
login_user: "root"
login_password: "mysql"
- name: FUEL | Setup MySQL user for WordPress
mysql_user:
name: "user_wp"
password: "wordpress"
host: "localhost"
priv: "wordpress.*:ALL"
state: "present"
- name: FUEL | Put "vagrant" user in www-data group
user:
name: "vagrant"
groups: "www-data"
append: yes
- name: FUEL | Symlink web root to unzipped WordPress
file:
src: "/vagrant"
dest: "/var/www/site"
state: "link"
- name: FUEL | Copy virtual host setup over
template: src={{ vhostTemplatePath }} dest=/etc/apache2/sites-available/
- name: FUEL | Activate virtual host
command: a2ensite vhost
- name: FUEL | Deactivate default vhost
command: a2dissite 000-default
- name: FUEL | Ensure Apache is running
service: name=apache2 state=restarted enabled=yes
- name: FUEL | Install Composer
get_url:
url=https://github.com/composer/composer/releases/download/1.10.7/composer.phar
dest=/usr/bin/composer
mode=0755
- name: FUEL | Install WP-CLI
get_url:
url=https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
dest=/usr/bin/wp
mode=0755