ansible-mysql/tests/test.yml

40 lines
1015 B
YAML
Raw Normal View History

2015-07-12 17:15:59 +07:00
---
- 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
2015-08-09 02:34:17 +07:00
- hosts: master
2015-08-09 02:34:17 +07:00
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
2015-08-09 02:34:17 +07:00
- hosts: slave
2015-08-09 02:34:17 +07:00
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
2015-08-09 02:34:17 +07:00