-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.yml
executable file
·144 lines (119 loc) · 3.42 KB
/
install.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
# Install LAMP server with laravel
---
- hosts: all
user: ansible
sudo: yes
vars:
mysql_phpmyadmin_password: mysqlphpmyadminpassword
tasks:
- name: Test connection
ping:
- name: Remove php5
shell: apt-get remove php5* -y
- name: Install required software
apt: name={{ item }} state=present update_cache=yes
with_items:
- apache2
- libapache2-mpm-itk
- software-properties-common
- python-software-properties
- python-mysqldb
- git
- curl
- name: Install php repository
shell: add-apt-repository ppa:ondrej/php
- name: Install mysql repository
shell: add-apt-repository ppa:ondrej/mysql-5.7
- name: Install php7 and mysql-5.7
apt: name={{ item }} state=present update_cache=yes force=yes
with_items:
- php7.0
- php7.0-fpm
- php7.0-cli
- php7.0-common
- php7.0-mysql
- php7.0-curl
- php7.0-gd
- php7.0-cgi
- php7.0-phpdbg
- php7.0-fpm
- libphp7.0-embed
- php7.0-enchant
- php7.0-gmp
- php7.0-imap
- php7.0-interbase
- php7.0-intl
- php7.0-ldap
- php7.0-mcrypt
- php7.0-readline
- php7.0-odbc
- php7.0-pgsql
- php7.0-pspell
- php7.0-recode
- php7.0-snmp
- php7.0-tidy
- php7.0-xmlrpc
- php7.0-xsl
- php7.0-json
- php7.0-sybase
- php7.0-sqlite3
- php7.0-opcache
- php7.0-bz2
- php7.0-mbstring
- php7.0-zip
- libapache2-mod-php7.0
- mysql-server-5.7
- name: Apache module enable
apache2_module: state=present name={{ item }}
with_items:
- rewrite
- alias
- auth_basic
- authn_file
- authz_groupfile
- authz_host
- authz_user
- autoindex
- cgi
- deflate
- dir
- env
- expires
- headers
- mime
- negotiation
- reqtimeout
- setenvif
- status
- mpm_itk
# - name: Install other software
# apt: name={{ item }} state=present update_cache=yes
# with_items:
# - phpmyadmin
- name: ensure anonymous users are not in the database
mysql_user: name='' host=$item state=absent
with_items:
- localhost
- $inventory_hostname
- name: remove the test database
mysql_db: name=test state=absent
- name: Set phpmyadmin (with root privs) user password
mysql_user: name=phpmyadmin
password="{{ mysql_phpmyadmin_password }}"
check_implicit_admin=yes
login_user="root"
state=present
host=localhost
priv=*.*:ALL,GRANT
- name: Create phpmyadmin dir
file: path=/usr/share/phpmyadmin state=directory
# - name: Clone phpmyadmin from git
# shell: git clone --depth=1 --branch=STABLE https://github.com/phpmyadmin/phpmyadmin.git /usr/share/phpmyadmin
- name: Get phpmyadmin from git
git: clone=yes depth=1 version=STABLE repo=https://github.com/phpmyadmin/phpmyadmin.git dest=/usr/share/phpmyadmin
- name: Copy apache default for phpmyadmin
copy: src=files/000-default.conf dest=/etc/apache2/sites-available/000-default.conf
- name: Install composer
shell: curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
- name: Service apache restarted
service: name=apache2 state=restarted