]> git.immae.eu Git - github/fretlink/ansible-rabbitmq.git/commitdiff
First commit of refactoring
authorLarry Smith Jr <mrlesmithjr@gmail.com>
Wed, 19 Dec 2018 14:52:51 +0000 (09:52 -0500)
committerLarry Smith Jr <mrlesmithjr@gmail.com>
Thu, 20 Dec 2018 05:56:13 +0000 (00:56 -0500)
README.md
defaults/main.yml
handlers/main.yml
tasks/debian.yml
tasks/main.yml
tasks/rabbitmq_ha_config.yml

index b3b03adcea64556071421c27b9ee12a3ed1cbda6..15f9cdf38d2ce9cc5fee633b352662483d106265 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,65 +1,73 @@
-Role Name
-=========
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*
 
-An [Ansible] role to install/configure [RabbitMQ]
+- [ansible-rabbitmq](#ansible-rabbitmq)
+  - [Build Status](#build-status)
+  - [Requirements](#requirements)
+  - [Vagrant](#vagrant)
+  - [Role Variables](#role-variables)
+  - [Dependencies](#dependencies)
+  - [Example Playbook](#example-playbook)
+  - [License](#license)
+  - [Author Information](#author-information)
 
-Build Status
-------------
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+# ansible-rabbitmq
+
+An [Ansible](https://www.ansible.com) role to install/configure [RabbitMQ](https://www.rabbitmq.com/)
+
+## Build Status
 
 [![Build Status](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq)
 
-Requirements
-------------
+## Requirements
 
 Ensure hostnames are resolvable prior to clustering...either update /etc/hosts
 or ensure DNS is working.
 
-Vagrant
--------
+## Vagrant
 
-Spin up a 3 node HA Cluster for testing...  
-Install Ansible role on your host:  
-```
+Spin up a 3 node HA Cluster for testing...
+Install Ansible role on your host:
+
+```bash
 sudo ansible-galaxy install -r requirements.yml -f
 ```
-Now spin up your environment...  
-```
+
+Now spin up your environment...
+
+```bash
 vagrant up
 ```
-When you are done testing, tear it all down...  
-```
+
+When you are done testing, tear it all down...
+
+```bash
 ./cleanup.sh
 ```
 
-Role Variables
---------------
+## Role Variables
 
 [Role Defaults](./defaults/main.yml)
 
-Dependencies
-------------
+## Dependencies
 
 None
 
-Example Playbook
-----------------
+## Example Playbook
 
 [Example Playbook](./playbook.yml)
 
-License
--------
+## License
 
-BSD
+MIT
 
-Author Information
-------------------
+## Author Information
 
 Larry Smith Jr.
-- [@mrlesmithjr]
-- http://everythingshouldbevirtual.com
-- mrlesmithjr [at] gmail.com
-
-[@mrlesmithjr]: <https://www.twitter.com/mrlesmithjr>
 
-[Ansible]: <https://www.ansible.com>
-[RabbitMQ]: <https://www.rabbitmq.com/>
+- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr)
+- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com)
+- [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com)
index a13fec0546b72b56b6075e23d950a9e318be5e53..4771a6b519f7082a20849eb9fa9e70edbff8d9b7 100644 (file)
@@ -15,15 +15,15 @@ rabbitmq_config: []
 rabbitmq_config_ha: false
 
 rabbitmq_config_service: false
-rabbitmq_config_file: 'etc/rabbitmq/rabbitmq.config.j2'
+rabbitmq_config_file: etc/rabbitmq/rabbitmq.config.j2
 
-rabbitmq_debian_repo: 'deb http://www.rabbitmq.com/debian/ testing main'
+# rabbitmq_debian_repo: deb http://www.rabbitmq.com/debian/ testing main
 #other repos
-#rabbitmq_debian_repo: deb https://dl.bintray.com/rabbitmq/debian {{ ansible_distribution_release }} main #bintray
-rabbitmq_debian_repo_key: 'https://www.rabbitmq.com/rabbitmq-release-signing-key.asc'
-#rabbitmq_debian_repo_key: https://bintray.com/user/downloadSubjectPublicKey?username=rabbitmq
+rabbitmq_debian_repo: "deb https://dl.bintray.com/rabbitmq/debian {{ ansible_distribution_release }} main #bintray"
+# rabbitmq_debian_repo_key: https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
+rabbitmq_debian_repo_key: https://bintray.com/user/downloadSubjectPublicKey?username=rabbitmq
 rabbitmq_debian_erlang_from_rabbit: false
-#rabbitmq_debian_version: 3.7.9 # current version if not defined
+rabbitmq_debian_version: 3.7.9 # current version if not defined
 
 # Defines if setting up a rabbitmq cluster
 rabbitmq_enable_clustering: false
index 4fdafe55f94dbe62abe93d8aebd09c8ba8850d7c..c727c75384121d264c029ba946e6ae499cce1396 100644 (file)
@@ -2,6 +2,6 @@
 # handlers file for ansible-rabbitmq
 - name: restart rabbitmq-server
   service:
-    name: "rabbitmq-server"
+    name: rabbitmq-server
     state: restarted
   become: true
index c98ff680ab31b4b545de297ddb748ac834478835..317932ed81981322ee7c277f6232f30b6b27905d 100644 (file)
@@ -20,6 +20,8 @@
     url: https://bintray.com/user/downloadSubjectPublicKey?username=rabbitmq-erlang
     state: present
   become: true
+  register: result
+  until: result is successful
   when: rabbitmq_debian_erlang_from_rabbit
 
 - name: debian | add Rabbitmq erlang repo
     name: ['rabbitmq-server']
     state: present
   become: true
+  register: result
+  until: result is successful
   with_items:
-    - rabbitmq-server{{ (rabbitmq_debian_version is defined) | ternary(['=',rabbitmq_debian_version] | join(''),'')}}
+    - rabbitmq-server{{ (rabbitmq_debian_version is defined) | ternary(['=',rabbitmq_debian_version] | join(''),'') }}
 
 - name: debian | enabling the RabbitMQ Management Console
   rabbitmq_plugin:
index 8905c0b89108cdfa613e22384a57ecc6bb919753..3205473463c95f6761ec22338e2b1c6cc5aaa283 100644 (file)
@@ -15,7 +15,8 @@
   when: rabbitmq_config_service
 
 - name: checking to see if already clustered
-  stat: path=/etc/rabbitmq/clustered
+  stat:
+    path: /etc/rabbitmq/clustered
   become: true
   register: clustered
 
index cc31333b25eddbfb84fb1811ab3b6ab87c2b2306..cea301ccfd431301870c98c8e8647784c865c177 100644 (file)
   notify: restart rabbitmq-server
   when: not rabbitmqadmin_check['stat']['exists']
 
-# - name: rabbitmq_ha_config | install rabbitMQ admin
-#   shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin
-#   become: true
-#   when: not rabbitmqadmin_check['stat']['exists']
-
-# - name: rabbitmq_ha_config | moving the rabbitMQ Admin
-#   shell: mv rabbitmqadmin /usr/sbin
-#   become: true
-#   when: not rabbitmqadmin_check['stat']['exists']
-
-# - name: rabbitmq_ha_config | making executable rabbitMQ Admin
-#   shell: chmod +x /usr/sbin/rabbitmqadmin
-#   notify: restart rabbitmq-server
-#   become: true
-#   when: not rabbitmqadmin_check['stat']['exists']
-
 - name: rabbitmq_ha_config | creating queue(s)
   command: rabbitmqadmin declare queue name={{ item['queue_name'] }} durable={{ item['durable']|lower }} --vhost={{ item['vhost'] | default('/') }}
   run_once: true