I have been doing this manually by uncommenting the last lines in the /etc/mysql/mysql.conf.d/mysqld.cnf
# 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
# other settings you may need to change.
# server-id = 1
# log_bin = /var/log/mysql/mysql-bin.log
# binlog_expire_logs_seconds = 2592000
max_binlog_size = 100M
# binlog_do_db = include_database_name
# binlog_ignore_db = include_database_name
However i would like to automate this with Ansible which am using to set up the database which i have already achieved.
Whats the best way to do this?
A common approach and usual way is to use the
templatemodule – Template a file out to a target hostand a task like
Further Documenation