Replication OK (transfert from another git repo)

pull/6/head
Emilien Mantel 2015-08-11 10:22:58 +02:00
parent 7eed88df04
commit 16b105786b
31 changed files with 527 additions and 64 deletions

67
Vagrantfile vendored
View File

@ -5,37 +5,44 @@
Vagrant.configure("2") do |config|
vms = [
[ "wheezy-debian-mysql", "deb/wheezy-amd64" , "192.168.33.40" ],
[ "wheezy-upstream-mariadb", "deb/wheezy-amd64" , "192.168.33.42" ],
[ "wheezy-upstream-percona", "deb/wheezy-amd64" , "192.168.33.43" ],
[ "jessie-debian-mysql", "deb/jessie-amd64", "192.168.33.50" ],
[ "jessie-debian-mariadb", "deb/jessie-amd64", "192.168.33.51" ],
[ "jessie-upstream-mariadb", "deb/jessie-amd64", "192.168.33.52" ],
[ "jessie-upstream-percona", "deb/jessie-amd64", "192.168.33.53" ]
]
vms = [
["wheezy-default-mysql-master", "deb/wheezy-amd64", "192.168.200.10", ["wheezy","default","mysql","master"]],
["wheezy-default-mysql-slave", "deb/wheezy-amd64", "192.168.200.11", ["wheezy","default","mysql","slave"]],
["wheezy-upstream-mariadb-master", "deb/wheezy-amd64", "192.168.200.12", ["wheezy","upstream","mariadb","master"]],
["wheezy-upstream-mariadb-slave", "deb/wheezy-amd64", "192.168.200.13", ["wheezy","upstream","mariadb","slave"]],
["wheezy-upstream-percona-master", "deb/wheezy-amd64", "192.168.200.14", ["wheezy","upstream","percona","master"]],
["wheezy-upstream-percona-slave", "deb/wheezy-amd64", "192.168.200.15", ["wheezy","upstream","percona","slave"]],
["jessie-default-mysql-master", "deb/jessie-amd64", "192.168.200.16", ["jessie","default","mysql","master"]],
["jessie-default-mysql-slave", "deb/jessie-amd64", "192.168.200.17", ["jessie","default","mysql","slave"]],
["jessie-upstream-mariadb-master", "deb/jessie-amd64", "192.168.200.18", ["jessie","upstream","mariadb","master"]],
["jessie-upstream-mariadb-slave", "deb/jessie-amd64", "192.168.200.19", ["jessie","upstream","mariadb","slave"]],
["jessie-upstream-percona-master", "deb/jessie-amd64", "192.168.200.20", ["jessie","upstream","percona","master"]],
["jessie-upstream-percona-slave", "deb/jessie-amd64", "192.168.200.21", ["jessie","upstream","percona","slave"]],
["jessie-default-mariadb-master", "deb/jessie-amd64", "192.168.200.22", ["jessie","default","mariadb","master"]],
["jessie-default-mariadb-slave", "deb/jessie-amd64", "192.168.200.23", ["jessie","default","mariadb","slave"]]
]
config.vm.provider "virtualbox" do |v|
v.cpus = 1
v.memory = 256
end
config.vm.provider "virtualbox" do |v|
v.cpus = 1
v.memory = 256
end
vms.each do |vm|
config.vm.define vm[0] do |m|
m.vm.box = vm[1]
m.vm.network "private_network", ip: vm[2]
vms.each do |vm|
config.vm.define vm[0] do |m|
m.vm.box = vm[1]
m.vm.network "private_network", ip: vm[2]
m.vm.provision "ansible" do |ansible|
ansible.playbook = "tests/test.yml"
ansible.groups = {
"debian_mysql" => ["wheezy-debian-mysql", "jessie-debian-mysql"],
"upstream_mariadb" => ["wheezy-upstream-mariadb", "jessie-upstream-mariadb"],
"upstream_percona" => ["wheezy-upstream-percona", "jessie-upstream-percona"],
"debian_mariadb" => ["jessie-debian-mariadb"]
}
ansible.verbose = 'vv'
ansible.sudo = true
end
end
end
m.vm.provision "ansible" do |ansible|
ansible.playbook = "tests/test.yml"
ansible.groups = {
vm[3][0] => vm[0],
vm[3][1] => vm[0],
vm[3][2] => vm[0],
vm[3][3] => vm[0],
}
ansible.verbose = 'vv'
ansible.sudo = true
end
end
end
end

View File

@ -70,6 +70,51 @@ mysql_extra_configuration: []
# - key: 'innodb_awsome_feature'
# value: 1
# -------------------------------------
# Replication
# -------------------------------------
mysql_replication_master: false
mysql_replication_slave: false
# This formula don't work with vagrant! All boxes have same default ip!
mysql_server_id: "{{ ansible_default_ipv4.address | ipaddr('int') }}"
mysql_replication_user: []
mysql_replication_user: 'repl'
mysql_replication_password: 'change_me_NOW'
mysql_replication_host: '192.168.0.1'
mysql_replication_port: '3306'
mysql_backup_dir: '/var/backups/tmp-mysql'
# Master
mysql_max_binlog_size: "100M"
mysql_expire_logs_days: "10"
#
# Slave
#
mysql_slave_readonly: true
# Import data from
mysql_slave_import_data: true
# host used to create a backup (can be the master or another slave) - default: use the master
mysql_slave_import_from: "{{ mysql_replication_host }}"
# Delete dump after slave configuration (set false if you have many slaves to install, it avoids to create many dumps)
mysql_slave_import_flush_dump: true
# Slave uses mysql database from master?
mysql_slave_replicate_mysqldb: true
# Don't replicate these DBs/tables
mysql_slave_ignore_db: []
mysql_slave_ignore_table: []
# SSH user used to copy data
mysql_backup_user: "{{ ansible_user_id }}" # TODO: change var name
## If data is already imported, you can specify position
mysql_master_log_file: null
mysql_master_log_pos: null
# If true, reconfigure slave
mysql_slave_force_setup: false
# -------------------------------------
# Database / Users
# -------------------------------------

View File

@ -11,9 +11,16 @@
- name: INCLUDE | Install
include: install.yml
- name: SERVICE | Ensure daemon is started
service: name=mysql state=started
- name: TEMPLATE | Deploy configuration
template: src=etc/mysql/my.cnf.j2 dest=/etc/mysql/my.cnf
notify: restart mysql
register: config
- name: SERVICE | Restart now (prevent bugs)
service: name=mysql state=restarted
when: config.changed
- name: TEMPLATE | Deploy extra configuration
template: src=etc/mysql/conf.d/10-extra.cnf.j2 dest=/etc/mysql/conf.d/10-extra.cnf
@ -22,8 +29,13 @@
- name: TEMPLATE Create .my.cnf for root
template: src=root/my.cnf dest=/root/.my.cnf owner=root group=root mode=0600 backup=yes
- name: SERVICE | Ensure daemon is started
service: name=mysql state=started
- name: INCLUDE | Replication Master
include: replication_master.yml
when: mysql_replication_master
- name: INCLUDE | Replication slave
include: replication_slave.yml
when: mysql_replication_slave
- name: INCLUDE | Secure install
include: 'secure.yml'

View File

@ -0,0 +1,5 @@
---
- name: TEMPLATE | Deploy master configuration
template: src=etc/mysql/conf.d/50-master.cnf.j2 dest=/etc/mysql/conf.d/50-master.cnf
notify: restart mysql

View File

@ -0,0 +1,38 @@
---
- name: MYSQL_VARIABLES | Set read only
mysql_variables: variable=read_only value=ON
when: mysql_slave_readonly
- name: TEMPLATE | Deploy slave configuration
template: src=etc/mysql/conf.d/51-slave.cnf.j2 dest=/etc/mysql/conf.d/51-slave.cnf
notify: restart mysql
- name: MYSQL_REPLICATION | Get slave status
mysql_replication: mode=getslave
ignore_errors: yes
register: slave_status
- name: INCLUDE | Import data
include: slave/import_data.yml
when: slave_status.failed is defined and mysql_slave_import_data
- name: INCLUDE | Configure replication
include: slave/replication.yml
when: slave_status.failed is defined or mysql_slave_force_setup
- name: INCLUDE | Transfert /etc/mysql/debian.cnf from master
include: slave/debiancnf.yml
when: mysql_slave_replicate_mysqldb
- name: MYSQL_REPLICATION | Get slave status
mysql_replication: mode=getslave
ignore_errors: yes
register: slave_status
- name: Configure MariaDB GTID
include: slave/mariadb_gtid.yml
when: >
mysql_vendor == 'mariadb' and
slave_status.Using_Gtid == 'No' and
mysql_mysql_gtid

View File

@ -0,0 +1,21 @@
---
- name: FETCH | Get /etc/mysql/debian.cnf on master
fetch: >
src=/etc/mysql/debian.cnf
dest=/tmp/{{ mysql_slave_import_from }}/debian.cnf
flat=yes
changed_when: false
delegate_to: "{{ mysql_slave_import_from }}"
- name: LOCAL_ACTION FILE | Secure fetched file
local_action: file path=/tmp/{{ mysql_slave_import_from }}/debian.cnf mode=0600
become: no
- name: COPY | Fetched file to /etc/mysql/debian.cnf
copy: >
src=/tmp/{{ mysql_slave_import_from }}/debian.cnf
dest=/etc/mysql/debian.cnf
owner=root group=root mode=0600
notify: restart mysql

View File

@ -0,0 +1,72 @@
---
# Doc: https://www.percona.com/doc/percona-xtrabackup/2.1/howtos/recipes_ibkx_gtid.html
- name: WAIT_FOR | source data (prevent rsync bug) - TODO find another hack
wait_for: host={{ mysql_slave_import_from }} port=22
- name: COMMAND | Prepare backup another server
command: innobackupex --no-timestamp {{ mysql_backup_dir }} creates={{ mysql_backup_dir }}
delegate_to: "{{ mysql_slave_import_from }}"
register: backup
- name: SHELL | Dump
shell: innobackupex --apply-log {{ mysql_backup_dir }}
delegate_to: "{{ mysql_slave_import_from }}"
when: backup.changed
- name: FILE | Remove mysql db from backup
file: path={{ mysql_backup_dir }}/mysql state=absent
delegate_to: "{{ mysql_slave_import_from }}"
when: backup.changed and not mysql_slave_replicate_mysqldb
- name: MYSQL_VARIABLES | Get datadir
mysql_variables: variable=datadir
register: datadir
- name: SET_FACT | related to mysql datadir
set_fact:
mysql_mysql_datadir: "{{ datadir.msg[0][1] }}"
mysql_binlog_info: "{{ datadir.msg[0][1] }}/xtrabackup_binlog_info"
- name: SERVICE | Stop MySQL before importing data
service: name=mysql state=stopped
- name: COMMAND | Sync backup to slave - TODO remove vagrant as static user (see why mysql_backup_user is not working)
shell: "sudo -E rsync --rsync-path='sudo rsync' -a -e 'ssh -o StrictHostKeyChecking=no' vagrant@{{ mysql_slave_import_from }}:{{ mysql_backup_dir }}/ {{ mysql_mysql_datadir }}/"
become: no
- name: FILE | Re-apply owner
file: >
path={{ mysql_mysql_datadir }}
state=directory
owner=mysql
group=mysql
recurse=yes
- name: SERVICE | Start MySQL
service: name=mysql state=started
- name: SHELL | Get master_log_file
command: awk '{ print $1 }' {{ mysql_binlog_info }}
register: master_log_file
- name: SHELL | Get master_log_pos
command: awk '{ print $2 }' {{ mysql_binlog_info }}
register: master_log_pos
- name: SHELL | Get master GTID
command: awk '{ print $3 }' {{ mysql_binlog_info }}
register: master_gtid
- name: SET_FACT | master_log_file
set_fact:
mysql_master_log_file: "{{ master_log_file.stdout }}"
mysql_master_log_pos: "{{ master_log_pos.stdout }}"
mysql_master_gtid: "{{ master_gtid.stdout }}"
- name: FILE | Delete dump
file: path={{ mysql_backup_dir }} state=absent
delegate_to: "{{ mysql_slave_import_from }}"
when: mysql_slave_import_flush_dump

View File

@ -0,0 +1,14 @@
---
# Need this hack before:
# - https://github.com/ansible/ansible-modules-extras/issues/817
# - https://mariadb.com/kb/en/mariadb/global-transaction-id/#switching-an-existing-old-style-slave-to-use-gtid
- name: MYSQL_REPLICATION | Stop slave
mysql_replication: mode=stopslave
- name: COMMAND | Migrate to MariaDB GTID
command: mysql -e "CHANGE MASTER TO master_use_gtid=current_pos";
- name: MYSQL_REPLICATION | Start slave
mysql_replication: mode=startslave

View File

@ -0,0 +1,23 @@
---
- name: MYSQL_REPLICATION | Stop slave
mysql_replication: mode=stopslave
- name: MYSQL_REPLICATION | Configure master host
mysql_replication: >
mode=changemaster
master_host={{ mysql_replication_host }}
master_port={{ mysql_replication_port }}
master_user={{ mysql_replication_user }}
master_password={{ mysql_replication_password }}
- name: MYSQL_REPLICATION | Change master
mysql_replication: >
mode=changemaster
master_log_file={{ mysql_master_log_file }}
master_log_pos={{ mysql_master_log_pos }}
when: mysql_master_log_file is defined and mysql_master_log_pos is defined
- name: MYSQL_REPLICATION | Start slave
mysql_replication: mode=startslave

View File

@ -0,0 +1,15 @@
#
# {{ ansible_managed }}
#
#
# Replication master
[mysqld]
server_id={{ mysql_server_id }}
log-bin
# MariaDB only?
#gtid_domain_id=1
; vim: set ft=dosini :

View File

@ -0,0 +1,26 @@
#
# {{ ansible_managed }}
#
#
# Replication slave
[mysqld]
server_id={{ mysql_server_id }}
{% if mysql_slave_readonly %}
read-only
{% endif %}
# --> Ignore DB/tables
{% if not mysql_slave_replicate_mysqldb %}
replicate-ignore-db=mysql
{% endif %}
{% for db in mysql_slave_ignore_db %}
replicate-ignore-db={{ db }}
{% endfor %}
{% for t in mysql_slave_ignore_table %}
replicate-ignore-table={{ t }}
{% endfor %}
# <-- Ignore DB/tables
; vim: set ft=dosini :

View File

@ -12,16 +12,17 @@ bind-address = {{ mysql_bind_address }}
datadir = {{ mysql_datadir }}
socket = {{ mysql_socket }}
# TODO: FIX later
# Logging configuration.
{% if mysql_log_error == 'syslog' or mysql_log == 'syslog' %}
syslog
syslog-tag = {{ mysql_syslog_tag }}
{% else %}
{% if mysql_log %}
log = {{ mysql_log }}
{% endif %}
log-error = {{ mysql_log_error }}
{% endif %}
#{% if mysql_log_error == 'syslog' or mysql_log == 'syslog' %}
#syslog
#syslog-tag = {{ mysql_syslog_tag }}
#{% else %}
#{% if mysql_log %}
#log = {{ mysql_log }}
#{% endif %}
#log-error = {{ mysql_log_error }}
#{% endif %}
{% if mysql_slow_query_log_enabled %}
# Slow query log configuration.
@ -63,8 +64,9 @@ thread_concurrency = {{ mysql_thread_concurrency }}
innodb_file_per_table = {{ mysql_innodb_file_per_table }}
innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }}
innodb_additional_mem_pool_size = {{ mysql_innodb_additional_mem_pool_size }}
innodb_log_file_size = {{ mysql_innodb_log_file_size }}
innodb_log_buffer_size = {{ mysql_innodb_log_buffer_size }}
# It craches after install (mysql 5.5)... TODO FIX -> http://dev.mysql.com/doc/refman/5.6/en/innodb-data-log-reconfiguration.html
#innodb_log_file_size = {{ mysql_innodb_log_file_size }}
#innodb_log_buffer_size = {{ mysql_innodb_log_buffer_size }}
innodb_flush_log_at_trx_commit = {{ mysql_innodb_flush_log_at_trx_commit }}
innodb_lock_wait_timeout = {{ mysql_innodb_lock_wait_timeout }}

49
tests/README.md 100644
View File

@ -0,0 +1,49 @@
About tests
===========
IMPORTANT
---------
- DO NOT `vagrant up`! My Vagrantfile provides 14 VMs (256MB each)...
- Each slave communicate to his master. You can't mix jessie and wheezy or mysql and mariadb.
- This tests uses my [MySQL role](https://github.com/HanXHX/ansible-mysql).
Tests
-----
- vagrant up the master
- vagrant up the slave
Wait master fully installed before run slave.
Example:
```
sudo ansible-galaxy install HanXHX.mysql
vagrant up jessie-upstream-mariadb-master
vagrant up jessie-upstream-mariadb-slave
```
Supported platforms
-------------------
- Debian Wheezy
- Debian Jessie
Supported MySQL vendors
-----------------------
- MariaDB 10.0 (from Debian Jessie or MariaDB repository)
- MySQL 5.5 (from Debian repositories)
- Percona Server 5.6 (from Percona Repository)
About MySQL 5.6
---------------
You can get MySQL 5.6 for Debian with [Dotdeb](https://www.dotdeb.org) with my [Dotdeb role](https://github.com/HanXHX/ansible-debian-dotdeb). I give no support with this version (pull-request accepted). It can work but without GTID.
About MariaDB 10.1
------------------
When the application is considered stable, I'll support this version.

64
tests/gen.pl 100755
View File

@ -0,0 +1,64 @@
#!/usr/bin/perl
#
# This script generates ansible test config for Vagrant
#
use strict;
use warnings;
use Socket;
my @a = (
"wheezy-default-mysql-master",
"wheezy-default-mysql-slave",
"wheezy-upstream-mariadb-master",
"wheezy-upstream-mariadb-slave",
"wheezy-upstream-percona-master",
"wheezy-upstream-percona-slave",
"jessie-default-mysql-master",
"jessie-default-mysql-slave",
"jessie-upstream-mariadb-master",
"jessie-upstream-mariadb-slave",
"jessie-upstream-percona-master",
"jessie-upstream-percona-slave",
"jessie-default-mariadb-master",
"jessie-default-mariadb-slave",
);
my $start_ip = '192.168.200.10';
my $iip = ip2long($start_ip);
my $tmp_ip = 0;
foreach my $n (@a)
{
my @data = split(/-/, $n);
printf(
'["%s", "deb/%s-amd64", "%s", [%s]],' . "\n",
$n,
$data[0],
long2ip($iip),
join(',', map { sprintf('"%s"', $_) } @data)
);
if($data[-1] eq 'slave')
{
open(FILE, '>', "host_vars/$n");
printf FILE (qq/his_master: '%s'\n/, $tmp_ip);
close(FILE);
}
open(FILE, '>', "group_vars/" . $data[2]);
printf FILE (qq/mysql_vendor: '%s'\n/, $data[2]);
close(FILE);
$tmp_ip = long2ip($iip);
$iip++;
}
sub ip2long {
return unpack("l*", pack("l*", unpack("N*", inet_aton(shift))));
}
sub long2ip {
return inet_ntoa(pack("N*", shift));
}

View File

@ -0,0 +1 @@
mysql_origin: 'default'

View File

@ -0,0 +1 @@
mysql_vendor: 'mariadb'

View File

@ -0,0 +1,21 @@
# Master must listen for replication
mysql_bind_address: '0.0.0.0'
# Master durability
mysql_sync_binlog: '1'
mysql_innodb_flush_log_at_trx_commit: '1'
mysql_databases:
- 'testrepl'
- 'norepl'
mysql_users:
- name: 'replication'
password: '1a2b3c'
priv: '*.*:"REPLICATION SLAVE"'
host: '%'
mysql_replication_master: true
mysql_replication_slave: false
mysql_server_id: 1
# vim: set ft=yaml :

View File

@ -0,0 +1 @@
mysql_vendor: 'mysql'

View File

@ -0,0 +1 @@
mysql_vendor: 'percona'

View File

@ -0,0 +1,9 @@
mysql_replication_master: false
mysql_replication_slave: true
mysql_replication_user: 'replication'
mysql_replication_password: '1a2b3c'
mysql_replication_host: '{{ his_master }}'
mysql_server_id: 2
mysql_slave_ignore_db: ['norepl']
# vim: set ft=yaml :

View File

@ -0,0 +1 @@
mysql_origin: 'upstream'

View File

@ -0,0 +1 @@
his_master: '192.168.200.22'

View File

@ -0,0 +1 @@
his_master: '192.168.200.16'

View File

@ -0,0 +1 @@
his_master: '192.168.200.18'

View File

@ -0,0 +1 @@
his_master: '192.168.200.20'

View File

@ -0,0 +1 @@
his_master: '192.168.200.10'

View File

@ -0,0 +1 @@
his_master: '192.168.200.12'

View File

@ -0,0 +1 @@
his_master: '192.168.200.14'

12
tests/import1.sql 100644
View File

@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS `user` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`email` varchar(255) default NULL,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1;
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (1,"tellus.Suspendisse.sed@gravida.edu"),(2,"Nulla.tempor@nonsapienmolestie.edu"),(3,"a.odio@eu.org"),(4,"adipiscing.ligula.Aenean@augueeu.com"),(5,"id.enim.Curabitur@dictumeleifendnunc.org"),(6,"est.mollis.non@laoreetlectus.net"),(7,"fringilla@mollisduiin.edu"),(8,"amet@lacusQuisquepurus.co.uk"),(9,"elementum.dui@pellentesque.org"),(10,"dictum.eu.placerat@dolorQuisque.com");
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (11,"vitae.dolor@rutrumnon.net"),(12,"semper@mattis.co.uk"),(13,"tincidunt.congue.turpis@placerateget.co.uk"),(14,"ornare.sagittis.felis@vitaesemper.ca"),(15,"luctus@sapien.ca"),(16,"tellus.id.nunc@necluctus.net"),(17,"quis.pede.Praesent@posuereenim.co.uk"),(18,"quis@metusvitaevelit.com"),(19,"in.sodales@velarcu.net"),(20,"et@sagittisplacerat.net");
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (21,"aliquam@atpretium.co.uk"),(22,"cursus@sapienmolestie.edu"),(23,"ornare.Fusce@pede.ca"),(24,"at@estac.co.uk"),(25,"sed@risusodioauctor.ca"),(26,"sit.amet.consectetuer@necorciDonec.com"),(27,"Nulla@infaucibus.co.uk"),(28,"tempus.scelerisque@utlacusNulla.com"),(29,"pellentesque.a@nostraper.com"),(30,"libero.et.tristique@Nunclaoreet.co.uk");
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (31,"dolor.sit.amet@Donecelementum.net"),(32,"ornare@massanonante.ca"),(33,"quam.elementum@semper.net"),(34,"Duis.ac.arcu@Integermollis.com"),(35,"magna.Sed.eu@magnaPraesent.co.uk"),(36,"Mauris.eu.turpis@mattis.ca"),(37,"ornare.facilisis.eget@urna.net"),(38,"Sed.diam.lorem@fringilla.co.uk"),(39,"pellentesque.Sed.dictum@Donec.edu"),(40,"faucibus.Morbi@nuncid.com");
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (41,"ullamcorper@at.co.uk"),(42,"nec.ante.blandit@utcursus.edu"),(43,"diam.vel.arcu@egestasFuscealiquet.com"),(44,"ridiculus@musAeneaneget.com"),(45,"ad@turpisvitaepurus.ca"),(46,"ultrices.posuere.cubilia@purusMaecenas.net"),(47,"luctus@libero.org"),(48,"mi@elitNulla.com"),(49,"elementum@ipsumdolorsit.edu"),(50,"orci@Donec.co.uk");

View File

@ -0,0 +1,6 @@
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (51,"vulputate.eu.odio@elitdictumeu.net"),(52,"Sed.eu@erosnec.edu"),(53,"magna@interdum.co.uk"),(54,"ornare.libero.at@Proin.net"),(55,"turpis@aneque.org"),(56,"ut.eros.non@Duisrisusodio.com"),(57,"Pellentesque.ultricies.dignissim@malesuada.edu"),(58,"vel.nisl@mifringilla.net"),(59,"dui@laoreet.com"),(60,"vitae@Suspendissedui.net");
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (61,"turpis@Curabituregestasnunc.co.uk"),(62,"arcu@enim.co.uk"),(63,"consectetuer.rhoncus.Nullam@dolordolortempus.co.uk"),(64,"sem@felisadipiscingfringilla.net"),(65,"aliquet.metus.urna@a.net"),(66,"Fusce.fermentum.fermentum@variusNam.com"),(67,"dolor@velnisl.ca"),(68,"et.netus@Duisrisusodio.edu"),(69,"malesuada@purus.edu"),(70,"gravida.sagittis@pulvinararcuet.ca");
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (71,"et.eros.Proin@Cras.co.uk"),(72,"eleifend.nunc.risus@metuseu.edu"),(73,"pede.Nunc@Phasellusnulla.net"),(74,"vitae.sodales.at@ipsumdolor.edu"),(75,"nunc.sed.pede@aliquetlobortisnisi.co.uk"),(76,"consectetuer@nonenim.ca"),(77,"ultrices@tinciduntvehicula.co.uk"),(78,"Nullam.enim.Sed@Morbiaccumsan.com"),(79,"auctor@Phasellus.net"),(80,"enim.Etiam@interdum.com");
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (81,"sapien.Cras.dolor@consectetuer.com"),(82,"malesuada.fames.ac@feugiattelluslorem.edu"),(83,"risus@vestibulum.co.uk"),(84,"Nunc@Duisgravida.ca"),(85,"ornare.egestas@sitamet.edu"),(86,"Proin.ultrices@senectus.ca"),(87,"ligula@magna.edu"),(88,"orci.tincidunt.adipiscing@sed.com"),(89,"et@venenatis.edu"),(90,"leo.Cras.vehicula@eteuismod.org");
INSERT IGNORE INTO `user` (`id`,`email`) VALUES (91,"consequat.auctor.nunc@utsemNulla.net"),(92,"nec.leo@orci.com"),(93,"Nulla@atvelit.edu"),(94,"tempor.augue.ac@eleifend.edu"),(95,"fermentum.risus.at@penatibusetmagnis.edu"),(96,"id.erat.Etiam@porttitortellus.edu"),(97,"amet.metus.Aliquam@mus.co.uk"),(98,"dolor.tempus.non@risus.org"),(99,"vulputate.posuere.vulputate@purus.ca"),(100,"inceptos@pede.edu");

View File

@ -1,29 +1,39 @@
---
- hosts: upstream_mariadb
vars:
mysql_origin: 'upstream'
mysql_vendor: 'mariadb'
roles:
- ../../
- hosts: all
pre_tasks:
- local_action: shell ssh-add $HOME/.vagrant.d/insecure_private_key
become: no
changed_when: false
tasks:
- apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600
with_items:
- strace
- vim
- get_url: >
url=https://raw.githubusercontent.com/HanXHX/ansible-debian-bootstrap/master/files/bashrc
dest=/root/.bashrc
force=yes
- hosts: debian_mariadb
vars:
mysql_origin: 'default'
mysql_vendor: 'mariadb'
- hosts: master
roles:
- ../../
tasks:
- copy: src=import1.sql dest=/tmp/import1.sql
register: c
- mysql_db: name={{ item }} state=import target=/tmp/import1.sql
with_items: ['testrepl', 'norepl']
when: c.changed
- hosts: debian_mysql
vars:
mysql_origin: 'default'
mysql_vendor: 'mysql'
- hosts: slave
roles:
- ../../
tasks:
- copy: src=import2.sql dest=/tmp/import2.sql
delegate_to: "{{ his_master }}"
register: c
- mysql_db: name={{ item }} state=import target=/tmp/import2.sql
with_items: ['testrepl', 'norepl']
delegate_to: "{{ his_master }}"
when: c.changed
- hosts: upstream_percona
vars:
mysql_origin: 'upstream'
mysql_vendor: 'percona'
roles:
- ../../