--- # This installs mariadb and galera on db nodes # https://mariadb.com/blog/devops-mariadb-part-1 # https://mariadb.com/blog/devops-mariadb-and-ansible-part-2 - name: Modify configuration file to setup server ID lineinfile: dest=/etc/mysql/my.cnf regexp="^#server-id" line="server-id=2" - name: Setup replication command: /usr/bin/mysql -uroot -e "CHANGE MASTER TO master_host='192.168.50.2', master_user='repl', master_password='{{ replication_password }}', master_use_gtid=current_pos" - name: Restart mysql service service: name=mysql state=restarted