Modern Ansible

pull/33/head
Emilien Mantel 2019-04-12 11:28:20 +02:00
parent 254a986648
commit da384876ad
5 changed files with 16 additions and 16 deletions

View File

@ -7,11 +7,11 @@
register: galeraconfig
- name: INCLUDE | Bootstrap first node
include: 'bootstrap.yml'
import_tasks: 'bootstrap.yml'
when: inventory_hostname == mariadb_galera_primary_node
- name: INCLUDE | Configure other nodes
include: 'nodes.yml'
import_tasks: 'nodes.yml'
when: inventory_hostname != mariadb_galera_primary_node
- name: SERVICE | Restart MariaDB if needed

View File

@ -1,15 +1,15 @@
---
- name: INCLUDE | Setup Percona repository
include: 'percona/apt.yml'
import_tasks: 'percona/apt.yml'
when: mariadb_use_percona_apt
- name: INCLUDE | Setup MariaDB repository
include: 'mariadb/upstream.yml'
import_tasks: 'mariadb/upstream.yml'
when: mariadb_origin == 'upstream'
- name: INCLUDE | Install MariaDB
include: 'mariadb/default.yml'
import_tasks: 'mariadb/default.yml'
- name: APT | Install few MariaDB related tools
apt:

View File

@ -10,7 +10,7 @@
changed_when: false
- name: INCLUDE | Install
include: install/main.yml
import_tasks: install/main.yml
- name: TEMPLATE | Deploy configuration
template:
@ -42,15 +42,15 @@
backup: yes
- name: INCLUDE | Galera
include: galera/main.yml
import_tasks: galera/main.yml
when: mariadb_use_galera
- name: INCLUDE | Replication
include: replication/main.yml
import_tasks: replication/main.yml
when: mariadb_replication_master or mariadb_replication_slave
- name: INCLUDE | Secure install
include: 'secure.yml'
import_tasks: 'secure.yml'
- name: SERVICE | Ensure service is started
service:

View File

@ -1,9 +1,9 @@
---
- name: INCLUDE | Replication Master
include: master.yml
import_tasks: master.yml
when: mariadb_replication_master
- name: INCLUDE | Replication slave
include: slave.yml
import_tasks: slave.yml
when: mariadb_replication_slave

View File

@ -19,19 +19,19 @@
register: slave_status
- name: INCLUDE | Transfert /etc/mysql/debian.cnf from master
include: slave/ssh.yml
import_tasks: slave/ssh.yml
when: mariadb_slave_replicate_mysqldb or ((slave_status.failed is defined or not slave_status.Is_Slave) and mariadb_slave_import_data)
- name: INCLUDE | Import data
include: slave/import_data.yml
import_tasks: slave/import_data.yml
when: (slave_status.failed is defined or not slave_status.Is_Slave) and mariadb_slave_import_data
- name: INCLUDE | Configure replication
include: slave/replication.yml
import_tasks: slave/replication.yml
when: (slave_status.failed is defined or not slave_status.Is_Slave) or mariadb_slave_force_setup
- name: INCLUDE | Transfert /etc/mysql/debian.cnf from master
include: slave/debiancnf.yml
import_tasks: slave/debiancnf.yml
when: mariadb_slave_replicate_mysqldb
- name: MYSQL_REPLICATION | Get slave status
@ -41,4 +41,4 @@
register: slave_status
- name: Configure GTID
include: slave/gtid.yml
import_tasks: slave/gtid.yml