diff --git a/README.md b/README.md index f257512..fbb3ece 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ The MySQL root user account password. Whether MySQL should be enabled on startup. + overwrite_global_mycnf: yes + +Whether the global my.cnf should be overwritten each time ansible runs. "no" will only create the file if it doesn't exist. + 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 993f3a3..d373ff6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,6 +5,9 @@ mysql_root_password: root mysql_enabled_on_startup: yes +# update my.cnf. each time role is run? yes | no +overwrite_global_mycnf: 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 a0e8b18..f2bb5a6 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -6,6 +6,7 @@ owner: root group: root mode: 0644 + force: "{{ overwrite_global_mycnf }}" notify: restart mysql - name: Ensure MySQL is started and enabled on boot.