forked from phpservermon/phpservermon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision.yaml
70 lines (53 loc) · 1.9 KB
/
provision.yaml
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
---
- hosts: all
become: yes
become_method: sudo
tasks:
- name: Update OS
package:
name: '*'
state: latest
- name: wget percona release installation file
shell: cd /root/ && wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb; dpkg -i /root/percona-release_latest.$(lsb_release -sc)_all.deb
- name: setup percona repositories to percona server 5.7
shell: percona-release setup ps57
- name: Update repositories cache
apt:
update_cache: yes
- name: ensure nginx is at the latest version
apt: name=nginx state=latest
- name: start nginx
service:
name: nginx
state: started
- name: Add nginx stable repository from PPA and install its signing key on Ubuntu target
ansible.builtin.apt_repository:
repo: ppa:ondrej/php
- name: ensure php7.4-fpm is at the latest version
apt: name=php7.4-fpm state=latest
- name: install php7.4-curl
apt: name=php7.4-curl state=latest
- name: install php7.4-xml
apt: name=php7.4-xml state=latest
- name: install php7.4-pdo
apt: name=php7.4-pdo state=latest
- name: install php7.4-mysql
apt: name=php7.4-mysql state=latest
- name: ensure gpupg2 is at the latest version
apt: name=gnupg2 state=latest
- name: ensure percona-server-57 is installed
apt: name=percona-server-server-5.7 state=latest
# - name: Create a new database with name 'psm'
# shell: mysql -e "CREATE DATABASE psm;"
- name: setup mysql
shell: /vagrant/setup-mysql.sh
- name: copy psm nginx vhost
shell: /bin/cp -far /vagrant/dev/phpservermon-default /etc/nginx/sites-available/default
- name: setup php dependencies
shell: /vagrant/setup-php.sh
- name: copy psm config file
shell: /bin/cp -far /vagrant/dev/vagrant-config.php /vagrant/config.php
- name: apply nginx modifications
service:
name: nginx
state: restarted