diff --git a/defaults/main.yml b/defaults/main.yml index a8156a8045ecfa7568c261eea6fea75659101034..cb9de4d451209c1b3acef4947396614a3dcd64d9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -34,8 +34,8 @@ mysql_tmp_table_size: 32M mysql_wait_timeout: 28800 mysql_repl_password: repl -mysql_repl_master: no -mysql_repl_slave: no +mysql_repl_primary: no +mysql_repl_secondary: no mysql_server_id: 0 mysqlbackup: diff --git a/tasks/main.yml b/tasks/main.yml index f0846adac85cc4d839dc0618114357e82102b859..3692e053f7db192fa2aeb8d57ea34c0febd812d5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -85,13 +85,13 @@ notify: - Restart MySQL - - name: Import master - import_tasks: master.yml - when: mysql_repl_master + - name: Import primary + import_tasks: primary.yml + when: mysql_repl_primary - - name: Import slave - import_tasks: slave.yml - when: mysql_repl_slave + - name: Import secondary + import_tasks: secondary.yml + when: mysql_repl_secondary - name: Import backup import_tasks: backup.yml diff --git a/tasks/master.yml b/tasks/primary.yml similarity index 71% rename from tasks/master.yml rename to tasks/primary.yml index 028552702c145645a9f5a8d7c3fa644feb9f5c8b..077844405c11eaed2d932c674443842b4be30d94 100644 --- a/tasks/master.yml +++ b/tasks/primary.yml @@ -1,7 +1,7 @@ --- -# file: roles/mysql/tasks/master.yml +# file: roles/mysql/tasks/primary.yml -- name: Master | Define replication user and privileges +- name: Primary | Define replication user and privileges mysql_user: user: repl password: '{{mysql_repl_password}}' diff --git a/tasks/secondary.yml b/tasks/secondary.yml new file mode 100644 index 0000000000000000000000000000000000000000..e27f779ccedaacce0eb817cb9a8d2d58132d5a8a --- /dev/null +++ b/tasks/secondary.yml @@ -0,0 +1,5 @@ +--- +# file: roles/mysql/tasks/secondary.yml + +- name: Secondary | Status + debug: msg="Currently nothing to do yet" diff --git a/tasks/slave.yml b/tasks/slave.yml deleted file mode 100644 index 8c9091fe4356434308606f80b1f9fb842561465b..0000000000000000000000000000000000000000 --- a/tasks/slave.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# file: roles/mysql/tasks/slave.yml - -- name: Slave | Status - debug: msg="Currently nothing to do yet" diff --git a/templates/automysqlbackup.conf b/templates/automysqlbackup.conf index 39a8845bf9a6c23ec8529c7286929eac17a888a9..6adf3d113c4ed2364cc42c476de10c82dc5e8f8c 100644 --- a/templates/automysqlbackup.conf +++ b/templates/automysqlbackup.conf @@ -144,9 +144,9 @@ CONFIG_mysql_dump_usessl='no' # http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html#option_mysqldump_master-data # --master-data[=value] # Use this option to dump a master replication server to produce a dump file that can be used to set up another -# server as a slave of the master. It causes the dump output to include a CHANGE MASTER TO statement that indicates +# server as a secondary of the primary. It causes the dump output to include a CHANGE MASTER TO statement that indicates # the binary log coordinates (file name and position) of the dumped server. These are the master server coordinates -# from which the slave should start replicating after you load the dump file into the slave. +# from which the secondary should start replicating after you load the dump file into the secondary. # # If the option value is 2, the CHANGE MASTER TO statement is written as an SQL comment, and thus is informative only; # it has no effect when the dump file is reloaded. If the option value is 1, the statement is not written as a comment diff --git a/templates/etc-mysql-my-cnf b/templates/etc-mysql-my-cnf index 9283079f46a4fac9010b101a4bc267bc0968f00d..fd02ca906fd28a59eb4cd9f82948e6504b1785a8 100644 --- a/templates/etc-mysql-my-cnf +++ b/templates/etc-mysql-my-cnf @@ -97,16 +97,16 @@ long_query_time = 2 #log-queries-not-using-indexes # # The following can be used as easy to replay backup logs or for replication. -# note: if you are setting up a replication slave, see README.Debian about +# note: if you are setting up a replication secondary, see README.Debian about # other settings you may need to change. {% if mysql_server_id > 0 %} server-id = {{ mysql_server_id }} {% endif %} -{% if mysql_repl_master %} +{% if mysql_repl_primary %} log_bin = /var/log/mysql/mysql-bin.log sync_binlog = 1 {% endif %} -{% if mysql_repl_slave %} +{% if mysql_repl_secondary %} relay_log = /var/log/mysql/mysql-relay-bin.log read_only = yes {% endif %} diff --git a/templates/etc-mysql-mysql-conf-d-mysqld.cnf b/templates/etc-mysql-mysql-conf-d-mysqld.cnf index fedacdef6031a3712d6629e4c8b2e3b4746afee6..3cf255cb4648fc02bf90ccad890b11c3c7f8f9c2 100644 --- a/templates/etc-mysql-mysql-conf-d-mysqld.cnf +++ b/templates/etc-mysql-mysql-conf-d-mysqld.cnf @@ -91,7 +91,7 @@ slow_query_log_file = /var/log/mysql/slow.log {% endif %} # # The following can be used as easy to replay backup logs or for replication. -# note: if you are setting up a replication slave, see README.Debian about +# note: if you are setting up a replication secondary, see README.Debian about # other settings you may need to change. #server-id = 1 #log_bin = /var/log/mysql/mysql-bin.log