masson
Version:
Module execution engine for cluster deployments.
76 lines (57 loc) • 2.03 kB
Markdown
* `current_password` (string)
* `password` (string)
* `my_cnf` (object)
Object to be serialized into the "ini" format inside "/etc/my.cnf"
* `root_host` (string|boolean)
Open root access to all host by default, set to "false" to disable it.
Note, root access is activated by default in order to let other service to
provision their databases and user access.
```
{ "mysql": { "server": {
"current_password": "",
"password": "{secret}",
"my_cnf": {
"mysqld": {
"port": 3306
}
},
"root_host": "%"
} } }
```
export default (service) ->
options = service.options
throw Error "Required Option: options.admin_password" unless options.admin_password
options.current_password ?= ''
options.root_host ?= '%'
options.iptables ?= service.deps.iptables and service.deps.iptables.options.action is 'start'
options.group ?= {}
options.group = name: options.group if typeof options.group is 'string'
options.group.name ?= 'mysql'
options.user ?= {}
options.user = name: options.user if typeof options.user is 'string'
options.user.name ?= 'mysql'
options.user.home ?= "/var/lib/#{options.user.name}"
options.user.gid ?= options.group.name
options.my_cnf ?= {}
options.my_cnf['mysqld'] ?= {}
options.my_cnf['mysqld']['port'] ?= '3306'
options.my_cnf['mysqld']['pid-file'] ?= '/var/run/mysqld/mysqld.pid'
options.repo ?= {}
options.repo.source ?= null
options.repo.url = null if options.repo.repo?
options.wait_tcp = {}
options.wait_tcp.fqdn = service.node.fqdn
options.wait_tcp.port = options.my_cnf['mysqld']['port']