[mysqld] bind-address = "0.0.0.0" {% if ansible_hostname == mysql.replication_master_hostname %} server-id = 1 expire_logs_days = 10 max_binlog_size = 100M log-bin = /var/log/mysql/mysql-bin.log binlog_do_db = {{ wordpress.db_name }} {% endif %} {% for item in mysql.replication_slaves %} {% if ansible_hostname == item %} server-id = {{ loop.index0 + 2}} relay-log = /var/log/mysql/mysql-relay-bin.log {% endif %} {% endfor %}