mirror of
https://github.com/aljazceru/ansible-role-mysql.git
synced 2026-01-06 23:24:26 +01:00
Add mysql_state and mysql_enabled_on_startup options.
This commit is contained in:
@@ -20,6 +20,11 @@ The home directory inside which Python MySQL settings will be stored, which Ansi
|
||||
|
||||
The MySQL root user account password.
|
||||
|
||||
mysql_state: started
|
||||
mysql_enabled_on_startup: yes
|
||||
|
||||
MySQL's state (`started`, `stopped`, `restarted`, `reloaded`), and whether to enable MySQL on startup.
|
||||
|
||||
mysql_databases: []
|
||||
|
||||
The MySQL databases to create. A database has the values `name`, `encoding` (defaults to `utf8`), `collation` (defaults to `utf8_general_ci`) and `replicate` (defaults to `1`, only used if replication is configured). The formats of these are the same as in the `mysql_db` module.
|
||||
|
||||
@@ -3,6 +3,9 @@ mysql_user_home: /root
|
||||
mysql_root_username: root
|
||||
mysql_root_password: root
|
||||
|
||||
mysql_state: started
|
||||
mysql_enabled_on_startup: yes
|
||||
|
||||
# Pass in a comma-separated list of repos to use (e.g. "remi,epel"). Used only
|
||||
# for RedHat systems (and derivatives).
|
||||
mysql_enablerepo: ""
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
notify: restart mysql
|
||||
|
||||
- name: Ensure MySQL is started and enabled on boot.
|
||||
service: "name={{ mysql_daemon }} state=started enabled=yes"
|
||||
service: "name={{ mysql_daemon }} state={{ mysql_state }} enabled={{ mysql_enabled_on_startup }}"
|
||||
|
||||
Reference in New Issue
Block a user