diff options
Diffstat (limited to 'tasks')
-rw-r--r-- | tasks/debian.yml | 6 | ||||
-rw-r--r-- | tasks/fedora.yml | 18 | ||||
-rw-r--r-- | tasks/rabbitmq_ha_config.yml | 31 | ||||
-rw-r--r-- | tasks/redhat.yml | 17 |
4 files changed, 48 insertions, 24 deletions
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 @@ | |||
4 | url: "{{ rabbitmq_debian_repo_key }}" | 4 | url: "{{ rabbitmq_debian_repo_key }}" |
5 | state: present | 5 | state: present |
6 | become: true | 6 | become: true |
7 | register: result | ||
8 | until: result is successful | ||
7 | 9 | ||
8 | - name: debian | adding RabbitMQ repo | 10 | - name: debian | adding RabbitMQ repo |
9 | apt_repository: | 11 | apt_repository: |
10 | repo: "{{ rabbitmq_debian_repo }}" | 12 | repo: "{{ rabbitmq_debian_repo }}" |
11 | state: present | 13 | state: present |
12 | become: true | 14 | become: true |
15 | register: result | ||
16 | until: result is successful | ||
13 | 17 | ||
14 | - name: debian | add Rabbitmq erlang repo key | 18 | - name: debian | add Rabbitmq erlang repo key |
15 | apt_key: | 19 | apt_key: |
@@ -27,7 +31,7 @@ | |||
27 | 31 | ||
28 | - name: debian | installing RabbitMQ server | 32 | - name: debian | installing RabbitMQ server |
29 | apt: | 33 | apt: |
30 | name: "{{ item }}" | 34 | name: ['rabbitmq-server'] |
31 | state: present | 35 | state: present |
32 | become: true | 36 | become: true |
33 | with_items: | 37 | 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 @@ | |||
1 | --- | 1 | --- |
2 | - name: fedora | installing pre-reqs | 2 | - name: fedora | installing pre-reqs |
3 | dnf: | 3 | dnf: |
4 | name: "{{ item }}" | 4 | name: ['wget'] |
5 | state: present | 5 | state: present |
6 | become: true | 6 | become: true |
7 | with_items: | 7 | register: result |
8 | - wget | 8 | until: result is successful |
9 | 9 | ||
10 | - name: fedora | installing erlang | 10 | - name: fedora | installing erlang |
11 | dnf: | 11 | dnf: |
12 | name: "erlang" | 12 | name: ['erlang'] |
13 | state: present | 13 | state: present |
14 | become: true | 14 | become: true |
15 | register: result | ||
16 | until: result is successful | ||
15 | 17 | ||
16 | - name: fedora | adding RabbitMQ public GPG key | 18 | - name: fedora | adding RabbitMQ public GPG key |
17 | rpm_key: | 19 | rpm_key: |
18 | key: "{{ rabbitmq_redhat_repo_key }}" | 20 | key: "{{ rabbitmq_redhat_repo_key }}" |
19 | state: present | 21 | state: present |
20 | become: true | 22 | become: true |
23 | register: result | ||
24 | until: result is successful | ||
21 | 25 | ||
22 | - name: fedora | downloading RabbitMQ | 26 | - name: fedora | downloading RabbitMQ |
23 | get_url: | 27 | get_url: |
@@ -30,12 +34,14 @@ | |||
30 | name: "/opt/{{ rabbitmq_redhat_package }}" | 34 | name: "/opt/{{ rabbitmq_redhat_package }}" |
31 | state: present | 35 | state: present |
32 | become: true | 36 | become: true |
37 | register: result | ||
38 | until: result is successful | ||
33 | 39 | ||
34 | - name: fedora | starting and enabling RabbitMQ service | 40 | - name: fedora | starting and enabling RabbitMQ service |
35 | service: | 41 | service: |
36 | name: "rabbitmq-server" | 42 | name: rabbitmq-server |
37 | state: started | 43 | state: started |
38 | enabled: yes | 44 | enabled: true |
39 | become: true | 45 | become: true |
40 | 46 | ||
41 | - name: fedora | enabling the RabbitMQ Management Console | 47 | - 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 @@ | |||
4 | path: /usr/sbin/rabbitmqadmin | 4 | path: /usr/sbin/rabbitmqadmin |
5 | register: rabbitmqadmin_check | 5 | register: rabbitmqadmin_check |
6 | 6 | ||
7 | - name: rabbitmq_ha_config | install rabbitMQ admin | 7 | - name: rabbit_ha_config | Installing rabbitMQ admin |
8 | shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin | 8 | get_url: |
9 | url: http://guest:guest@localhost:15672/cli/rabbitmqadmin | ||
10 | dest: /usr/sbin/rabbitmqadmin | ||
11 | mode: u=rwx,g=rw,o=rw | ||
9 | become: true | 12 | become: true |
13 | notify: restart rabbitmq-server | ||
10 | when: not rabbitmqadmin_check['stat']['exists'] | 14 | when: not rabbitmqadmin_check['stat']['exists'] |
11 | 15 | ||
12 | - name: rabbitmq_ha_config | moving the rabbitMQ Admin | 16 | # - name: rabbitmq_ha_config | install rabbitMQ admin |
13 | shell: mv rabbitmqadmin /usr/sbin | 17 | # shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin |
14 | become: true | 18 | # become: true |
15 | when: not rabbitmqadmin_check['stat']['exists'] | 19 | # when: not rabbitmqadmin_check['stat']['exists'] |
16 | 20 | ||
17 | - name: rabbitmq_ha_config | making executable rabbitMQ Admin | 21 | # - name: rabbitmq_ha_config | moving the rabbitMQ Admin |
18 | shell: chmod +x /usr/sbin/rabbitmqadmin | 22 | # shell: mv rabbitmqadmin /usr/sbin |
19 | notify: restart rabbitmq-server | 23 | # become: true |
20 | become: true | 24 | # when: not rabbitmqadmin_check['stat']['exists'] |
21 | when: not rabbitmqadmin_check['stat']['exists'] | 25 | |
26 | # - name: rabbitmq_ha_config | making executable rabbitMQ Admin | ||
27 | # shell: chmod +x /usr/sbin/rabbitmqadmin | ||
28 | # notify: restart rabbitmq-server | ||
29 | # become: true | ||
30 | # when: not rabbitmqadmin_check['stat']['exists'] | ||
22 | 31 | ||
23 | - name: rabbitmq_ha_config | creating queue(s) | 32 | - name: rabbitmq_ha_config | creating queue(s) |
24 | command: rabbitmqadmin declare queue name={{ item['queue_name'] }} durable={{ item['durable']|lower }} | 33 | 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 @@ | |||
1 | --- | 1 | --- |
2 | - name: redhat | installing pre-reqs | 2 | - name: redhat | installing pre-reqs |
3 | yum: | 3 | yum: |
4 | name: "{{ item }}" | 4 | name: ['epel-release', 'wget'] |
5 | state: present | 5 | state: present |
6 | become: true | 6 | become: true |
7 | with_items: | 7 | register: result |
8 | - epel-release | 8 | until: result is successful |
9 | - wget | ||
10 | 9 | ||
11 | - name: redhat | installing erlang | 10 | - name: redhat | installing erlang |
12 | yum: | 11 | yum: |
13 | name: "erlang" | 12 | name: erlang |
14 | state: present | 13 | state: present |
15 | become: true | 14 | become: true |
15 | register: result | ||
16 | until: result is successful | ||
16 | 17 | ||
17 | - name: redhat | adding RabbitMQ public GPG key | 18 | - name: redhat | adding RabbitMQ public GPG key |
18 | rpm_key: | 19 | rpm_key: |
19 | key: "{{ rabbitmq_redhat_repo_key }}" | 20 | key: "{{ rabbitmq_redhat_repo_key }}" |
20 | state: present | 21 | state: present |
21 | become: true | 22 | become: true |
23 | register: result | ||
24 | until: result is successful | ||
22 | 25 | ||
23 | - name: redhat | downloading RabbitMQ | 26 | - name: redhat | downloading RabbitMQ |
24 | get_url: | 27 | get_url: |
@@ -31,10 +34,12 @@ | |||
31 | name: "/opt/{{ rabbitmq_redhat_package }}" | 34 | name: "/opt/{{ rabbitmq_redhat_package }}" |
32 | state: present | 35 | state: present |
33 | become: true | 36 | become: true |
37 | register: result | ||
38 | until: result is successful | ||
34 | 39 | ||
35 | - name: redhat | starting and enabling RabbitMQ service | 40 | - name: redhat | starting and enabling RabbitMQ service |
36 | service: | 41 | service: |
37 | name: "rabbitmq-server" | 42 | name: rabbitmq-server |
38 | state: started | 43 | state: started |
39 | enabled: yes | 44 | enabled: yes |
40 | become: true | 45 | become: true |