diff --git a/README.md b/README.md index 3e7bad4..6283dcf 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/defaults/main.yml b/defaults/main.yml index 89cf286..97f6c62 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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: "" diff --git a/tasks/configure.yml b/tasks/configure.yml index 008a354..f22a923 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -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 }}"