-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwordpress.yml
83 lines (70 loc) · 1.87 KB
/
wordpress.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
---
- hosts: web
become: yes
remote_user: ubuntu
tasks:
- name: php repo
apt_repository:
repo: ppa:ondrej/php
- name: apt update
apt:
update_cache: yes
- name: apt update all
apt:
upgrade: dist
- name: remove dependencies that are no longer required
apt:
autoremove: yes
- name: install requirements
apt:
pkg:
- mariadb-client
- apache2
- php7.4
- php-mysql
- php-curl
- php-mbstring
- php-imagick
- php-zip
- php-xml
- name: remove index.html
file:
path: /var/www/html/index.html
state: absent
- name: update php.ini -1
replace:
path: /etc/php/7.4/apache2/php.ini
regexp: 'upload_max_filesize = 2M'
replace: "upload_max_filesize = 4096M"
- name: update php.ini -2
replace:
path: /etc/php/7.4/apache2/php.ini
regexp: 'post_max_size = 8M'
replace: "post_max_size = 4096M"
- name: update php.ini -3
replace:
path: /etc/php/7.4/apache2/php.ini
regexp: 'memory_limit = 128M'
replace: "memory_limit = 256M"
- name: update php.ini -4
replace:
path: /etc/php/7.4/apache2/php.ini
regexp: 'max_execution_time = 30'
replace: "max_execution_time = 360"
- name: Download WordPress
get_url: url=http://wordpress.org/wordpress-latest.tar.gz dest=/tmp/wordpress.tar.gz
- name: Extract WordPress
command: "tar xzf /tmp/wordpress.tar.gz -C /var/www/html --strip-components 1"
- name: web folder permissions
file:
path: /var/www/html/
mode: u=rwX,g=rX,o=rX
recurse: yes
owner: www-data
group: www-data
- name: enable apache2
service:
name: apache2
enabled: yes
- name: reboot VM
reboot: