From 9cac39786e63d655eceb3ecbd74b3df8461654d3 Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Wed, 19 Dec 2018 09:50:10 -0500 Subject: Cleaned up Vagrant and merged new commits --- .travis.yml | 75 +++++-- Vagrant/roles/ansible-rabbitmq | 1 + Vagrant/roles/ansible-rabbitmq/.gitignore | 3 - Vagrant/roles/ansible-rabbitmq/.travis.yml | 29 --- Vagrant/roles/ansible-rabbitmq/README.md | 123 ----------- Vagrant/roles/ansible-rabbitmq/Vagrant/Vagrantfile | 228 --------------------- .../roles/ansible-rabbitmq/Vagrant/bootstrap.sh | 23 --- .../roles/ansible-rabbitmq/Vagrant/bootstrap.yml | 180 ---------------- Vagrant/roles/ansible-rabbitmq/Vagrant/cleanup.sh | 8 - .../roles/ansible-rabbitmq/Vagrant/playbook.yml | 1 - .../ansible-rabbitmq/Vagrant/requirements.yml | 1 - .../Vagrant/roles/ansible-rabbitmq/README.md | 118 ----------- .../Vagrant/roles/ansible-rabbitmq/Vagrantfile | 63 ------ .../Vagrant/roles/ansible-rabbitmq/ansible.cfg | 3 - .../Vagrant/roles/ansible-rabbitmq/bootstrap.sh | 14 -- .../Vagrant/roles/ansible-rabbitmq/bootstrap.yml | 152 -------------- .../Vagrant/roles/ansible-rabbitmq/cleanup.sh | 8 - .../roles/ansible-rabbitmq/defaults/main.yml | 28 --- .../roles/ansible-rabbitmq/handlers/main.yml | 6 - .../Vagrant/roles/ansible-rabbitmq/meta/main.yml | 137 ------------- .../Vagrant/roles/ansible-rabbitmq/playbook.yml | 25 --- .../roles/ansible-rabbitmq/requirements.yml | 2 - .../roles/ansible-rabbitmq/tasks/debian.yml | 35 ---- .../roles/ansible-rabbitmq/tasks/fedora.yml | 39 ---- .../Vagrant/roles/ansible-rabbitmq/tasks/main.yml | 21 -- .../ansible-rabbitmq/tasks/rabbitmq_clustering.yml | 70 ------- .../ansible-rabbitmq/tasks/rabbitmq_ha_config.yml | 44 ---- .../ansible-rabbitmq/tasks/rabbitmq_users.yml | 27 --- .../roles/ansible-rabbitmq/tasks/redhat.yml | 40 ---- .../ansible-rabbitmq/templates/erlang.cookie.j2 | 1 - .../Vagrant/roles/ansible-rabbitmq/vars/main.yml | 2 - Vagrant/roles/ansible-rabbitmq/ansible.cfg | 3 - Vagrant/roles/ansible-rabbitmq/defaults/main.yml | 28 --- Vagrant/roles/ansible-rabbitmq/handlers/main.yml | 6 - Vagrant/roles/ansible-rabbitmq/meta/main.yml | 137 ------------- Vagrant/roles/ansible-rabbitmq/playbook.yml | 25 --- Vagrant/roles/ansible-rabbitmq/requirements.yml | 2 - Vagrant/roles/ansible-rabbitmq/tasks/debian.yml | 35 ---- Vagrant/roles/ansible-rabbitmq/tasks/fedora.yml | 39 ---- Vagrant/roles/ansible-rabbitmq/tasks/main.yml | 21 -- .../ansible-rabbitmq/tasks/rabbitmq_clustering.yml | 72 ------- .../ansible-rabbitmq/tasks/rabbitmq_ha_config.yml | 44 ---- .../ansible-rabbitmq/tasks/rabbitmq_users.yml | 27 --- Vagrant/roles/ansible-rabbitmq/tasks/redhat.yml | 40 ---- .../ansible-rabbitmq/templates/erlang.cookie.j2 | 1 - Vagrant/roles/ansible-rabbitmq/tests/inventory | 1 - Vagrant/roles/ansible-rabbitmq/tests/test.yml | 5 - Vagrant/roles/ansible-rabbitmq/vars/main.yml | 2 - defaults/main.yml | 34 +-- meta/main.yml | 112 +--------- tasks/debian.yml | 6 +- tasks/fedora.yml | 18 +- tasks/rabbitmq_ha_config.yml | 31 ++- tasks/redhat.yml | 17 +- tests/inventory | 2 +- tests/test.yml | 4 +- 56 files changed, 129 insertions(+), 2090 deletions(-) create mode 120000 Vagrant/roles/ansible-rabbitmq delete mode 100644 Vagrant/roles/ansible-rabbitmq/.gitignore delete mode 100644 Vagrant/roles/ansible-rabbitmq/.travis.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/README.md delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/Vagrantfile delete mode 100755 Vagrant/roles/ansible-rabbitmq/Vagrant/bootstrap.sh delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/bootstrap.yml delete mode 100755 Vagrant/roles/ansible-rabbitmq/Vagrant/cleanup.sh delete mode 120000 Vagrant/roles/ansible-rabbitmq/Vagrant/playbook.yml delete mode 120000 Vagrant/roles/ansible-rabbitmq/Vagrant/requirements.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/README.md delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/Vagrantfile delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/ansible.cfg delete mode 100755 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/bootstrap.sh delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/bootstrap.yml delete mode 100755 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/cleanup.sh delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/defaults/main.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/handlers/main.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/meta/main.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/playbook.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/requirements.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/debian.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/fedora.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/main.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_clustering.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_users.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/redhat.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/templates/erlang.cookie.j2 delete mode 100644 Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/vars/main.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/ansible.cfg delete mode 100644 Vagrant/roles/ansible-rabbitmq/defaults/main.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/handlers/main.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/meta/main.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/playbook.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/requirements.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/tasks/debian.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/tasks/fedora.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/tasks/main.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_clustering.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_users.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/tasks/redhat.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/templates/erlang.cookie.j2 delete mode 100644 Vagrant/roles/ansible-rabbitmq/tests/inventory delete mode 100644 Vagrant/roles/ansible-rabbitmq/tests/test.yml delete mode 100644 Vagrant/roles/ansible-rabbitmq/vars/main.yml diff --git a/.travis.yml b/.travis.yml index 36bbf62..ef52f88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,27 +3,68 @@ language: python python: "2.7" # Use the new container infrastructure -sudo: false +sudo: required -# Install ansible -addons: - apt: - packages: - - python-pip +services: + - docker -install: - # Install ansible - - pip install ansible +env: + - distribution: centos + init: /usr/lib/systemd/systemd + version: 7 + - distribution: fedora + init: /usr/lib/systemd/systemd + version: 29 + - distribution: fedora + init: /usr/lib/systemd/systemd + version: 28 + - distribution: fedora + init: /usr/lib/systemd/systemd + version: 27 + - distribution: fedora + init: /usr/lib/systemd/systemd + version: 26 + - distribution: fedora + init: /usr/lib/systemd/systemd + version: 25 + - distribution: fedora + init: /usr/lib/systemd/systemd + version: 24 + - distribution: ubuntu + init: /lib/systemd/systemd + version: bionic + - distribution: ubuntu + init: /lib/systemd/systemd + version: xenial + - distribution: ubuntu + init: /sbin/init + version: trusty + - distribution: debian + init: /lib/systemd/systemd + version: stretch + - distribution: debian + init: /lib/systemd/systemd + version: jessie - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg +before_install: + - "sudo pip install yamllint" + - yamllint -c .yamllint.yml . + - "sudo docker pull ${distribution}:${version}" + - "sudo docker build --no-cache --rm --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests" script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check + - container_id=$(mktemp) + - role_name="ansible-rabbitmq" + - 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/${role_name}:ro ${distribution}-${version}:ansible ${init} > "${container_id}"' + - 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-lint -c /.ansible-lint /etc/ansible/roles/${role_name}/tests/test.yml' + - 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/${role_name}/tests/test.yml --syntax-check' + - 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/${role_name}/tests/test.yml' + - > + sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/${role_name}/tests/test.yml + | grep -q 'changed=0.*failed=0' + && (echo 'Idempotence test: pass' && exit 0) + || (echo 'Idempotence test: fail' && exit 1) + - 'sudo docker rm -f "$(cat ${container_id})"' notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file + webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/Vagrant/roles/ansible-rabbitmq b/Vagrant/roles/ansible-rabbitmq new file mode 120000 index 0000000..c25bddb --- /dev/null +++ b/Vagrant/roles/ansible-rabbitmq @@ -0,0 +1 @@ +../.. \ No newline at end of file diff --git a/Vagrant/roles/ansible-rabbitmq/.gitignore b/Vagrant/roles/ansible-rabbitmq/.gitignore deleted file mode 100644 index 409a2e0..0000000 --- a/Vagrant/roles/ansible-rabbitmq/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.retry -*.vagrant -.galaxy_install_info diff --git a/Vagrant/roles/ansible-rabbitmq/.travis.yml b/Vagrant/roles/ansible-rabbitmq/.travis.yml deleted file mode 100644 index 36bbf62..0000000 --- a/Vagrant/roles/ansible-rabbitmq/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/Vagrant/roles/ansible-rabbitmq/README.md b/Vagrant/roles/ansible-rabbitmq/README.md deleted file mode 100644 index 99c019d..0000000 --- a/Vagrant/roles/ansible-rabbitmq/README.md +++ /dev/null @@ -1,123 +0,0 @@ -Role Name -========= - -Installs rabbitmq https://www.rabbitmq.com/ (Configurable...HA and Clustering ready) - -Build Status ------------- - -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq) - -Requirements ------------- - -Ensure hostnames are resolvable prior to clustering...either update /etc/hosts or ensure DNS is working. - -Vagrant -------- - -Spin up a 3 node HA Cluster for testing... -Install Ansible role on your host: -```` -sudo ansible-galaxy install -r requirements.yml -f -```` -Now spin up your environment... -```` -vagrant up -```` -When you are done testing, tear it all down... -```` -./cleanup.sh -```` - -Role Variables --------------- - -```` ---- -# defaults file for ansible-rabbitmq -rabbitmq_config_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group -rabbitmq_enable_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group -rabbitmq_erlang_cookie: 'LSKNKBELKPSTDBBCHETL' #define erlang cookie for cluster...define here or in group_vars/group -rabbitmq_erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie' -rabbitmq_config: - - queue_name: logstash - durable: true - exchange_name: logstash - type: direct - routing_key: logstash - tags: 'ha-mode=all,ha-sync-mode=automatic' -rabbitmq_debian_repo: 'deb http://www.rabbitmq.com/debian/ testing main' -rabbitmq_debian_repo_key: 'http://www.rabbitmq.com/rabbitmq-signing-key-public.asc' -rabbitmq_master: [] #defines the inventory host that should be considered master...define here or in group_vars/group -rabbitmq_redhat_repo_key: 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc' -rabbitmq_redhat_package: 'rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch.rpm' -rabbitmq_redhat_url: 'http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}' -rabbitmq_redhat_version: '3.6.1' -rabbitmq_users: #define admin user to create in order to login to WebUI - - name: rabbitmqadmin - password: rabbitmqadmin - vhost: / - configure_priv: '.*' - read_priv: '.*' - write_priv: '.*' - tags: 'administrator' #define comma separated list of tags to assign to user....management,policymaker,monitoring,administrator...required for management plugin. https://www.rabbitmq.com/management.html -```` - -example... -group_vars/rabbitmq-cluster-nodes -```` ---- -rabbitmq_enable_clustering: true -rabbitmq_config_ha: false -rabbitmq_master: ans-test-1 -```` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -```` ---- -- hosts: all - become: true - vars: - - pri_domain_name: 'test.vagrant.local' - roles: - tasks: - - name: updating /etc/hosts - lineinfile: - dest: /etc/hosts - regexp: "^{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" - line: "{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" - state: present - with_items: "{{ groups['all'] }}" - -- hosts: all - become: true - vars: - - rabbitmq_config_ha: true - - rabbitmq_enable_clustering: true - - pri_domain_name: 'test.vagrant.local' - - rabbitmq_master: 'node0' - roles: - - role: ansible-rabbitmq - tasks: -```` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/Vagrantfile b/Vagrant/roles/ansible-rabbitmq/Vagrant/Vagrantfile deleted file mode 100644 index bca5718..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/Vagrantfile +++ /dev/null @@ -1,228 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# All Vagrant configuration is done below. The "2" in Vagrant.configure -# configures the configuration version (we support older styles for -# backwards compatibility). Please don't change it unless you know what -# you're doing. - -# ---- Define number of nodes to spin up ---- -N = 3 - -# ---- Define any custom memory/cpu requirement ---- -# if custom requirements are desired...ensure to set -# custom_cpu_mem == true otherwise set to false -# By default if custom requirements are defined and set below -# any node not defined will be configured as the default... -# which is 1vCPU/512mb...So if setting custom requirements -# only define any node which requires more than the defaults. -nodes = [ - { - :node => "node0", - :box => "mrlesmithjr/trusty64", - :cpu => 1, - :mem => 1024 - } -] - -# ---- Define variables below ---- -#Define if additional disks should be added (true|false) -additional_disks = false -additional_disks_controller = "SATA Controller" -#Define the number of additional disks to add -additional_disks_num = 1 -#Define disk size in GB -additional_disks_size = 10 -#Define if additional network adapters should be created (true|false) -additional_nics = true -#Define if add'l network adapters are auto configured addresses (true|false) -additional_nics_auto_config = true -#Define if additional network adapters should be DHCP assigned (true|false) -additional_nics_dhcp = false -#Define the number of additional nics to add -additional_nics_num = 1 -ansible_groups = { - "test-nodes" => ["node[0:#{N-1}]"] -} -#Define Vagrant box to load -box = "ubuntu/trusty64" -#Define if custom cpu and memory requirements are needed (true|false) - #defined within nodes variable above -custom_cpu_mem = false -#Define if running desktop OS (true|false) -desktop = false -#Define if custom boxes should be used...defined in nodes var.. -enable_custom_boxes = false -#Define if port forwards should be enabled (true|false) -enable_port_forwards = false -#Defines if nodes should be linked from master VM (true|false) -linked_clones = false -port_forwards = [ - { - :node => "node0", - :guest => 3306, - :host => 3306 - }, - { - :node => "node0", - :guest => 80, - :host => 8080 - }, - { - :node => "node0", - :guest => 8000, - :host => 8000 - } -] -#Define if provisioners should run (true|false) -provision_nodes = true -#Define if IP's are random assigned if not DHCP (true|false) -random_ips = false -#Define number of CPU cores - #will be ignored if custom_cpu_mem == true -server_cpus = 1 -#Define amount of memory to assign to node(s) - #will be ignored if custom_cpu_mem == true -server_memory = 512 -#Define subnet for private_network (If not using DHCP) -subnet = "192.168.202." -#Define starting last octet of the subnet range to begin addresses for node(s) -subnet_ip_start = 200 - -Vagrant.configure(2) do |config| - - #Iterate over nodes - (1..N).each do |node_id| - nid = (node_id - 1) - - config.vm.define "node#{nid}" do |node| - if enable_custom_boxes - #Initially no so it can be set to yes if found in custom box defined - box_set = "no" - nodes.each do |cust_box| - if cust_box[:node] == "node#{nid}" - node.vm.box = cust_box[:box] - box_set = "yes" - end - end - if box_set == "no" - node.vm.box = box - end - end - if not enable_custom_boxes - node.vm.box = box - end - node.vm.provider "virtualbox" do |vb| - if linked_clones - vb.linked_clone = true - end - if not custom_cpu_mem - vb.customize ["modifyvm", :id, "--cpus", server_cpus] - vb.customize ["modifyvm", :id, "--memory", server_memory] - end - if custom_cpu_mem - nodes.each do |cust_node| - if cust_node[:node] == "node#{nid}" - vb.customize ["modifyvm", :id, "--cpus", cust_node[:cpu]] - vb.customize ["modifyvm", :id, "--memory", cust_node[:mem]] - end - end - end - - # Setup desktop environment - if desktop - vb.gui = true - vb.customize ["modifyvm", :id, "--graphicscontroller", "vboxvga"] - vb.customize ["modifyvm", :id, "--accelerate3d", "on"] - vb.customize ["modifyvm", :id, "--ioapic", "on"] - vb.customize ["modifyvm", :id, "--vram", "128"] - vb.customize ["modifyvm", :id, "--hwvirtex", "on"] - end - - # Add additional disks - if additional_disks - (1..additional_disks_num).each do |disk_num| - dnum = (disk_num + 1) - ddev = ("node#{nid}_Disk#{dnum}.vdi") - unless File.exist?("#{ddev}") - vb.customize ['createhd', '--filename', ("#{ddev}"), \ - '--variant', 'Fixed', '--size', additional_disks_size * 1024] - end - vb.customize ['storageattach', :id, '--storagectl', \ - "#{additional_disks_controller}", '--port', dnum, '--device', 0, \ - '--type', 'hdd', '--medium', "node#{nid}_Disk#{dnum}.vdi"] - end - end - end - node.vm.hostname = "node#{nid}" - - # Define additional network adapters below - if additional_nics - if not additional_nics_dhcp - (1..additional_nics_num).each do |nic_num| - if random_ips - nnum = Random.rand(0..50) - if additional_nics_auto_config - node.vm.network :private_network, \ - ip: subnet+"#{subnet_ip_start + nid + nnum}" - end - if not additional_nics_auto_config - node.vm.network :private_network, \ - ip: subnet+"#{subnet_ip_start + nid + nnum}", - auto_config: false - end - end - if not random_ips - if additional_nics_auto_config - node.vm.network :private_network, \ - ip: subnet+"#{subnet_ip_start + nid}" - end - if not additional_nics_auto_config - node.vm.network :private_network, \ - ip: subnet+"#{subnet_ip_start + nid}", - auto_config: false - end - end - end - end - if additional_nics_dhcp - (1..additional_nics_num).each do |nic_num| - node.vm.network :private_network, type: "dhcp" - end - end - end - - # Define port forwards below - if enable_port_forwards - port_forwards.each do |pf| - if pf[:node] == "node#{nid}" - node.vm.network :forwarded_port, guest: pf[:guest], \ - host: pf[:host] - end - end - end - - # Provisioners - if provision_nodes - if node_id == N - node.vm.provision "ansible" do |ansible| - ansible.limit = "all" - #runs bootstrap Ansible playbook - ansible.playbook = "bootstrap.yml" - end - node.vm.provision "ansible" do |ansible| - ansible.limit = "all" - #runs Ansible playbook for installing roles/executing tasks - ansible.playbook = "playbook.yml" - ansible.groups = ansible_groups - end - end - end - - end - end - if provision_nodes - #runs initial shell script - config.vm.provision :shell, path: "bootstrap.sh", keep_color: "true" - end -end diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/bootstrap.sh b/Vagrant/roles/ansible-rabbitmq/Vagrant/bootstrap.sh deleted file mode 100755 index 5f1620e..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/bootstrap.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -if [ -f /etc/debian_version ]; then - codename="$(lsb_release -c | awk {'print $2}')" - if [[ $codename == "vivid" ]]; then - sudo apt-get update && \ - sudo apt-get -y install python-simplejson - fi - if [[ $codename == "wily" ]]; then - sudo apt-get update && \ - sudo apt-get -y install python-simplejson - fi - if [[ $codename == "xenial" ]]; then - sudo apt-get update && \ - sudo apt-get -y install python-simplejson - fi -fi -if [ -f /etc/redhat-release ]; then - codename="$(gawk -F= '/^NAME/{print $2}' /etc/os-release)" - if [[ $codename == "Fedora" ]]; then - sudo dnf -y install python-devel python-dnf && \ - sudo dnf -y group install "C Development Tools and Libraries" - fi -fi diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/bootstrap.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/bootstrap.yml deleted file mode 100644 index fbd17cb..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/bootstrap.yml +++ /dev/null @@ -1,180 +0,0 @@ ---- -- hosts: all - remote_user: vagrant - become: true - vars: - - host_vars_directory: './host_vars' - - host_vars_file: '{{ host_vars_directory }}/{{ inventory_hostname }}.yml' - - pri_domain_name: 'vagrant.local' - - ssh_key_path: '.vagrant/machines/{{ inventory_hostname }}/virtualbox/private_key' - - update_host_vars: true - roles: - tasks: - - name: updating apt cache (Debian) - apt: - update_cache: yes - cache_valid_time: 3600 - when: ansible_os_family == "Debian" - - - name: installing ansible pre-reqs (Debian) - apt: - name: "{{ item }}" - state: present - with_items: - - libffi-dev - - libssl-dev - - python-dev - - python-setuptools - when: > - ansible_os_family == "Debian" - - - name: installing epel repo (RedHat) - yum: - name: "epel-release" - state: present - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - - - name: installing ansible pre-reqs (RedHat) - yum: - name: "{{ item }}" - state: present - with_items: - - libffi-devel - - openssl-devel - - python-crypto - - python-devel - - python-setuptools - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - - - name: installing ansible pre-reqs (Fedora) - dnf: - name: "{{ item }}" - state: present - with_items: - - gmp-devel - - libffi-devel - - openssl-devel - - python-crypto - - python-devel - - python-dnf - - python-setuptools - - redhat-rpm-config - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - - - name: installing ansible pre-reqs (openSUSE) - zypper: - name: "{{ item }}" - state: present - with_items: - - gmp-devel - - libffi-devel - - openssl-devel - - python-crypto - - python-devel - - python-setuptools - when: > - ansible_os_family == "openSUSE Leap" - - - name: installing python pip - easy_install: - name: "pip" - state: present - - - name: installing ansible - pip: - name: "ansible" - state: present - version: 1.9.6 - - - name: ensuring host_vars directory exists - file: - path: "./host_vars" - state: directory - delegate_to: localhost - run_once: true - become: false - when: update_host_vars is defined and update_host_vars - - - name: ensuring host file exists in host_vars - stat: - path: "{{ host_vars_file }}" - delegate_to: localhost - register: host_var - become: false - when: > - update_host_vars is defined and - update_host_vars - - - name: creating missing host_vars - file: - path: "{{ host_vars_file }}" - state: touch - delegate_to: localhost - become: false - when: not host_var.stat.exists - - - name: updating ansible_ssh_port - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_port{{ ':' }}" - line: "ansible_ssh_port{{ ':' }} 22" - delegate_to: localhost - become: false - when: > - (update_host_vars is defined and - update_host_vars) and - (ansible_eth1 is defined or - ansible_enp0s8 is defined) - - - name: updating ansible_ssh_host - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_host{{ ':' }}" - line: "ansible_ssh_host{{ ':' }} {{ ansible_eth1.ipv4.address }}" - delegate_to: localhost - become: false - when: > - (update_host_vars is defined and - update_host_vars) and - ansible_eth1 is defined - - - name: updating ansible_ssh_host - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_host{{ ':' }}" - line: "ansible_ssh_host{{ ':' }} {{ ansible_enp0s8.ipv4.address }}" - delegate_to: localhost - become: false - when: > - (update_host_vars is defined and - update_host_vars) and - ansible_enp0s8 is defined - - - name: updating ansible_ssh_key - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_private_key_file{{ ':' }}" - line: "ansible_ssh_private_key_file{{ ':' }} {{ ssh_key_path }}" - delegate_to: localhost - become: false - when: > - update_host_vars is defined and - update_host_vars - - - name: ensuring host_vars is yaml formatted - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "---" - line: "---" - insertbefore: BOF - delegate_to: localhost - become: false - when: > - update_host_vars is defined and - update_host_vars diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/cleanup.sh b/Vagrant/roles/ansible-rabbitmq/Vagrant/cleanup.sh deleted file mode 100755 index a049429..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/cleanup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -vagrant destroy -f -if [ -d host_vars ]; then - rm -rf host_vars -fi -if [ -d .vagrant ]; then - rm -rf .vagrant -fi diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/playbook.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/playbook.yml deleted file mode 120000 index 7622583..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/playbook.yml +++ /dev/null @@ -1 +0,0 @@ -../playbook.yml \ No newline at end of file diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/requirements.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/requirements.yml deleted file mode 120000 index 6e76d52..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/requirements.yml +++ /dev/null @@ -1 +0,0 @@ -../requirements.yml \ No newline at end of file diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/README.md b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/README.md deleted file mode 100644 index 03cd1aa..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/README.md +++ /dev/null @@ -1,118 +0,0 @@ -Role Name -========= - -Installs rabbitmq https://www.rabbitmq.com/ (Configurable...HA and Clustering ready) - -Requirements ------------- - -Ensure hostnames are resolvable prior to clustering...either update /etc/hosts or ensure DNS is working. - -Vagrant -------- - -Spin up a 3 node HA Cluster for testing... -Install Ansible role on your host: -```` -sudo ansible-galaxy install -r requirements.yml -f -```` -Now spin up your environment... -```` -vagrant up -```` -When you are done testing, tear it all down... -```` -./cleanup.sh -```` - -Role Variables --------------- - -```` ---- -# defaults file for ansible-rabbitmq -rabbitmq_config_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group -rabbitmq_enable_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group -rabbitmq_erlang_cookie: 'LSKNKBELKPSTDBBCHETL' #define erlang cookie for cluster...define here or in group_vars/group -rabbitmq_erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie' -rabbitmq_config: - - queue_name: logstash - durable: true - exchange_name: logstash - type: direct - routing_key: logstash - tags: 'ha-mode=all,ha-sync-mode=automatic' -rabbitmq_debian_repo: 'deb http://www.rabbitmq.com/debian/ testing main' -rabbitmq_debian_repo_key: 'http://www.rabbitmq.com/rabbitmq-signing-key-public.asc' -rabbitmq_master: [] #defines the inventory host that should be considered master...define here or in group_vars/group -rabbitmq_redhat_repo_key: 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc' -rabbitmq_redhat_package: 'rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch.rpm' -rabbitmq_redhat_url: 'http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}' -rabbitmq_redhat_version: '3.6.1' -rabbitmq_users: #define admin user to create in order to login to WebUI - - name: rabbitmqadmin - password: rabbitmqadmin - vhost: / - configure_priv: '.*' - read_priv: '.*' - write_priv: '.*' - tags: 'administrator' #define comma separated list of tags to assign to user....management,policymaker,monitoring,administrator...required for management plugin. https://www.rabbitmq.com/management.html -```` - -example... -group_vars/rabbitmq-cluster-nodes -```` ---- -rabbitmq_enable_clustering: true -rabbitmq_config_ha: false -rabbitmq_master: ans-test-1 -```` - -Dependencies ------------- - -None - -Example Playbook ----------------- - -```` ---- -- hosts: all - become: true - vars: - - pri_domain_name: 'test.vagrant.local' - roles: - tasks: - - name: updating /etc/hosts - lineinfile: - dest: /etc/hosts - regexp: "^{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" - line: "{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" - state: present - with_items: groups['all'] - -- hosts: all - become: true - vars: - - rabbitmq_config_ha: true - - rabbitmq_enable_clustering: true - - pri_domain_name: 'test.vagrant.local' - - rabbitmq_master: 'node0' - roles: - - role: ansible-rabbitmq - tasks: -```` - -License -------- - -BSD - -Author Information ------------------- - -Larry Smith Jr. -- @mrlesmithjr -- http://everythingshouldbevirtual.com -- mrlesmithjr [at] gmail.com diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/Vagrantfile b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/Vagrantfile deleted file mode 100644 index 9c68a3d..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/Vagrantfile +++ /dev/null @@ -1,63 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# All Vagrant configuration is done below. The "2" in Vagrant.configure -# configures the configuration version (we support older styles for -# backwards compatibility). Please don't change it unless you know what -# you're doing. -Vagrant.configure(2) do |config| - #Define if running desktop OS to yes otherwise no - Desktop = "no" - #Define the number of nodes to spin up - N = 3 - - #Iterate over nodes - (1..N).each do |node_id| - nid = (node_id - 1) - - config.vm.define "node#{nid}" do |node| - node.vm.box = "mrlesmithjr/centos-7" - node.vm.provider "virtualbox" do |vb| - vb.memory = "1024" - vb.cpus = "1" - if Desktop == "yes" - vb.gui = true - vb.customize ["modifyvm", :id, "--graphicscontroller", "vboxvga"] - vb.customize ["modifyvm", :id, "--accelerate3d", "on"] - vb.customize ["modifyvm", :id, "--ioapic", "on"] - vb.customize ["modifyvm", :id, "--vram", "128"] - vb.customize ["modifyvm", :id, "--hwvirtex", "on"] - end - end - node.vm.hostname = "node#{nid}" - ### Define additional network adapters below - node.vm.network :private_network, ip: "192.168.202.#{200 + nid}" - - ### Define port forwards below -# node.vm.network "forwarded_port", guest: 80, host: "#{8080 + nid}" -# node.vm.network "forwarded_port", guest: 3000, host: "#{3000 + nid}" - - if node_id == N - node.vm.provision :shell, path: "bootstrap.sh", keep_color: "true" #runs initial shell script - node.vm.provision "ansible" do |ansible| #runs bootstrap Ansible playbook - ansible.limit = "all" - ansible.playbook = "bootstrap.yml" - end - node.vm.provision "ansible" do |ansible| #runs Ansible playbook for installing roles/executing tasks - ansible.limit = "all" - ansible.playbook = "playbook.yml" - ansible.groups = { - "test-nodes" => [ - "node0", - "node1" - ], - "prod-nodes" => [ - "node2" - ] - } - end - end - - end - end -end diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/ansible.cfg b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/ansible.cfg deleted file mode 100644 index 5a1e589..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/ansible.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[defaults] -host_key_checking = False -#roles_path = ../ diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/bootstrap.sh b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/bootstrap.sh deleted file mode 100755 index 7bcf8b0..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/bootstrap.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -if [ -f /etc/debian_version ]; then - codename="$(lsb_release -c | awk {'print $2}')" - if [ $codename == "vivid" ]; then - sudo apt-get update && sudo apt-get -y install python-simplejson - fi -fi -if [ -f /etc/redhat-release ]; then - codename="$(gawk -F= '/^NAME/{print $2}' /etc/os-release)" - if [ $codename == "Fedora" ]; then - sudo dnf -y install python-devel python-dnf python-pip && \ - sudo dnf -y group install "C Development Tools and Libraries" - fi -fi diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/bootstrap.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/bootstrap.yml deleted file mode 100644 index 702b540..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/bootstrap.yml +++ /dev/null @@ -1,152 +0,0 @@ ---- -- hosts: all - remote_user: vagrant - become: true - vars: - - host_vars_directory: './host_vars' - - host_vars_file: '{{ host_vars_directory }}/{{ inventory_hostname }}.yml' - - pri_domain_name: 'vagrant.local' - - ssh_key_path: '.vagrant/machines/{{ inventory_hostname }}/virtualbox/private_key' - - update_host_vars: true - roles: - tasks: - - name: updating apt cache (Debian) - apt: - update_cache: yes - cache_valid_time: 3600 - when: ansible_os_family == "Debian" - - - name: installing ansible pre-reqs (Debian) - apt: - name: "{{ item }}" - state: present - with_items: - - python-dev - - python-pip - when: ansible_os_family == "Debian" - - - name: installing epel repo (RedHat) - yum: - name: "epel-release" - state: present - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - - - name: installing ansible pre-reqs (RedHat) - yum: - name: "{{ item }}" - state: present - with_items: - - python-devel - - python-dnf - - python-pip - when: > - ansible_os_family == "RedHat" and - ansible_distribution != "Fedora" - - - name: installing ansible pre-reqs (Fedora) - dnf: - name: "{{ item }}" - state: present - with_items: - - gmp-devel - - python-crypto - - python-devel - - python-dnf - - python-pip - when: > - ansible_os_family == "RedHat" and - ansible_distribution == "Fedora" - - - name: installing ansible - pip: - name: "ansible" - state: present - - - name: ensuring host_vars directory exists - file: - path: "./host_vars" - state: directory - delegate_to: localhost - run_once: true - become: false - when: update_host_vars is defined and update_host_vars - - - name: ensuring host file exists in host_vars - stat: - path: "{{ host_vars_file }}" - delegate_to: localhost - register: host_var - become: false - when: > - update_host_vars is defined and - update_host_vars - - - name: creating missing host_vars - file: - path: "{{ host_vars_file }}" - state: touch - delegate_to: localhost - become: false - when: not host_var.stat.exists - - - name: updating ansible_ssh_port - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_port{{ ':' }}" - line: "ansible_ssh_port{{ ':' }} 22" - delegate_to: localhost - become: false - when: > - (update_host_vars is defined and - update_host_vars) and - (ansible_eth1 is defined or - ansible_enp0s8 is defined) - - - name: updating ansible_ssh_host - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_host{{ ':' }}" - line: "ansible_ssh_host{{ ':' }} {{ ansible_eth1.ipv4.address }}" - delegate_to: localhost - become: false - when: > - (update_host_vars is defined and - update_host_vars) and - ansible_eth1 is defined - - - name: updating ansible_ssh_host - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_host{{ ':' }}" - line: "ansible_ssh_host{{ ':' }} {{ ansible_enp0s8.ipv4.address }}" - delegate_to: localhost - become: false - when: > - (update_host_vars is defined and - update_host_vars) and - ansible_enp0s8 is defined - - - name: updating ansible_ssh_key - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "^ansible_ssh_private_key_file{{ ':' }}" - line: "ansible_ssh_private_key_file{{ ':' }} {{ ssh_key_path }}" - delegate_to: localhost - become: false - when: > - update_host_vars is defined and - update_host_vars - - - name: ensuring host_vars is yaml formatted - lineinfile: - dest: "{{ host_vars_file }}" - regexp: "---" - line: "---" - insertbefore: BOF - delegate_to: localhost - become: false - when: > - update_host_vars is defined and - update_host_vars diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/cleanup.sh b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/cleanup.sh deleted file mode 100755 index a049429..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/cleanup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -vagrant destroy -f -if [ -d host_vars ]; then - rm -rf host_vars -fi -if [ -d .vagrant ]; then - rm -rf .vagrant -fi diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/defaults/main.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/defaults/main.yml deleted file mode 100644 index ad22ead..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/defaults/main.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -# defaults file for ansible-rabbitmq -rabbitmq_config: - - queue_name: 'logstash' - durable: true - exchange_name: logstash - type: 'direct' - routing_key: 'logstash' - tags: 'ha-mode=all,ha-sync-mode=automatic' -rabbitmq_config_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group -rabbitmq_debian_repo: 'deb http://www.rabbitmq.com/debian/ testing main' -rabbitmq_debian_repo_key: 'https://www.rabbitmq.com/rabbitmq-release-signing-key.asc' -rabbitmq_enable_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group -rabbitmq_erlang_cookie: 'LSKNKBELKPSTDBBCHETL' #define erlang cookie for cluster...define here or in group_vars/group -rabbitmq_erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie' -rabbitmq_master: [] #defines the inventory host that should be considered master...define here or in group_vars/group -rabbitmq_redhat_repo_key: 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc' -rabbitmq_redhat_package: 'rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch.rpm' -rabbitmq_redhat_url: 'http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}' -rabbitmq_redhat_version: '3.6.1' -rabbitmq_users: #define admin user to create in order to login to WebUI - - name: 'rabbitmqadmin' - password: 'rabbitmqadmin' - vhost: '/' - configure_priv: '.*' - read_priv: '.*' - write_priv: '.*' - tags: 'administrator' #define comma separated list of tags to assign to user....management,policymaker,monitoring,administrator...required for management plugin. https://www.rabbitmq.com/management.html diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/handlers/main.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/handlers/main.yml deleted file mode 100644 index 259ce1c..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# handlers file for ansible-rabbitmq -- name: restart rabbitmq-server - service: - name: "rabbitmq-server" - state: restarted diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/meta/main.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/meta/main.yml deleted file mode 100644 index b25c818..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/meta/main.yml +++ /dev/null @@ -1,137 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: Installs rabbitmq https://www.rabbitmq.com/ (Configurable...HA and Clustering ready) - #company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - # - all - # - 5 - # - 6 - - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - - name: Fedora - versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - - 22 - - 23 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - - trusty - # - utopic - # - vivid - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - - clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - - system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/playbook.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/playbook.yml deleted file mode 100644 index 498c829..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/playbook.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- hosts: all - become: true - vars: - - pri_domain_name: 'test.vagrant.local' - roles: - tasks: - - name: updating /etc/hosts - lineinfile: - dest: /etc/hosts - regexp: "^{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" - line: "{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" - state: present - with_items: groups['all'] - -- hosts: all - become: true - vars: - - rabbitmq_config_ha: true - - rabbitmq_enable_clustering: true - - pri_domain_name: 'test.vagrant.local' - - rabbitmq_master: 'node0' - roles: - - role: ansible-rabbitmq - tasks: diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/requirements.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/requirements.yml deleted file mode 100644 index a1f51cb..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/requirements.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- src: https://github.com/mrlesmithjr/ansible-rabbitmq.git diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/debian.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/debian.yml deleted file mode 100644 index a031ead..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/debian.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- name: debian | adding RabbitMQ public GPG key to the apt repo - apt_key: - url: "{{ rabbitmq_debian_repo_key }}" - state: present - -- name: debian | adding RabbitMQ repo - apt_repository: - repo: "{{ rabbitmq_debian_repo }}" - state: present - register: "rabbitmq_repo_added" - -- name: debian | updating apt cache - apt: - update_cache: yes - when: rabbitmq_repo_added.changed - -- name: debian | installing RabbitMQ server - apt: - name: "{{ item }}" - state: present - with_items: - - rabbitmq-server - -- name: debian | enabling the RabbitMQ Management Console - rabbitmq_plugin: - names: rabbitmq_management - state: enabled - notify: restart rabbitmq-server - -- name: debian | ensuring that the RabbitMQ service is running - service: - name: rabbitmq-server - state: started - enabled: yes diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/fedora.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/fedora.yml deleted file mode 100644 index 3d92963..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/fedora.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- name: fedora | installing pre-reqs - dnf: - name: "{{ item }}" - state: present - with_items: - - wget - -- name: fedora | installing erlang - dnf: - name: "erlang" - state: present - -- name: fedora | adding RabbitMQ public GPG key - rpm_key: - key: "{{ rabbitmq_redhat_repo_key }}" - state: present - -- name: fedora | downloading RabbitMQ - get_url: - url: "{{ rabbitmq_redhat_url }}/{{ rabbitmq_redhat_package }}" - dest: "/opt/{{ rabbitmq_redhat_package }}" - -- name: fedora | installing RabbitMQ - dnf: - name: "/opt/{{ rabbitmq_redhat_package }}" - state: present - -- name: fedora | starting and enabling RabbitMQ service - service: - name: "rabbitmq-server" - state: started - enabled: yes - -- name: fedora | enabling the RabbitMQ Management Console - rabbitmq_plugin: - names: rabbitmq_management - state: enabled - notify: restart rabbitmq-server diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/main.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/main.yml deleted file mode 100644 index bd82f93..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/main.yml +++ /dev/null @@ -1,21 +0,0 @@ -# tasks file for ansible-rabbitmq -- include: debian.yml - when: ansible_os_family == "Debian" - -- include: redhat.yml - when: ansible_distribution == "CentOS" or ansible_distribution == "Red Hat Enterprise Linux" - -- include: fedora.yml - when: ansible_distribution == "Fedora" - -- name: checking to see if already clustered - stat: path=/etc/rabbitmq/clustered - register: clustered - -- include: rabbitmq_clustering.yml - when: rabbitmq_enable_clustering and (clustered.stat.exists != True) - -- include: rabbitmq_ha_config.yml - when: rabbitmq_config_ha and rabbitmq_enable_clustering - -- include: rabbitmq_users.yml diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_clustering.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_clustering.yml deleted file mode 100644 index 9dece46..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_clustering.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -- name: rabbitmq_clustering | stopping rabbitmq app - command: rabbitmqctl stop_app - -- name: rabbitmq_clustering | resetting rabbitmq app - command: rabbitmqctl reset - -- name: rabbitmq_clustering | stopping rabbitmq-server - service: - name: rabbitmq-server - state: stopped - -#- name: grabbing erlang cookie -# shell: cat /var/lib/rabbitmq/.erlang.cookie -# register: rabbitmq_erlang_cookie -# when: inventory_hostname == "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | copy erlang cookie - template: - src: erlang.cookie.j2 - dest: "{{ rabbitmq_erlang_cookie_file }}" - owner: rabbitmq - group: rabbitmq - mode: 0400 - backup: yes #backing up in case the need to recover -# when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | restarting rabbitmq-server on master - service: - name: rabbitmq-server - state: restarted - when: inventory_hostname == "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | starting rabbitmq app on master - command: rabbitmqctl start_app - register: cluster_master - when: inventory_hostname == "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | sending sigterm to any running rabbitmq processes - shell: pkill -u rabbitmq || true - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | restarting rabbitmq-server - service: - name: rabbitmq-server - state: restarted - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | stopping rabbitmq app - command: rabbitmqctl stop_app - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | resetting rabbitmq app - command: rabbitmqctl reset - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | joining rabbitmq cluster - command: rabbitmqctl join_cluster 'rabbit@{{ rabbitmq_master }}' - register: cluster_joined - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | starting rabbitmq app - command: rabbitmqctl start_app - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | marking as clustered - file: - path: /etc/rabbitmq/clustered - state: touch - when: cluster_master.changed or cluster_joined.changed diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml deleted file mode 100644 index 8811b6d..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- name: rabbitmq_ha_config | checking if rabbitmqadmin is installed - stat: - path: /usr/sbin/rabbitmqadmin - register: rabbitmqadmin_check - -- name: rabbitmq_ha_config | install rabbitMQ admin - shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin - when: not rabbitmqadmin_check.stat.exists - -- name: rabbitmq_ha_config | moving the rabbitMQ Admin - shell: mv rabbitmqadmin /usr/sbin - when: not rabbitmqadmin_check.stat.exists - -- name: rabbitmq_ha_config | making executable rabbitMQ Admin - shell: chmod +x /usr/sbin/rabbitmqadmin - notify: restart rabbitmq-server - 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 }} - run_once: true - with_items: "{{ rabbitmq_config }}" - -- name: rabbitmq_ha_config | setting up ha on queue(s) - rabbitmq_policy: - name: "ha-all" - pattern: "{{ item.queue_name }}" - tags: "{{ item.tags }}" - state: present - run_once: true - with_items: "{{ rabbitmq_config }}" - -- name: rabbitmq_ha_config | creating exchange(s) - command: rabbitmqadmin declare exchange name={{ item.exchange_name }} type={{ item.type }} - run_once: true - with_items: "{{ rabbitmq_config }}" - when: item.exchange_name is defined - -- name: rabbitmq_ha_config | creating binding(s) - command: rabbitmqadmin declare binding source={{ item.exchange_name }} destination_type="queue" destination={{ item.queue_name }} routing_key={{ item.routing_key }} - run_once: true - with_items: "{{ rabbitmq_config }}" - when: item.exchange_name is defined diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_users.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_users.yml deleted file mode 100644 index 8bce8b2..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_users.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: rabbitmq_users | creating rabbitmq users - rabbitmq_user: - name: "{{ item.name }}" - password: "{{ item.password }}" - vhost: "{{ item.vhost }}" - configure_priv: "{{ item.configure_priv }}" - read_priv: "{{ item.read_priv }}" - write_priv: "{{ item.write_priv }}" - tags: "{{ item.tags }}" - state: present - with_items: "{{ rabbitmq_users }}" - when: (rabbitmq_enable_clustering is defined and not rabbitmq_enable_clustering) or rabbitmq_enable_clustering is not defined - -- name: rabbitmq_users | creating rabbitmq users - rabbitmq_user: - name: "{{ item.name }}" - password: "{{ item.password }}" - vhost: "{{ item.vhost }}" - configure_priv: "{{ item.configure_priv }}" - read_priv: "{{ item.read_priv }}" - write_priv: "{{ item.write_priv }}" - tags: "{{ item.tags }}" - state: present - run_once: yes - with_items: "{{ rabbitmq_users }}" - when: (rabbitmq_enable_clustering is defined and rabbitmq_enable_clustering) diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/redhat.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/redhat.yml deleted file mode 100644 index 484597d..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/tasks/redhat.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- name: redhat | installing pre-reqs - yum: - name: "{{ item }}" - state: present - with_items: - - epel-release - - wget - -- name: redhat | installing erlang - yum: - name: "erlang" - state: present - -- name: redhat | adding RabbitMQ public GPG key - rpm_key: - key: "{{ rabbitmq_redhat_repo_key }}" - state: present - -- name: redhat | downloading RabbitMQ - get_url: - url: "{{ rabbitmq_redhat_url }}/{{ rabbitmq_redhat_package }}" - dest: "/opt/{{ rabbitmq_redhat_package }}" - -- name: redhat | installing RabbitMQ - yum: - name: "/opt/{{ rabbitmq_redhat_package }}" - state: present - -- name: redhat | starting and enabling RabbitMQ service - service: - name: "rabbitmq-server" - state: started - enabled: yes - -- name: redhat | enabling the RabbitMQ Management Console - rabbitmq_plugin: - names: rabbitmq_management - state: enabled - notify: restart rabbitmq-server diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/templates/erlang.cookie.j2 b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/templates/erlang.cookie.j2 deleted file mode 100644 index edd141f..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/templates/erlang.cookie.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ rabbitmq_erlang_cookie }} diff --git a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/vars/main.yml b/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/vars/main.yml deleted file mode 100644 index 5977bc8..0000000 --- a/Vagrant/roles/ansible-rabbitmq/Vagrant/roles/ansible-rabbitmq/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-rabbitmq diff --git a/Vagrant/roles/ansible-rabbitmq/ansible.cfg b/Vagrant/roles/ansible-rabbitmq/ansible.cfg deleted file mode 100644 index 5a1e589..0000000 --- a/Vagrant/roles/ansible-rabbitmq/ansible.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[defaults] -host_key_checking = False -#roles_path = ../ diff --git a/Vagrant/roles/ansible-rabbitmq/defaults/main.yml b/Vagrant/roles/ansible-rabbitmq/defaults/main.yml deleted file mode 100644 index ad22ead..0000000 --- a/Vagrant/roles/ansible-rabbitmq/defaults/main.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -# defaults file for ansible-rabbitmq -rabbitmq_config: - - queue_name: 'logstash' - durable: true - exchange_name: logstash - type: 'direct' - routing_key: 'logstash' - tags: 'ha-mode=all,ha-sync-mode=automatic' -rabbitmq_config_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group -rabbitmq_debian_repo: 'deb http://www.rabbitmq.com/debian/ testing main' -rabbitmq_debian_repo_key: 'https://www.rabbitmq.com/rabbitmq-release-signing-key.asc' -rabbitmq_enable_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group -rabbitmq_erlang_cookie: 'LSKNKBELKPSTDBBCHETL' #define erlang cookie for cluster...define here or in group_vars/group -rabbitmq_erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie' -rabbitmq_master: [] #defines the inventory host that should be considered master...define here or in group_vars/group -rabbitmq_redhat_repo_key: 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc' -rabbitmq_redhat_package: 'rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch.rpm' -rabbitmq_redhat_url: 'http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}' -rabbitmq_redhat_version: '3.6.1' -rabbitmq_users: #define admin user to create in order to login to WebUI - - name: 'rabbitmqadmin' - password: 'rabbitmqadmin' - vhost: '/' - configure_priv: '.*' - read_priv: '.*' - write_priv: '.*' - tags: 'administrator' #define comma separated list of tags to assign to user....management,policymaker,monitoring,administrator...required for management plugin. https://www.rabbitmq.com/management.html diff --git a/Vagrant/roles/ansible-rabbitmq/handlers/main.yml b/Vagrant/roles/ansible-rabbitmq/handlers/main.yml deleted file mode 100644 index 259ce1c..0000000 --- a/Vagrant/roles/ansible-rabbitmq/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# handlers file for ansible-rabbitmq -- name: restart rabbitmq-server - service: - name: "rabbitmq-server" - state: restarted diff --git a/Vagrant/roles/ansible-rabbitmq/meta/main.yml b/Vagrant/roles/ansible-rabbitmq/meta/main.yml deleted file mode 100644 index b25c818..0000000 --- a/Vagrant/roles/ansible-rabbitmq/meta/main.yml +++ /dev/null @@ -1,137 +0,0 @@ ---- -galaxy_info: - author: Larry Smith Jr. - description: Installs rabbitmq https://www.rabbitmq.com/ (Configurable...HA and Clustering ready) - #company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - - name: EL - versions: - # - all - # - 5 - # - 6 - - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - - name: Fedora - versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - - 22 - - 23 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - - name: Ubuntu - versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - - trusty - # - utopic - # - vivid - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - - clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - - system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/Vagrant/roles/ansible-rabbitmq/playbook.yml b/Vagrant/roles/ansible-rabbitmq/playbook.yml deleted file mode 100644 index 1968320..0000000 --- a/Vagrant/roles/ansible-rabbitmq/playbook.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- hosts: all - become: true - vars: - pri_domain_name: 'test.vagrant.local' - roles: - tasks: - - name: updating /etc/hosts - lineinfile: - dest: /etc/hosts - regexp: "^{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" - line: "{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" - state: present - with_items: "{{ groups['all'] }}" - -- hosts: all - become: true - vars: - pri_domain_name: 'test.vagrant.local' - rabbitmq_config_ha: true - rabbitmq_enable_clustering: true - rabbitmq_master: 'node0' - roles: - - role: ansible-rabbitmq - tasks: diff --git a/Vagrant/roles/ansible-rabbitmq/requirements.yml b/Vagrant/roles/ansible-rabbitmq/requirements.yml deleted file mode 100644 index a1f51cb..0000000 --- a/Vagrant/roles/ansible-rabbitmq/requirements.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- src: https://github.com/mrlesmithjr/ansible-rabbitmq.git diff --git a/Vagrant/roles/ansible-rabbitmq/tasks/debian.yml b/Vagrant/roles/ansible-rabbitmq/tasks/debian.yml deleted file mode 100644 index a031ead..0000000 --- a/Vagrant/roles/ansible-rabbitmq/tasks/debian.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- name: debian | adding RabbitMQ public GPG key to the apt repo - apt_key: - url: "{{ rabbitmq_debian_repo_key }}" - state: present - -- name: debian | adding RabbitMQ repo - apt_repository: - repo: "{{ rabbitmq_debian_repo }}" - state: present - register: "rabbitmq_repo_added" - -- name: debian | updating apt cache - apt: - update_cache: yes - when: rabbitmq_repo_added.changed - -- name: debian | installing RabbitMQ server - apt: - name: "{{ item }}" - state: present - with_items: - - rabbitmq-server - -- name: debian | enabling the RabbitMQ Management Console - rabbitmq_plugin: - names: rabbitmq_management - state: enabled - notify: restart rabbitmq-server - -- name: debian | ensuring that the RabbitMQ service is running - service: - name: rabbitmq-server - state: started - enabled: yes diff --git a/Vagrant/roles/ansible-rabbitmq/tasks/fedora.yml b/Vagrant/roles/ansible-rabbitmq/tasks/fedora.yml deleted file mode 100644 index 3d92963..0000000 --- a/Vagrant/roles/ansible-rabbitmq/tasks/fedora.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- name: fedora | installing pre-reqs - dnf: - name: "{{ item }}" - state: present - with_items: - - wget - -- name: fedora | installing erlang - dnf: - name: "erlang" - state: present - -- name: fedora | adding RabbitMQ public GPG key - rpm_key: - key: "{{ rabbitmq_redhat_repo_key }}" - state: present - -- name: fedora | downloading RabbitMQ - get_url: - url: "{{ rabbitmq_redhat_url }}/{{ rabbitmq_redhat_package }}" - dest: "/opt/{{ rabbitmq_redhat_package }}" - -- name: fedora | installing RabbitMQ - dnf: - name: "/opt/{{ rabbitmq_redhat_package }}" - state: present - -- name: fedora | starting and enabling RabbitMQ service - service: - name: "rabbitmq-server" - state: started - enabled: yes - -- name: fedora | enabling the RabbitMQ Management Console - rabbitmq_plugin: - names: rabbitmq_management - state: enabled - notify: restart rabbitmq-server diff --git a/Vagrant/roles/ansible-rabbitmq/tasks/main.yml b/Vagrant/roles/ansible-rabbitmq/tasks/main.yml deleted file mode 100644 index bd82f93..0000000 --- a/Vagrant/roles/ansible-rabbitmq/tasks/main.yml +++ /dev/null @@ -1,21 +0,0 @@ -# tasks file for ansible-rabbitmq -- include: debian.yml - when: ansible_os_family == "Debian" - -- include: redhat.yml - when: ansible_distribution == "CentOS" or ansible_distribution == "Red Hat Enterprise Linux" - -- include: fedora.yml - when: ansible_distribution == "Fedora" - -- name: checking to see if already clustered - stat: path=/etc/rabbitmq/clustered - register: clustered - -- include: rabbitmq_clustering.yml - when: rabbitmq_enable_clustering and (clustered.stat.exists != True) - -- include: rabbitmq_ha_config.yml - when: rabbitmq_config_ha and rabbitmq_enable_clustering - -- include: rabbitmq_users.yml diff --git a/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_clustering.yml b/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_clustering.yml deleted file mode 100644 index 5134c50..0000000 --- a/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_clustering.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -- name: rabbitmq_clustering | stopping rabbitmq app - command: rabbitmqctl stop_app - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | resetting rabbitmq app - command: rabbitmqctl reset - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | stopping rabbitmq-server - service: - name: rabbitmq-server - state: stopped - -#- name: grabbing erlang cookie -# shell: cat /var/lib/rabbitmq/.erlang.cookie -# register: rabbitmq_erlang_cookie -# when: inventory_hostname == "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | copy erlang cookie - template: - src: erlang.cookie.j2 - dest: "{{ rabbitmq_erlang_cookie_file }}" - owner: rabbitmq - group: rabbitmq - mode: 0400 - backup: yes #backing up in case the need to recover -# when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | restarting rabbitmq-server on master - service: - name: rabbitmq-server - state: restarted - when: inventory_hostname == "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | starting rabbitmq app on master - command: rabbitmqctl start_app - register: cluster_master - when: inventory_hostname == "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | sending sigterm to any running rabbitmq processes - shell: pkill -u rabbitmq || true - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | restarting rabbitmq-server - service: - name: rabbitmq-server - state: restarted - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | stopping rabbitmq app - command: rabbitmqctl stop_app - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | resetting rabbitmq app - command: rabbitmqctl reset - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | joining rabbitmq cluster - command: rabbitmqctl join_cluster "rabbit@{{ hostvars[rabbitmq_master]['ansible_hostname'] }}" - register: cluster_joined - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | starting rabbitmq app - command: rabbitmqctl start_app - when: inventory_hostname != "{{ rabbitmq_master }}" - -- name: rabbitmq_clustering | marking as clustered - file: - path: /etc/rabbitmq/clustered - state: touch - when: cluster_master.changed or cluster_joined.changed diff --git a/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml b/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml deleted file mode 100644 index 8811b6d..0000000 --- a/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_ha_config.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- name: rabbitmq_ha_config | checking if rabbitmqadmin is installed - stat: - path: /usr/sbin/rabbitmqadmin - register: rabbitmqadmin_check - -- name: rabbitmq_ha_config | install rabbitMQ admin - shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin - when: not rabbitmqadmin_check.stat.exists - -- name: rabbitmq_ha_config | moving the rabbitMQ Admin - shell: mv rabbitmqadmin /usr/sbin - when: not rabbitmqadmin_check.stat.exists - -- name: rabbitmq_ha_config | making executable rabbitMQ Admin - shell: chmod +x /usr/sbin/rabbitmqadmin - notify: restart rabbitmq-server - 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 }} - run_once: true - with_items: "{{ rabbitmq_config }}" - -- name: rabbitmq_ha_config | setting up ha on queue(s) - rabbitmq_policy: - name: "ha-all" - pattern: "{{ item.queue_name }}" - tags: "{{ item.tags }}" - state: present - run_once: true - with_items: "{{ rabbitmq_config }}" - -- name: rabbitmq_ha_config | creating exchange(s) - command: rabbitmqadmin declare exchange name={{ item.exchange_name }} type={{ item.type }} - run_once: true - with_items: "{{ rabbitmq_config }}" - when: item.exchange_name is defined - -- name: rabbitmq_ha_config | creating binding(s) - command: rabbitmqadmin declare binding source={{ item.exchange_name }} destination_type="queue" destination={{ item.queue_name }} routing_key={{ item.routing_key }} - run_once: true - with_items: "{{ rabbitmq_config }}" - when: item.exchange_name is defined diff --git a/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_users.yml b/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_users.yml deleted file mode 100644 index 8bce8b2..0000000 --- a/Vagrant/roles/ansible-rabbitmq/tasks/rabbitmq_users.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: rabbitmq_users | creating rabbitmq users - rabbitmq_user: - name: "{{ item.name }}" - password: "{{ item.password }}" - vhost: "{{ item.vhost }}" - configure_priv: "{{ item.configure_priv }}" - read_priv: "{{ item.read_priv }}" - write_priv: "{{ item.write_priv }}" - tags: "{{ item.tags }}" - state: present - with_items: "{{ rabbitmq_users }}" - when: (rabbitmq_enable_clustering is defined and not rabbitmq_enable_clustering) or rabbitmq_enable_clustering is not defined - -- name: rabbitmq_users | creating rabbitmq users - rabbitmq_user: - name: "{{ item.name }}" - password: "{{ item.password }}" - vhost: "{{ item.vhost }}" - configure_priv: "{{ item.configure_priv }}" - read_priv: "{{ item.read_priv }}" - write_priv: "{{ item.write_priv }}" - tags: "{{ item.tags }}" - state: present - run_once: yes - with_items: "{{ rabbitmq_users }}" - when: (rabbitmq_enable_clustering is defined and rabbitmq_enable_clustering) diff --git a/Vagrant/roles/ansible-rabbitmq/tasks/redhat.yml b/Vagrant/roles/ansible-rabbitmq/tasks/redhat.yml deleted file mode 100644 index 484597d..0000000 --- a/Vagrant/roles/ansible-rabbitmq/tasks/redhat.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- name: redhat | installing pre-reqs - yum: - name: "{{ item }}" - state: present - with_items: - - epel-release - - wget - -- name: redhat | installing erlang - yum: - name: "erlang" - state: present - -- name: redhat | adding RabbitMQ public GPG key - rpm_key: - key: "{{ rabbitmq_redhat_repo_key }}" - state: present - -- name: redhat | downloading RabbitMQ - get_url: - url: "{{ rabbitmq_redhat_url }}/{{ rabbitmq_redhat_package }}" - dest: "/opt/{{ rabbitmq_redhat_package }}" - -- name: redhat | installing RabbitMQ - yum: - name: "/opt/{{ rabbitmq_redhat_package }}" - state: present - -- name: redhat | starting and enabling RabbitMQ service - service: - name: "rabbitmq-server" - state: started - enabled: yes - -- name: redhat | enabling the RabbitMQ Management Console - rabbitmq_plugin: - names: rabbitmq_management - state: enabled - notify: restart rabbitmq-server diff --git a/Vagrant/roles/ansible-rabbitmq/templates/erlang.cookie.j2 b/Vagrant/roles/ansible-rabbitmq/templates/erlang.cookie.j2 deleted file mode 100644 index edd141f..0000000 --- a/Vagrant/roles/ansible-rabbitmq/templates/erlang.cookie.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ rabbitmq_erlang_cookie }} diff --git a/Vagrant/roles/ansible-rabbitmq/tests/inventory b/Vagrant/roles/ansible-rabbitmq/tests/inventory deleted file mode 100644 index d18580b..0000000 --- a/Vagrant/roles/ansible-rabbitmq/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/Vagrant/roles/ansible-rabbitmq/tests/test.yml b/Vagrant/roles/ansible-rabbitmq/tests/test.yml deleted file mode 100644 index 9b96df5..0000000 --- a/Vagrant/roles/ansible-rabbitmq/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-rabbitmq \ No newline at end of file diff --git a/Vagrant/roles/ansible-rabbitmq/vars/main.yml b/Vagrant/roles/ansible-rabbitmq/vars/main.yml deleted file mode 100644 index 5977bc8..0000000 --- a/Vagrant/roles/ansible-rabbitmq/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ansible-rabbitmq diff --git a/defaults/main.yml b/defaults/main.yml index aeeda6d..dcea8b9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,12 +1,12 @@ --- # defaults file for ansible-rabbitmq rabbitmq_config: [] - # - queue_name: 'logstash' + # - queue_name: logstash # durable: true # exchange_name: logstash - # type: 'direct' - # routing_key: 'logstash' - # tags: 'ha-mode=all,ha-sync-mode=automatic' + # type: direct + # routing_key: logstash + # tags: "ha-mode=all,ha-sync-mode=automatic" # Defines if rabbitmq ha should be configured rabbitmq_config_ha: false @@ -25,11 +25,11 @@ rabbitmq_debian_erlang_from_rabbit: false # Defines if setting up a rabbitmq cluster rabbitmq_enable_clustering: false -rabbitmq_erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie' +rabbitmq_erlang_cookie_file: /var/lib/rabbitmq/.erlang.cookie rabbitmq_listen_port: 5672 rabbitmq_listeners: [] - # - '127.0.0.1' + # - 127.0.0.1 # - '::1' rabbitmq_ssl_enable: false @@ -47,21 +47,21 @@ rabitmq_ssl_options: {} # Defines the inventory host that should be considered master rabbitmq_master: [] -rabbitmq_redhat_repo_key: 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc' -rabbitmq_redhat_package: 'rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch.rpm' -rabbitmq_redhat_url: 'http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}' -rabbitmq_redhat_version: '3.6.1' +rabbitmq_redhat_repo_key: https://www.rabbitmq.com/rabbitmq-signing-key-public.asc +rabbitmq_redhat_package: "rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch.rpm" +rabbitmq_redhat_url: "http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}" +rabbitmq_redhat_version: 3.6.1 # Define admin user to create in order to login to WebUI rabbitmq_users: - - name: 'rabbitmqadmin' - password: 'rabbitmqadmin' - vhost: '/' - configure_priv: '.*' - read_priv: '.*' - write_priv: '.*' + - name: rabbitmqadmin + password: rabbitmqadmin + vhost: / + configure_priv: ".*" + read_priv: ".*" + write_priv: ".*" # Define comma separated list of tags to assign to user: # management,policymaker,monitoring,administrator # required for management plugin. # https://www.rabbitmq.com/management.html - tags: 'administrator' + tags: administrator diff --git a/meta/main.yml b/meta/main.yml index b25c818..84d03bf 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -2,107 +2,19 @@ galaxy_info: author: Larry Smith Jr. description: Installs rabbitmq https://www.rabbitmq.com/ (Configurable...HA and Clustering ready) - #company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) + license: MIT min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # platforms: - name: EL versions: - # - all - # - 5 - # - 6 - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - name: Fedora versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - # - 21 - 22 - 23 - #- name: Windows - # versions: - # - all - # - 2012R2 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - name: Ubuntu versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - trusty - # - utopic - # - vivid - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any #- name: Debian # versions: # - all @@ -111,27 +23,7 @@ galaxy_info: # - lenny # - squeeze # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax + galaxy_tags: - clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - system - #- web dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. diff --git a/tasks/debian.yml b/tasks/debian.yml index f35bf55..c98ff68 100644 --- a/tasks/debian.yml +++ b/tasks/debian.yml @@ -4,12 +4,16 @@ url: "{{ rabbitmq_debian_repo_key }}" state: present become: true + register: result + until: result is successful - name: debian | adding RabbitMQ repo apt_repository: repo: "{{ rabbitmq_debian_repo }}" state: present become: true + register: result + until: result is successful - name: debian | add Rabbitmq erlang repo key apt_key: @@ -27,7 +31,7 @@ - name: debian | installing RabbitMQ server apt: - name: "{{ item }}" + name: ['rabbitmq-server'] state: present become: true with_items: diff --git a/tasks/fedora.yml b/tasks/fedora.yml index 6ac9c03..b09ced0 100644 --- a/tasks/fedora.yml +++ b/tasks/fedora.yml @@ -1,23 +1,27 @@ --- - name: fedora | installing pre-reqs dnf: - name: "{{ item }}" + name: ['wget'] state: present become: true - with_items: - - wget + register: result + until: result is successful - name: fedora | installing erlang dnf: - name: "erlang" + name: ['erlang'] state: present become: true + register: result + until: result is successful - name: fedora | adding RabbitMQ public GPG key rpm_key: key: "{{ rabbitmq_redhat_repo_key }}" state: present become: true + register: result + until: result is successful - name: fedora | downloading RabbitMQ get_url: @@ -30,12 +34,14 @@ name: "/opt/{{ rabbitmq_redhat_package }}" state: present become: true + register: result + until: result is successful - name: fedora | starting and enabling RabbitMQ service service: - name: "rabbitmq-server" + name: rabbitmq-server state: started - enabled: yes + enabled: true become: true - name: fedora | enabling the RabbitMQ Management Console diff --git a/tasks/rabbitmq_ha_config.yml b/tasks/rabbitmq_ha_config.yml index bf74957..d3e4aa2 100644 --- a/tasks/rabbitmq_ha_config.yml +++ b/tasks/rabbitmq_ha_config.yml @@ -4,21 +4,30 @@ path: /usr/sbin/rabbitmqadmin register: rabbitmqadmin_check -- name: rabbitmq_ha_config | install rabbitMQ admin - shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin +- name: rabbit_ha_config | Installing rabbitMQ admin + get_url: + url: http://guest:guest@localhost:15672/cli/rabbitmqadmin + dest: /usr/sbin/rabbitmqadmin + mode: u=rwx,g=rw,o=rw become: true + notify: restart rabbitmq-server 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 | install rabbitMQ admin +# shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin +# 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 | 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 }} diff --git a/tasks/redhat.yml b/tasks/redhat.yml index afa714c..0c7b97a 100644 --- a/tasks/redhat.yml +++ b/tasks/redhat.yml @@ -1,24 +1,27 @@ --- - name: redhat | installing pre-reqs yum: - name: "{{ item }}" + name: ['epel-release', 'wget'] state: present become: true - with_items: - - epel-release - - wget + register: result + until: result is successful - name: redhat | installing erlang yum: - name: "erlang" + name: erlang state: present become: true + register: result + until: result is successful - name: redhat | adding RabbitMQ public GPG key rpm_key: key: "{{ rabbitmq_redhat_repo_key }}" state: present become: true + register: result + until: result is successful - name: redhat | downloading RabbitMQ get_url: @@ -31,10 +34,12 @@ name: "/opt/{{ rabbitmq_redhat_package }}" state: present become: true + register: result + until: result is successful - name: redhat | starting and enabling RabbitMQ service service: - name: "rabbitmq-server" + name: rabbitmq-server state: started enabled: yes become: true diff --git a/tests/inventory b/tests/inventory index d18580b..2fbb50c 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1 +1 @@ -localhost \ No newline at end of file +localhost diff --git a/tests/test.yml b/tests/test.yml index 9b96df5..0c17bb5 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -1,5 +1,5 @@ --- - hosts: localhost - remote_user: root + connection: local roles: - - ansible-rabbitmq \ No newline at end of file + - ansible-rabbitmq -- cgit v1.2.3 From d62baac66345ed735443cbb648e684923fed7d17 Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Wed, 19 Dec 2018 09:52:21 -0500 Subject: Added Travis testing --- .yamllint.yml | 58 +++++++++++++++++++++++++++++++++++++++++ setup_travis_tests.sh | 18 +++++++++++++ tests/.ansible-lint | 2 ++ tests/Dockerfile.centos-7 | 27 +++++++++++++++++++ tests/Dockerfile.debian-jessie | 14 ++++++++++ tests/Dockerfile.debian-stretch | 13 +++++++++ tests/Dockerfile.fedora-24 | 26 ++++++++++++++++++ tests/Dockerfile.fedora-25 | 26 ++++++++++++++++++ tests/Dockerfile.fedora-26 | 26 ++++++++++++++++++ tests/Dockerfile.fedora-27 | 26 ++++++++++++++++++ tests/Dockerfile.fedora-28 | 26 ++++++++++++++++++ tests/Dockerfile.fedora-29 | 26 ++++++++++++++++++ tests/Dockerfile.ubuntu-bionic | 13 +++++++++ tests/Dockerfile.ubuntu-trusty | 14 ++++++++++ tests/Dockerfile.ubuntu-xenial | 13 +++++++++ 15 files changed, 328 insertions(+) create mode 100644 .yamllint.yml create mode 100755 setup_travis_tests.sh create mode 100644 tests/.ansible-lint create mode 100644 tests/Dockerfile.centos-7 create mode 100644 tests/Dockerfile.debian-jessie create mode 100644 tests/Dockerfile.debian-stretch create mode 100644 tests/Dockerfile.fedora-24 create mode 100644 tests/Dockerfile.fedora-25 create mode 100644 tests/Dockerfile.fedora-26 create mode 100644 tests/Dockerfile.fedora-27 create mode 100644 tests/Dockerfile.fedora-28 create mode 100644 tests/Dockerfile.fedora-29 create mode 100644 tests/Dockerfile.ubuntu-bionic create mode 100644 tests/Dockerfile.ubuntu-trusty create mode 100644 tests/Dockerfile.ubuntu-xenial diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..9c7cac4 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,58 @@ +--- +extends: default + +rules: + braces: + # Defaults + # min-spaces-inside: 0 + # max-spaces-inside: 0 + + # Keeping 0 min-spaces to not error on empty collection definitions + min-spaces-inside: 0 + # Allowing one space inside braces to improve code readability + max-spaces-inside: 1 + + brackets: + # Defaults + # min-spaces-inside: 0 + # max-spaces-inside: 0 + + # Keeping 0 min-spaces to not error on empty collection definitions + min-spaces-inside: 0 + # Allowing one space inside braces to improve code readability + max-spaces-inside: 1 + + colons: + # Defaults + # max-spaces-before: 0 + # max-spaces-after: 1 + + max-spaces-before: 0 + # Allowing more than one space for code readability + max-spaces-after: -1 + + comments: + # Defaults + # level: warning + # require-starting-space: true + # min-spaces-from-content: 2 + + # Disabling to allow for code comment blocks and #!/usr/bin/ansible-playbook + require-starting-space: false + + indentation: + # Defaults + # spaces: consistent + # indent-sequences: true + # check-multi-line-strings: false + + # Requiring 2 space indentation + spaces: 2 + # Requiring consistent indentation within a file, either indented or not + indent-sequences: consistent + + # Disabling due to copious amounts of long lines in the code which would + # require a code style change to resolve + line-length: disable + + truthy: disable diff --git a/setup_travis_tests.sh b/setup_travis_tests.sh new file mode 100755 index 0000000..302e659 --- /dev/null +++ b/setup_travis_tests.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +TRAVIS_TEST_VER="v1.6.2" + +TAR_FILE="$TRAVIS_TEST_VER.tar.gz" + +# Prompt for Ansible role name +read -r -p "Enter the Ansible role name: " input + +# Update .travis.yml with Ansible role name +sed -i '' "s/replace_role/${input}/g" ".travis.yml" + +# Update tests/test.yml with Ansible role name +sed -i '' "s/replace_role/${input}/g" "tests/test.yml" + +# Cleanup +if [ -f $TAR_FILE ]; then + rm $TAR_FILE +fi diff --git a/tests/.ansible-lint b/tests/.ansible-lint new file mode 100644 index 0000000..7dfbb8f --- /dev/null +++ b/tests/.ansible-lint @@ -0,0 +1,2 @@ +skip_list: + - "503" diff --git a/tests/Dockerfile.centos-7 b/tests/Dockerfile.centos-7 new file mode 100644 index 0000000..1ad757e --- /dev/null +++ b/tests/Dockerfile.centos-7 @@ -0,0 +1,27 @@ +FROM centos:7 +ENV container=docker + +RUN yum -y install epel-release && \ + yum -y install gmp-devel libffi-devel openssl-devel python-crypto \ + python-devel python-pip python-setuptools python-virtualenv \ + redhat-rpm-config && \ + yum -y group install "Development Tools" + +# Install systemd -- See https://hub.docker.com/_/centos/ +RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ + rm -f /lib/systemd/system/multi-user.target.wants/*;\ + rm -f /etc/systemd/system/*.wants/*;\ + rm -f /lib/systemd/system/local-fs.target.wants/*; \ + rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ + rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ + rm -f /lib/systemd/system/basic.target.wants/*;\ + rm -f /lib/systemd/system/anaconda.target.wants/*; + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / + +VOLUME ["/sys/fs/cgroup"] + +CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.debian-jessie b/tests/Dockerfile.debian-jessie new file mode 100644 index 0000000..2bb5bc2 --- /dev/null +++ b/tests/Dockerfile.debian-jessie @@ -0,0 +1,14 @@ +FROM debian:jessie +ENV container=docker + +RUN apt-get update && \ + apt-get install -y --no-install-recommends build-essential libffi-dev \ + libssl-dev python-dev python-minimal python-pip python-setuptools \ + python-virtualenv && \ + rm -rf /var/lib/apt/lists/* + +RUN pip install --upgrade pip setuptools && \ + pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / diff --git a/tests/Dockerfile.debian-stretch b/tests/Dockerfile.debian-stretch new file mode 100644 index 0000000..c1187b8 --- /dev/null +++ b/tests/Dockerfile.debian-stretch @@ -0,0 +1,13 @@ +FROM debian:stretch +ENV container=docker + +RUN apt-get update && \ + apt-get install -y --no-install-recommends build-essential libffi-dev \ + libssl-dev python-dev python-minimal python-pip python-setuptools \ + python-virtualenv systemd && \ + rm -rf /var/lib/apt/lists/* + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / diff --git a/tests/Dockerfile.fedora-24 b/tests/Dockerfile.fedora-24 new file mode 100644 index 0000000..b2a83cc --- /dev/null +++ b/tests/Dockerfile.fedora-24 @@ -0,0 +1,26 @@ +FROM fedora:24 +ENV container=docker + +RUN dnf -y install gmp-devel libffi-devel openssl-devel python-crypto \ + python-devel python-dnf python-pip python-setuptools python-virtualenv \ + redhat-rpm-config systemd && \ + dnf -y group install "C Development Tools and Libraries" + +# Install systemd -- See https://hub.docker.com/_/centos/ +RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ + rm -f /lib/systemd/system/multi-user.target.wants/*;\ + rm -f /etc/systemd/system/*.wants/*;\ + rm -f /lib/systemd/system/local-fs.target.wants/*; \ + rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ + rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ + rm -f /lib/systemd/system/basic.target.wants/*;\ + rm -f /lib/systemd/system/anaconda.target.wants/*; + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / + +VOLUME ["/sys/fs/cgroup"] + +CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.fedora-25 b/tests/Dockerfile.fedora-25 new file mode 100644 index 0000000..16fa871 --- /dev/null +++ b/tests/Dockerfile.fedora-25 @@ -0,0 +1,26 @@ +FROM fedora:25 +ENV container=docker + +RUN dnf -y install gmp-devel libffi-devel openssl-devel python-crypto \ + python-devel python-dnf python-pip python-setuptools python-virtualenv \ + redhat-rpm-config systemd && \ + dnf -y group install "C Development Tools and Libraries" + +# Install systemd -- See https://hub.docker.com/_/centos/ +RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ + rm -f /lib/systemd/system/multi-user.target.wants/*;\ + rm -f /etc/systemd/system/*.wants/*;\ + rm -f /lib/systemd/system/local-fs.target.wants/*; \ + rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ + rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ + rm -f /lib/systemd/system/basic.target.wants/*;\ + rm -f /lib/systemd/system/anaconda.target.wants/*; + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / + +VOLUME ["/sys/fs/cgroup"] + +CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.fedora-26 b/tests/Dockerfile.fedora-26 new file mode 100644 index 0000000..dd8a954 --- /dev/null +++ b/tests/Dockerfile.fedora-26 @@ -0,0 +1,26 @@ +FROM fedora:26 +ENV container=docker + +RUN dnf -y install gmp-devel libffi-devel openssl-devel python-crypto \ + python-devel python-dnf python-pip python-setuptools python-virtualenv \ + redhat-rpm-config systemd && \ + dnf -y group install "C Development Tools and Libraries" + +# Install systemd -- See https://hub.docker.com/_/centos/ +RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ + rm -f /lib/systemd/system/multi-user.target.wants/*;\ + rm -f /etc/systemd/system/*.wants/*;\ + rm -f /lib/systemd/system/local-fs.target.wants/*; \ + rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ + rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ + rm -f /lib/systemd/system/basic.target.wants/*;\ + rm -f /lib/systemd/system/anaconda.target.wants/*; + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / + +VOLUME ["/sys/fs/cgroup"] + +CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.fedora-27 b/tests/Dockerfile.fedora-27 new file mode 100644 index 0000000..15474da --- /dev/null +++ b/tests/Dockerfile.fedora-27 @@ -0,0 +1,26 @@ +FROM fedora:27 +ENV container=docker + +RUN dnf -y install gmp-devel libffi-devel openssl-devel python-crypto \ + python-devel python-dnf python-pip python-setuptools python-virtualenv \ + redhat-rpm-config systemd && \ + dnf -y group install "C Development Tools and Libraries" + +# Install systemd -- See https://hub.docker.com/_/centos/ +RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ + rm -f /lib/systemd/system/multi-user.target.wants/*;\ + rm -f /etc/systemd/system/*.wants/*;\ + rm -f /lib/systemd/system/local-fs.target.wants/*; \ + rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ + rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ + rm -f /lib/systemd/system/basic.target.wants/*;\ + rm -f /lib/systemd/system/anaconda.target.wants/*; + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / + +VOLUME ["/sys/fs/cgroup"] + +CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.fedora-28 b/tests/Dockerfile.fedora-28 new file mode 100644 index 0000000..1885bc7 --- /dev/null +++ b/tests/Dockerfile.fedora-28 @@ -0,0 +1,26 @@ +FROM fedora:28 +ENV container=docker + +RUN dnf -y install gmp-devel libffi-devel openssl-devel python-crypto \ + python-devel python-dnf python-pip python-setuptools python-virtualenv \ + redhat-rpm-config systemd && \ + dnf -y group install "C Development Tools and Libraries" + +# Install systemd -- See https://hub.docker.com/_/centos/ +RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ + rm -f /lib/systemd/system/multi-user.target.wants/*;\ + rm -f /etc/systemd/system/*.wants/*;\ + rm -f /lib/systemd/system/local-fs.target.wants/*; \ + rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ + rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ + rm -f /lib/systemd/system/basic.target.wants/*;\ + rm -f /lib/systemd/system/anaconda.target.wants/*; + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / + +VOLUME ["/sys/fs/cgroup"] + +CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.fedora-29 b/tests/Dockerfile.fedora-29 new file mode 100644 index 0000000..3f94b36 --- /dev/null +++ b/tests/Dockerfile.fedora-29 @@ -0,0 +1,26 @@ +FROM fedora:29 +ENV container=docker + +RUN dnf -y install gmp-devel libffi-devel openssl-devel python-crypto \ + python-devel python-dnf python-pip python-setuptools python-virtualenv \ + redhat-rpm-config systemd && \ + dnf -y group install "C Development Tools and Libraries" + +# Install systemd -- See https://hub.docker.com/_/centos/ +RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ + rm -f /lib/systemd/system/multi-user.target.wants/*;\ + rm -f /etc/systemd/system/*.wants/*;\ + rm -f /lib/systemd/system/local-fs.target.wants/*; \ + rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ + rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ + rm -f /lib/systemd/system/basic.target.wants/*;\ + rm -f /lib/systemd/system/anaconda.target.wants/*; + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / + +VOLUME ["/sys/fs/cgroup"] + +CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.ubuntu-bionic b/tests/Dockerfile.ubuntu-bionic new file mode 100644 index 0000000..07116b6 --- /dev/null +++ b/tests/Dockerfile.ubuntu-bionic @@ -0,0 +1,13 @@ +FROM ubuntu:bionic +ENV container=docker + +RUN apt-get update && \ + apt-get install -y --no-install-recommends build-essential libffi-dev \ + libssl-dev python-dev python-minimal python-pip python-setuptools \ + python-virtualenv systemd && \ + rm -rf /var/lib/apt/lists/* + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / diff --git a/tests/Dockerfile.ubuntu-trusty b/tests/Dockerfile.ubuntu-trusty new file mode 100644 index 0000000..b1645da --- /dev/null +++ b/tests/Dockerfile.ubuntu-trusty @@ -0,0 +1,14 @@ +FROM ubuntu:trusty +ENV container=docker + +RUN apt-get update && \ + apt-get install -y --no-install-recommends build-essential libffi-dev \ + libssl-dev python-dev python-minimal python-pip python-setuptools \ + python-virtualenv && \ + rm -rf /var/lib/apt/lists/* + +RUN pip install --upgrade pip setuptools && \ + pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / diff --git a/tests/Dockerfile.ubuntu-xenial b/tests/Dockerfile.ubuntu-xenial new file mode 100644 index 0000000..188f255 --- /dev/null +++ b/tests/Dockerfile.ubuntu-xenial @@ -0,0 +1,13 @@ +FROM ubuntu:xenial +ENV container=docker + +RUN apt-get update && \ + apt-get install -y --no-install-recommends build-essential libffi-dev \ + libssl-dev python-dev python-minimal python-pip python-setuptools \ + python-virtualenv && \ + rm -rf /var/lib/apt/lists/* + +RUN pip install enum34 ipaddress wheel && \ + pip install ansible ansible-lint + +COPY .ansible-lint / -- cgit v1.2.3 From 613299cd31700e78599dedf0f19f78fe4876c207 Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Wed, 19 Dec 2018 09:52:51 -0500 Subject: First commit of refactoring --- README.md | 76 ++++++++++++++++++++++++-------------------- defaults/main.yml | 12 +++---- handlers/main.yml | 2 +- tasks/debian.yml | 6 +++- tasks/main.yml | 3 +- tasks/rabbitmq_ha_config.yml | 18 +---------- 6 files changed, 57 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index b3b03ad..15f9cdf 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,73 @@ -Role Name -========= + + +**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 ------------- + + +# 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]: -[Ansible]: -[RabbitMQ]: +- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr) +- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com) +- [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com) diff --git a/defaults/main.yml b/defaults/main.yml index dcea8b9..ff7d922 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,15 +12,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 diff --git a/handlers/main.yml b/handlers/main.yml index 4fdafe5..c727c75 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -2,6 +2,6 @@ # handlers file for ansible-rabbitmq - name: restart rabbitmq-server service: - name: "rabbitmq-server" + name: rabbitmq-server state: restarted become: true diff --git a/tasks/debian.yml b/tasks/debian.yml index c98ff68..317932e 100644 --- a/tasks/debian.yml +++ b/tasks/debian.yml @@ -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 @@ -34,8 +36,10 @@ 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: diff --git a/tasks/main.yml b/tasks/main.yml index 8905c0b..3205473 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/tasks/rabbitmq_ha_config.yml b/tasks/rabbitmq_ha_config.yml index d3e4aa2..0048b0c 100644 --- a/tasks/rabbitmq_ha_config.yml +++ b/tasks/rabbitmq_ha_config.yml @@ -13,22 +13,6 @@ 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 }} run_once: true @@ -37,7 +21,7 @@ - name: rabbitmq_ha_config | setting up ha on queue(s) rabbitmq_policy: - name: "ha-all" + name: ha-all pattern: "{{ item['queue_name'] }}" tags: "{{ item['tags'] }}" state: present -- cgit v1.2.3 From 4cdb11cd256dd79e5fdce2989faf7fd7509479bd Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Wed, 19 Dec 2018 10:40:58 -0500 Subject: Updated ansible lint skip list until further testing --- tests/.ansible-lint | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/.ansible-lint b/tests/.ansible-lint index 7dfbb8f..301fac7 100644 --- a/tests/.ansible-lint +++ b/tests/.ansible-lint @@ -1,2 +1,4 @@ skip_list: + - "204" + - "301" - "503" -- cgit v1.2.3 From 32a787f28b5898336ec785f11c434f088728187a Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Wed, 19 Dec 2018 12:06:47 -0500 Subject: Fixing missing gpg command for Debian/Ubuntu --- tasks/debian.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/debian.yml b/tasks/debian.yml index 317932e..0a6572e 100644 --- a/tasks/debian.yml +++ b/tasks/debian.yml @@ -1,4 +1,12 @@ --- +- name: debian | Adding Pre-Reqs + apt: + name: ['gnupg2'] + state: present + become: true + register: result + until: result is successful + - name: debian | adding RabbitMQ public GPG key to the apt repo apt_key: url: "{{ rabbitmq_debian_repo_key }}" -- cgit v1.2.3 From fffd334eb240ba830b9ee8d62b4c4c22c43a5d21 Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Wed, 19 Dec 2018 15:27:49 -0500 Subject: Disabled Ubuntu 14.04 and Debian Jessie --- .travis.yml | 12 ++++++------ meta/main.yml | 25 ++++++++++++++----------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index ef52f88..a003124 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,15 +36,15 @@ env: - distribution: ubuntu init: /lib/systemd/systemd version: xenial - - distribution: ubuntu - init: /sbin/init - version: trusty + # - distribution: ubuntu + # init: /sbin/init + # version: trusty - distribution: debian init: /lib/systemd/systemd version: stretch - - distribution: debian - init: /lib/systemd/systemd - version: jessie + # - distribution: debian + # init: /lib/systemd/systemd + # version: jessie before_install: - "sudo pip install yamllint" diff --git a/meta/main.yml b/meta/main.yml index 84d03bf..8755c64 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -10,19 +10,22 @@ galaxy_info: - 7 - name: Fedora versions: - - 22 - - 23 + # - 22 + # - 23 + - 24 + - 25 + - 26 + - 27 + - 28 + - 29 - name: Ubuntu versions: - - trusty - #- name: Debian - # versions: - # - all - # - etch - # - jessie - # - lenny - # - squeeze - # - wheezy + - bionic + # - trusty + - xenial + - name: Debian + versions: + - stretch galaxy_tags: - clustering - system -- cgit v1.2.3