From a06e4a79a5331952ad31c737fbd3d7d82eaa6eb5 Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Thu, 6 Aug 2015 20:25:37 -0400 Subject: updated tasks based on Debian --- README.md | 2 +- defaults/main.yml | 4 ++-- meta/main.yml | 2 +- tasks/debian.yml | 22 ++++++++++++++++++++++ tasks/main.yml | 24 ++---------------------- 5 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 tasks/debian.yml diff --git a/README.md b/README.md index bc57b4c..14f946c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Role Name ========= -Installs rabbitmq https://www.rabbitmq.com/ +Installs rabbitmq https://www.rabbitmq.com/ (Configurable...HA and Clustering ready) Requirements ------------ diff --git a/defaults/main.yml b/defaults/main.yml index 8ca8a4f..c1cd0d8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,4 @@ --- # defaults file for ansible-rabbitmq -enable_rabbitmq_clustering: false #defines if setting up a rabbitmq cluster -config_rabbitmq_ha: false #defines if rabbitmq ha should be configured +enable_rabbitmq_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group +config_rabbitmq_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group diff --git a/meta/main.yml b/meta/main.yml index 67993d0..4bd090d 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,7 +1,7 @@ --- galaxy_info: author: Larry Smith Jr. - description: Installs rabbitmq (can be HA and clustered) + description: Installs rabbitmq https://www.rabbitmq.com/ (Configurable...HA and Clustering ready) #company: your company (optional) # Some suggested licenses: # - BSD (default) diff --git a/tasks/debian.yml b/tasks/debian.yml new file mode 100644 index 0000000..563563a --- /dev/null +++ b/tasks/debian.yml @@ -0,0 +1,22 @@ +--- +- name: Add the RabbitMQ public GPG key to the apt repo + apt_key: url=http://www.rabbitmq.com/rabbitmq-signing-key-public.asc state=present + +- name: Add RabbitMQ to the sources list + apt_repository: repo='deb http://www.rabbitmq.com/debian/ testing main' update_cache=no state=present + +- name: Install RabbitMQ server + apt: name={{ item }} update_cache=no force=yes state=installed + with_items: + - rabbitmq-server + +- name: Enable the RabbitMQ Management Console + rabbitmq_plugin: names=rabbitmq_management state=enabled + notify: restart rabbitmq-server + +- name: Ensure that the RabbitMQ service is running + service: name=rabbitmq-server state=started enabled=yes + +- name: check | checking to see if already clustered + stat: path=/etc/rabbitmq/clustered + register: clustered diff --git a/tasks/main.yml b/tasks/main.yml index e74c1e5..3752d78 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,26 +1,6 @@ ---- # tasks file for ansible-rabbitmq -- name: Add the RabbitMQ public GPG key to the apt repo - apt_key: url=http://www.rabbitmq.com/rabbitmq-signing-key-public.asc state=present - -- name: Add RabbitMQ to the sources list - apt_repository: repo='deb http://www.rabbitmq.com/debian/ testing main' update_cache=no state=present - -- name: Install RabbitMQ server - apt: name={{ item }} update_cache=no force=yes state=installed - with_items: - - rabbitmq-server - -- name: Enable the RabbitMQ Management Console - rabbitmq_plugin: names=rabbitmq_management state=enabled - notify: restart rabbitmq-server - -- name: Ensure that the RabbitMQ service is running - service: name=rabbitmq-server state=started enabled=yes - -- name: check | checking to see if already clustered - stat: path=/etc/rabbitmq/clustered - register: clustered +- include: debian.yml + when: ansible_os_family == "Debian" - include: rabbitmq_clustering.yml when: enable_rabbitmq_clustering and (clustered.stat.exists != True) -- cgit v1.2.3