-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdroid.yml
87 lines (83 loc) · 2.76 KB
/
droid.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
description: "Install MySQL Server"
variables:
use_legacy_templating: true
mysql_bind_address: 0.0.0.0
mysql_server_id: ~
mysql_server_package: mysql-server
mysql_root_password: ~
tasks:
-
name: "Copy a file of debconf database entries to answer the MySQL/MariaDB root password question"
command: "fs:copy"
arguments:
src: "!{{ mod_path}}/assets/debconf-selections.template"
dest: "/tmp/debconf-selections-{{ mysql_server_package }}"
-
name: "Insert the debconf database MySQL root password entries"
command: "debconfdb:set"
sudo: true
arguments:
file: "/tmp/debconf-selections-{{ mysql_server_package }}"
-
name: "Install package {{ mysql_server_package }} and php5-mysql"
command: "apt-get:install"
sudo: true
max_runtime: 600
arguments:
package: "{{ mysql_server_package }} php5-mysql"
-
name: "Copy tuning configuration to the server"
command: "fs:copy"
sudo: true
arguments:
src: "!{{ mod_path}}/assets/tuning.cnf.template"
dest: "/etc/mysql/conf.d/tuning.cnf"
trigger: "Restart mysql-server"
-
name: "Copy replication master configuration to the master"
command: "fs:copy"
sudo: true
arguments:
src: "!{{ mod_path}}/assets/master.cnf.template"
dest: "/etc/mysql/conf.d/master.cnf"
host_filter: "host.variables['replication_role'] == 'master'"
trigger: "Restart mysql-server"
-
name: "Copy replication slave configuration to the slave"
command: "fs:copy"
sudo: true
arguments:
src: "!{{ mod_path}}/assets/slave.cnf.template"
dest: "/etc/mysql/conf.d/slave.cnf"
host_filter: "host.variables['replication_role'] == 'slave'"
trigger: "Restart mysql-server"
-
name: "Create a MySQL remote root account for management"
command: "mysql:adduser"
arguments:
url: "mysql://root:{{{ mysql_root_password }}}@localhost/"
username: "root"
password: "{{{ mysql_root_password }}}"
allowed-host: "any"
grant: "all"
grant-level: "*.*"
can-grant: ~
-
name: "Create custom MySQL user accounts"
command: "mysql:adduser"
arguments:
url: "mysql://root:{{{ mysql_root_password }}}@localhost/"
username: "{{{ item.username }}}"
password: "{{{ item.password }}}"
allowed-host: "{{{ item.allowed-host }}}"
grant: "{{{ item.grant }}}"
grant-level: "{{{ item.grant-level }}}"
with_items:
mysql_users
triggers:
-
name: "Restart mysql-server"
command: "service:restart"
sudo: true
arguments:
name: "mysql"