-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathall.json
More file actions
157 lines (157 loc) · 5 KB
/
Copy pathall.json
File metadata and controls
157 lines (157 loc) · 5 KB
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
[
{
"hosts": "all",
"gather_facts": "false",
"remote_user": "root",
"tasks": [
{
"name": "Update",
"raw": "apt-get -y --allow-unauthenticated update || true"
},
{
"name": "Ensure python is available",
"raw": "test -e /usr/bin/python || apt install -y --allow-unauthenticated python-minimal"
},
{
"name": "Ensure python-apt is available",
"raw": "test -d /usr/share/python-apt || apt install -y --allow-unauthenticated python-apt"
},
{
"name": "Upgrade",
"raw": "apt-get -y --allow-unauthenticated upgrade"
}
]
},
{
"hosts": "wp",
"remote_user": "root",
"tasks": [
{
"name": "install php",
"apt": {
"name": "php7.0",
"allow_unauthenticated": "yes",
"update_cache": "no"
}
},
{
"name": "install php-cgi",
"apt": {
"name": "php7.0-cgi",
"allow_unauthenticated": "yes",
"update_cache": "no"
}
},
{
"name": "install php-mysql",
"apt": {
"name": "php7.0-mysql",
"allow_unauthenticated": "yes",
"update_cache": "no"
}
},
{
"name": "install apache2",
"apt": {
"name": "apache2",
"allow_unauthenticated": "yes",
"update_cache": "no"
}
},
{
"name": "install mariadb",
"apt": {
"name": "mariadb-server",
"allow_unauthenticated": "yes",
"update_cache": "no"
}
},
{
"name": "install python-mysqldb",
"apt": {
"name": "python-mysqldb",
"allow_unauthenticated": "yes",
"update_cache": "no"
}
},
{
"name": "create database",
"mysql_db": {
"name": "wordpress",
"state": "present",
"encoding": "utf8"
}
},
{
"name": "create database user",
"mysql_user": {
"name": "wordpress",
"password": "wordpress",
"priv": "wordpress.*:ALL"
}
},
{
"name": "get wp-cli",
"get_url": {
"url": "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar",
"dest": "/usr/local/bin/wp",
"validate_certs": "no"
}
},
{
"name": "make wp-cli executable",
"file": {
"path": "/usr/local/bin/wp",
"state": "touch",
"mode": "u+rwx,g+rx,o+rx"
}
},
{
"name": "download wp core",
"command": "wp core download --allow-root",
"args": {
"chdir": "/var/www/html",
"creates": "/var/www/html/index.php"
}
},
{
"name": "create wp config",
"command": "wp config create --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --allow-root",
"args": {
"chdir": "/var/www/html",
"creates": "/var/www/html/wp-config.php"
}
},
{
"name": "install wp",
"command": "wp core install --url={{domain_name}} --title='{{site_title}}' --admin_user={{admin_user}} --admin_password={{admin_pwd}} --admin_email=info@wp-cli.org --allow-root",
"args": {
"chdir": "/var/www/html"
}
},
{
"name": "remove index.html",
"file": {
"name": "/var/www/html/index.html",
"state": "absent"
}
},
{
"name": "change file ownership",
"file": {
"path": "/var/www/html",
"recurse": "yes",
"owner": "www-data",
"group": "www-data"
}
},
{
"name": "restart apache",
"service": {
"name": "apache2",
"state": "restarted"
}
}
]
}
]