Skip to content

Commit

Permalink
Merge pull request #6 from hellofresh/fix/ansible-updates
Browse files Browse the repository at this point in the history
Support new version of ansible
  • Loading branch information
zeelax authored Dec 5, 2017
2 parents cd51d4a + aaaa0f3 commit b2cbd5b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
language: python
python: "2.7"
before_install:
# Untravis rabbitmq-server repo
- sudo rm -fr /etc/apt/sources.list.d/rabbitmq_rabbitmq-server.list*
- sudo apt-get update -qq
# Remove existing rabbitmq-server-package
- sudo apt-get purge rabbitmq-server
install:
# Install Ansible.
Expand Down
4 changes: 2 additions & 2 deletions tasks/cluster/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: check | cluster group should be valid
fail:
msg="Your configuration is not valid 'rabbitmq_cluster_group' varaible with value '{{ rabbitmq_cluster_group }}' is not valid group."
when: "{{ groups[rabbitmq_cluster_group] is not defined }}"
when: groups[rabbitmq_cluster_group] is not defined

- name: check | get rabbitmq version in each node in the cluster
shell: rabbitmqctl status|grep "{rabbit,\"RabbitMQ\"" | cut -d, -f3 | cut -d "\"" -f2
Expand All @@ -25,4 +25,4 @@
fail:
msg="Rabbiqmq version in cluster dont match. Node versions = {{rabbit_cluster_nodes_version }}"
run_once: true
when: "{{ rabbit_cluster_nodes_version | selectattr('version', 'equalto', rabbit_cluster_nodes_version[0]['version']) | list != rabbit_cluster_nodes_version }}"
when: rabbit_cluster_nodes_version | selectattr('version', 'equalto', rabbit_cluster_nodes_version[0]['version']) | list != rabbit_cluster_nodes_version
2 changes: 1 addition & 1 deletion tasks/cluster/cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
shell: "rabbitmqctl cluster_status | grep {{ rabbitmq_cluster_instance_to_join }}"
changed_when: False
ignore_errors: True
when: "{{ rabbitmq_cluster_instance_to_join != ansible_fqdn }}"
when: rabbitmq_cluster_instance_to_join != ansible_fqdn
register: cluster_result

- name: cluster | stop rabbitmq app for standalone nodes in order to join
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
when: rabbitmq_federation

- include: policy.yml
when: "rabbitmq_policy_configuration is defined"
when: rabbitmq_policy_configuration is defined

- block:
- include: cluster/checks.yml
Expand Down

0 comments on commit b2cbd5b

Please sign in to comment.