diff --git a/tasks/replication.yml b/tasks/replication.yml index 5e835857..bb25959c 100644 --- a/tasks/replication.yml +++ b/tasks/replication.yml @@ -26,10 +26,11 @@ - (mysql_replication_master | length) > 0 tags: ['skip_ansible_galaxy'] +# https://github.com/ansible/ansible/issues/82264 - name: Check master replication status. mysql_replication: mode: getprimary - delegate_to: "{{ mysql_replication_master_inventory_host }}" + delegate_to: "{{ mysql_replication_master_inventory_host | default(omit, true) }}" register: master when: - (slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Replica is defined and not slave.Is_Replica) or (slave.Is_Slave is not defined and slave.Is_Replica is not defined and slave is failed)