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:
TheGuyDanish 2022-02-01 18:32:36 +00:00
parent 14adb73da1
commit 10f6628036
4 changed files with 7 additions and 10 deletions

View File

@ -3,7 +3,6 @@
hosts: all
gather_facts: true
vars:
ansible_python_interpreter: /usr/bin/python3
mariadb_use_official_repo: true
mariadb_use_official_repo_url: https://archive.mariadb.org/mirror/repo
mariadb_use_official_repo_version: 10.5

View File

@ -2,8 +2,6 @@
- name: Converge
hosts: all
gather_facts: true
vars:
ansible_python_interpreter: /usr/bin/python3
vars_files: vars/testvars.yml
roles:

View File

@ -1,7 +1,7 @@
---
- name: Check replica replication status
mysql_replication:
mode: getslave
mode: getreplica
login_unix_socket: "{{ mariadb_unix_socket }}"
register: replica
no_log: true
@ -15,7 +15,7 @@
master_user='{{ item.name }}', master_password='{{ item.password }}', master_use_gtid=slave_pos"
loop: "{{ mariadb_replication_user }}"
when:
- not replica.Is_Slave
- not replica.Is_Replica
no_log: true
# # Following (not tested) should work on ansible 2.10
@ -34,21 +34,21 @@
- name: Reset replica replication
mysql_replication:
mode: resetslave
mode: resetreplica
login_unix_socket: "{{ mariadb_unix_socket }}"
when:
- not replica.Is_Slave
- not replica.Is_Replica
- name: Check replica replication status (second time)
mysql_replication:
mode: getslave
mode: getreplica
login_unix_socket: "{{ mariadb_unix_socket }}"
register: replica2
no_log: true
- name: Start replica replication
mysql_replication:
mode: startslave
mode: startreplica
login_unix_socket: "{{ mariadb_unix_socket }}"
when:
- replica2.Slave_IO_Running == "No"

View File

@ -30,7 +30,7 @@
- name: Determine required MariaDB Python libraries
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
apt: