Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
include_vars: "{{ ansible_os_family }}.yml"

- name: Install the mysql packages in Redhat derivatives
yum: name={{ item }} state=installed
yum: name={{ item }} state=present
with_items:
- "{{ mysql_pkgs }}"
when: ansible_os_family == 'RedHat'

- name: Install the mysql packages in Debian derivatives
apt: name={{ item }} state=installed update_cache=yes
apt: name={{ item }} state=present update_cache=yes
with_items:
- "{{ mysql_pkgs }}"
environment: "{{ env }}"
Expand Down Expand Up @@ -90,16 +90,14 @@

- name: Ensure the hostname entry for master is available for the client.
lineinfile: dest=/etc/hosts regexp="{{ mysql_repl_master }}" line="{{ hostvars[mysql_repl_master].ansible_default_ipv4.address + " " + mysql_repl_master }}" state=present
when: slave|failed and mysql_repl_role == 'slave' and mysql_repl_master is defined
when: slave is failed and mysql_repl_role == 'slave' and mysql_repl_master is defined

- name: Get the current master servers replication status
mysql_replication: mode=getmaster
delegate_to: "{{ mysql_repl_master }}"
register: repl_stat
when: slave|failed and mysql_repl_role == 'slave' and mysql_repl_master is defined
when: slave is failed and mysql_repl_role == 'slave' and mysql_repl_master is defined

- name: Change the master in slave to start the replication
mysql_replication: mode=changemaster master_host={{ mysql_repl_master }} master_log_file={{ repl_stat.File }} master_log_pos={{ repl_stat.Position }} master_user={{ mysql_repl_user[0].name }} master_password={{ mysql_repl_user[0].pass }}
when: slave|failed and mysql_repl_role == 'slave' and mysql_repl_master is defined


when: slave is failed and mysql_repl_role == 'slave' and mysql_repl_master is defined