Ansible 2.12 compatibility
Changed Python identification variable, fixes #15. Replaced deprecated terms in replication tasks. Removed hard-coded interpreter variable from tests.
This commit is contained in:
parent
14adb73da1
commit
10f6628036
|
|
@ -3,7 +3,6 @@
|
||||||
hosts: all
|
hosts: all
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
vars:
|
vars:
|
||||||
ansible_python_interpreter: /usr/bin/python3
|
|
||||||
mariadb_use_official_repo: true
|
mariadb_use_official_repo: true
|
||||||
mariadb_use_official_repo_url: https://archive.mariadb.org/mirror/repo
|
mariadb_use_official_repo_url: https://archive.mariadb.org/mirror/repo
|
||||||
mariadb_use_official_repo_version: 10.5
|
mariadb_use_official_repo_version: 10.5
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
vars:
|
|
||||||
ansible_python_interpreter: /usr/bin/python3
|
|
||||||
vars_files: vars/testvars.yml
|
vars_files: vars/testvars.yml
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: Check replica replication status
|
- name: Check replica replication status
|
||||||
mysql_replication:
|
mysql_replication:
|
||||||
mode: getslave
|
mode: getreplica
|
||||||
login_unix_socket: "{{ mariadb_unix_socket }}"
|
login_unix_socket: "{{ mariadb_unix_socket }}"
|
||||||
register: replica
|
register: replica
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
master_user='{{ item.name }}', master_password='{{ item.password }}', master_use_gtid=slave_pos"
|
master_user='{{ item.name }}', master_password='{{ item.password }}', master_use_gtid=slave_pos"
|
||||||
loop: "{{ mariadb_replication_user }}"
|
loop: "{{ mariadb_replication_user }}"
|
||||||
when:
|
when:
|
||||||
- not replica.Is_Slave
|
- not replica.Is_Replica
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
# # Following (not tested) should work on ansible 2.10
|
# # Following (not tested) should work on ansible 2.10
|
||||||
|
|
@ -34,21 +34,21 @@
|
||||||
|
|
||||||
- name: Reset replica replication
|
- name: Reset replica replication
|
||||||
mysql_replication:
|
mysql_replication:
|
||||||
mode: resetslave
|
mode: resetreplica
|
||||||
login_unix_socket: "{{ mariadb_unix_socket }}"
|
login_unix_socket: "{{ mariadb_unix_socket }}"
|
||||||
when:
|
when:
|
||||||
- not replica.Is_Slave
|
- not replica.Is_Replica
|
||||||
|
|
||||||
- name: Check replica replication status (second time)
|
- name: Check replica replication status (second time)
|
||||||
mysql_replication:
|
mysql_replication:
|
||||||
mode: getslave
|
mode: getreplica
|
||||||
login_unix_socket: "{{ mariadb_unix_socket }}"
|
login_unix_socket: "{{ mariadb_unix_socket }}"
|
||||||
register: replica2
|
register: replica2
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
- name: Start replica replication
|
- name: Start replica replication
|
||||||
mysql_replication:
|
mysql_replication:
|
||||||
mode: startslave
|
mode: startreplica
|
||||||
login_unix_socket: "{{ mariadb_unix_socket }}"
|
login_unix_socket: "{{ mariadb_unix_socket }}"
|
||||||
when:
|
when:
|
||||||
- replica2.Slave_IO_Running == "No"
|
- replica2.Slave_IO_Running == "No"
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
- name: Determine required MariaDB Python libraries
|
- name: Determine required MariaDB Python libraries
|
||||||
set_fact:
|
set_fact:
|
||||||
deb_mariadb_python_package: "{% if 'python3' in ansible_python_interpreter|default('') %}python3-pymysql{% else %}python-pymysql{% endif %}"
|
deb_mariadb_python_package: "{% if 'python3' in discovered_interpreter_python|default('') %}python3-pymysql{% else %}python-pymysql{% endif %}"
|
||||||
|
|
||||||
- name: Install python mariadb driver
|
- name: Install python mariadb driver
|
||||||
apt:
|
apt:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue