diff options
author | Larry Smith Jr <mrlesmithjr@gmail.com> | 2016-07-02 01:43:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-02 01:43:14 -0400 |
commit | 2922c75a7fce9ba62d1d78a50bca7f14e707cd9d (patch) | |
tree | 92e2b0a4b2df0cc9bc8a809b4e7dd35181d7de8f /tasks | |
parent | bc0ca3da9ef79d3e75191500e941e63c5dbb6158 (diff) | |
parent | b6c0cb98568bb67c29bc54b7bc061a2138af6666 (diff) | |
download | ansible-rabbitmq-2922c75a7fce9ba62d1d78a50bca7f14e707cd9d.tar.gz ansible-rabbitmq-2922c75a7fce9ba62d1d78a50bca7f14e707cd9d.tar.zst ansible-rabbitmq-2922c75a7fce9ba62d1d78a50bca7f14e707cd9d.zip |
Merge pull request #2 from black-roland/fix-redhat
Fix installation on CentOS
Diffstat (limited to 'tasks')
-rw-r--r-- | tasks/fedora.yml | 39 | ||||
-rw-r--r-- | tasks/main.yml | 7 | ||||
-rw-r--r-- | tasks/redhat.yml | 16 |
3 files changed, 47 insertions, 15 deletions
diff --git a/tasks/fedora.yml b/tasks/fedora.yml new file mode 100644 index 0000000..3d92963 --- /dev/null +++ b/tasks/fedora.yml | |||
@@ -0,0 +1,39 @@ | |||
1 | --- | ||
2 | - name: fedora | installing pre-reqs | ||
3 | dnf: | ||
4 | name: "{{ item }}" | ||
5 | state: present | ||
6 | with_items: | ||
7 | - wget | ||
8 | |||
9 | - name: fedora | installing erlang | ||
10 | dnf: | ||
11 | name: "erlang" | ||
12 | state: present | ||
13 | |||
14 | - name: fedora | adding RabbitMQ public GPG key | ||
15 | rpm_key: | ||
16 | key: "{{ rabbitmq_redhat_repo_key }}" | ||
17 | state: present | ||
18 | |||
19 | - name: fedora | downloading RabbitMQ | ||
20 | get_url: | ||
21 | url: "{{ rabbitmq_redhat_url }}/{{ rabbitmq_redhat_package }}" | ||
22 | dest: "/opt/{{ rabbitmq_redhat_package }}" | ||
23 | |||
24 | - name: fedora | installing RabbitMQ | ||
25 | dnf: | ||
26 | name: "/opt/{{ rabbitmq_redhat_package }}" | ||
27 | state: present | ||
28 | |||
29 | - name: fedora | starting and enabling RabbitMQ service | ||
30 | service: | ||
31 | name: "rabbitmq-server" | ||
32 | state: started | ||
33 | enabled: yes | ||
34 | |||
35 | - name: fedora | enabling the RabbitMQ Management Console | ||
36 | rabbitmq_plugin: | ||
37 | names: rabbitmq_management | ||
38 | state: enabled | ||
39 | notify: restart rabbitmq-server | ||
diff --git a/tasks/main.yml b/tasks/main.yml index 1768dd9..26abc8d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml | |||
@@ -3,8 +3,11 @@ | |||
3 | when: ansible_os_family == "Debian" | 3 | when: ansible_os_family == "Debian" |
4 | 4 | ||
5 | - include: redhat.yml | 5 | - include: redhat.yml |
6 | when: ansible_os_family == "RedHat" | 6 | when: ansible_distribution == "CentOS" or ansible_distribution == "Red Hat Enterprise Linux" |
7 | 7 | ||
8 | - include: fedora.yml | ||
9 | when: ansible_distribution == "Fedora" | ||
10 | |||
8 | - name: checking to see if already clustered | 11 | - name: checking to see if already clustered |
9 | stat: path=/etc/rabbitmq/clustered | 12 | stat: path=/etc/rabbitmq/clustered |
10 | register: clustered | 13 | register: clustered |
diff --git a/tasks/redhat.yml b/tasks/redhat.yml index 1624d8f..484597d 100644 --- a/tasks/redhat.yml +++ b/tasks/redhat.yml | |||
@@ -1,24 +1,14 @@ | |||
1 | --- | 1 | --- |
2 | - name: redhat | installing pre-reqs (yum) | 2 | - name: redhat | installing pre-reqs |
3 | yum: | 3 | yum: |
4 | name: "{{ item }}" | 4 | name: "{{ item }}" |
5 | state: present | 5 | state: present |
6 | with_items: | 6 | with_items: |
7 | - dnf | ||
8 | - epel-release | 7 | - epel-release |
9 | - python-dnf | ||
10 | when: > | ||
11 | ansible_distribution != "Fedora" | ||
12 | |||
13 | - name: redhat | installing pre-reqs (dnf) | ||
14 | dnf: | ||
15 | name: "{{ item }}" | ||
16 | state: present | ||
17 | with_items: | ||
18 | - wget | 8 | - wget |
19 | 9 | ||
20 | - name: redhat | installing erlang | 10 | - name: redhat | installing erlang |
21 | dnf: | 11 | yum: |
22 | name: "erlang" | 12 | name: "erlang" |
23 | state: present | 13 | state: present |
24 | 14 | ||
@@ -33,7 +23,7 @@ | |||
33 | dest: "/opt/{{ rabbitmq_redhat_package }}" | 23 | dest: "/opt/{{ rabbitmq_redhat_package }}" |
34 | 24 | ||
35 | - name: redhat | installing RabbitMQ | 25 | - name: redhat | installing RabbitMQ |
36 | dnf: | 26 | yum: |
37 | name: "/opt/{{ rabbitmq_redhat_package }}" | 27 | name: "/opt/{{ rabbitmq_redhat_package }}" |
38 | state: present | 28 | state: present |
39 | 29 | ||