-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.yml
162 lines (132 loc) · 5.06 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
149
150
151
152
153
154
155
156
157
158
159
160
161
---
- hosts: all
user: vagrant
vars_files:
- vars/default-settings.yml
tasks:
- name: Update apt
apt: update_cache=yes
# Ensure python software properties are installed
- name: Install All System Dependencies
apt: pkg=$item state=installed update_cache=yes
with_items:
- make
- python-software-properties
- g++
- make
- build-essential
- openssl
- libreadline6
- libreadline6-dev
- curl
- libcurl4-openssl-dev
- git-core
- zlib1g
- zlib1g-dev
- libssl-dev
- libyaml-dev
- libsqlite3-dev
- sqlite3
- libxml2-dev
- autoconf
- libc6-dev
- automake
- libtool
- bison
- subversion
- pkg-config
- ruby1.9.1-dev
- python-dev
- libxml2-dev
- libxslt1-dev
- php5
- apache2
- mysql-server
- mysql-client
- php5-mysql
- php-apc
- php5-xmlrpc
- php-soap
- php5-gd
- sendmail
- unzip
- python-mysqldb
##
# PHP Setup.
#
- name: PHP | Configuration file, php.ini
action: template src=templates/etc-php5-apache2-php-ini.j2 dest=/etc/php5/apache2/php.ini
tags: common
- name: APC | Cache configuration file, apc.ini
action: template src=templates/etc-php5-conf-d-apc-ini.j2 dest=/etc/php5/conf.d/apc.ini
tags: common
##
# MySQL database setup.
#
- name: MySQL | Configuration file, my.cnf
action: template src=templates/etc-mysql-my-cnf.j2 dest=/etc/mysql/my.cnf
tags: common
- include: tasks/mysql-secure.yml
##
# Apache2 setup.
#
- name: Apache | Enable some required modules
action: command a2enmod rewrite vhost_alias
tags: common
- name: Apache | Configuration file for our site
action: template src=templates/etc-apache2-sites-available-devserver.j2 dest=/etc/apache2/sites-available/devserver
tags: common
- name: Apache | apache2.conf
action: template src=templates/apache2.conf.j2 dest=/etc/apache2/apache2.conf
tags: common
# - name: Apache | Disable the default site
# action: command a2dissite default
# tags: common
# - name: Apache | Enable our new site
# action: command a2ensite devserver
# tags: common
- name: Set Proper ownership of /var/www
command: chown -hR www-data:www-data /var/www
- name: Ensure www-data can read and write files but does not alter other permissions
command: chmod -R g+rw /var/www
- name: Ensure www-data can list directories but does not alter bit x for files.
command: "find /var/www -type d -ls -exec chmod g+x {} ';'"
- name: Adding vagrant to group
command: usermod -aG www-data vagrant
# Create required writeable dirs
- name: Create mainsite/www/assets
file: path=/var/www/mainsite/www/assets owner="www-data" group="www-data" mode=0755 state=directory recurse=yes
tags: common
- name: Create mainsite/runtime
file: path=/var/www/mainsite/runtime owner="www-data" group="www-data" mode=0755 state=directory recurse=yes
tags: common
- name: Create mainsite/www/uploads
file: path=/var/www/mainsite/www/uploads owner="www-data" group="www-data" mode=0755 state=directory recurse=yes
tags: common
- name: Create mainsite/rebuild
file: path=/var/www/mainsite/rebuild owner="www-data" group="www-data" mode=0755 state=directory recurse=yes
tags: common
- name: Create mainsite/modules/menuAdmin/temp
file: path=/var/www/mainsite/modules/menuAdmin/temp owner="www-data" group="www-data" mode=0755 state=directory recurse=yes
tags: common
- name: Create mainsite/controllers/csvdumps
file: path=/var/www/mainsite/controllers/csvdumps owner="www-data" group="www-data" mode=0755 state=directory recurse=yes
tags: common
- name: Create mobile/runtime
file: path=/var/www/mobile/runtime owner="www-data" group="www-data" mode=0755 state=directory recurse=yes
tags: common
- name: Create mobile/www/assets
file: path=/var/www/mobile/www/assets owner="www-data" group="www-data" mode=0755 state=directory recurse=yes
tags: common
- name: Create common/vendors/phpqrcode/cache
file: path=/var/www/common/vendors/phpqrcode/cache owner="www-data" group="www-data" mode=0755 state=directory recurse=yes
tags: common
##
# Restart services
#
- name: Restart Apache
action: service name=apache2 state=restarted
tags: common
- name: Restart MySQL
action: service name=mysql state=restarted
tags: common