From 8f8673fb8dfa2bd4fa2694cbfdcb6eed54e502de Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Sat, 3 Dec 2016 17:50:41 -0500 Subject: Updated gitignore Signed-off-by: Larry Smith Jr --- tasks/debian.yml | 35 ---------------------- tasks/fedora.yml | 39 ------------------------ tasks/main.yml | 21 ------------- tasks/rabbitmq_clustering.yml | 70 ------------------------------------------- tasks/rabbitmq_ha_config.yml | 44 --------------------------- tasks/rabbitmq_users.yml | 27 ----------------- tasks/redhat.yml | 40 ------------------------- 7 files changed, 276 deletions(-) delete mode 100644 tasks/debian.yml delete mode 100644 tasks/fedora.yml delete mode 100644 tasks/main.yml delete mode 100644 tasks/rabbitmq_clustering.yml delete mode 100644 tasks/rabbitmq_ha_config.yml delete mode 100644 tasks/rabbitmq_users.yml delete mode 100644 tasks/redhat.yml (limited to 'tasks') diff --git a/tasks/debian.yml b/tasks/debian.yml deleted file mode 100644 index a031ead..0000000 --- a/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/tasks/fedora.yml b/tasks/fedora.yml deleted file mode 100644 index 3d92963..0000000 --- a/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/tasks/main.yml b/tasks/main.yml deleted file mode 100644 index bd82f93..0000000 --- a/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/tasks/rabbitmq_clustering.yml b/tasks/rabbitmq_clustering.yml deleted file mode 100644 index 9dece46..0000000 --- a/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/tasks/rabbitmq_ha_config.yml b/tasks/rabbitmq_ha_config.yml deleted file mode 100644 index 8811b6d..0000000 --- a/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/tasks/rabbitmq_users.yml b/tasks/rabbitmq_users.yml deleted file mode 100644 index 8bce8b2..0000000 --- a/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/tasks/redhat.yml b/tasks/redhat.yml deleted file mode 100644 index 484597d..0000000 --- a/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 -- cgit v1.2.3