Skip to content

Commit

Permalink
Properly detect the master node when running on AWS EC2
Browse files Browse the repository at this point in the history
  • Loading branch information
veger committed Dec 8, 2016
1 parent 3e3531c commit 5f08fbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
- include: service.yml

- include: cluster.yml
when: 'rabbitmq_create_cluster and (ansible_hostname != rabbitmq_cluster_master) and (ansible_fqdn != rabbitmq_cluster_master)'
when: 'rabbitmq_create_cluster and (ansible_hostname != rabbitmq_cluster_master) and (ansible_fqdn != rabbitmq_cluster_master) and ((ec2_public_dns_name | default('')) != rabbitmq_cluster_master)'

- include: rabbitmq.yml
when: 'not rabbitmq_create_cluster or (ansible_hostname == rabbitmq_cluster_master) or (ansible_fqdn != rabbitmq_cluster_master)'
when: 'not rabbitmq_create_cluster or (ansible_hostname == rabbitmq_cluster_master) or (ansible_fqdn == rabbitmq_cluster_master) or ((ec2_public_dns_name | default('')) == rabbitmq_cluster_master)'

- meta: flush_handlers

0 comments on commit 5f08fbc

Please sign in to comment.