Merge pull request #27 from BlackMesh/optional-mycnf-force

Add option to disable continued management of my.cnf.
This commit is contained in:
Jeff Geerling
2015-04-20 13:56:48 -05:00
3 changed files with 8 additions and 0 deletions

View File

@@ -24,6 +24,10 @@ The MySQL root user account password.
Whether MySQL should be enabled on startup. 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: [] 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. 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.

View File

@@ -5,6 +5,9 @@ mysql_root_password: root
mysql_enabled_on_startup: yes 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 # Pass in a comma-separated list of repos to use (e.g. "remi,epel"). Used only
# for RedHat systems (and derivatives). # for RedHat systems (and derivatives).
mysql_enablerepo: "" mysql_enablerepo: ""

View File

@@ -6,6 +6,7 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
force: "{{ overwrite_global_mycnf }}"
notify: restart mysql notify: restart mysql
- name: Ensure MySQL is started and enabled on boot. - name: Ensure MySQL is started and enabled on boot.