From b6c0cb98568bb67c29bc54b7bc061a2138af6666 Mon Sep 17 00:00:00 2001 From: Roland Chernov Date: Wed, 29 Jun 2016 02:06:25 +0900 Subject: Separate RedHat and Fedora --- tasks/fedora.yml | 39 +++++++++++++++++++++++++++++++++++++++ tasks/main.yml | 7 +++++-- tasks/redhat.yml | 16 +++------------- 3 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 tasks/fedora.yml (limited to 'tasks') 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 @@ +--- +- 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 index 1768dd9..26abc8d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,8 +3,11 @@ when: ansible_os_family == "Debian" - include: redhat.yml - when: ansible_os_family == "RedHat" - + 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 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 @@ --- -- name: redhat | installing pre-reqs (yum) +- name: redhat | installing pre-reqs yum: name: "{{ item }}" state: present with_items: - - dnf - epel-release - - python-dnf - when: > - ansible_distribution != "Fedora" - -- name: redhat | installing pre-reqs (dnf) - dnf: - name: "{{ item }}" - state: present - with_items: - wget - name: redhat | installing erlang - dnf: + yum: name: "erlang" state: present @@ -33,7 +23,7 @@ dest: "/opt/{{ rabbitmq_redhat_package }}" - name: redhat | installing RabbitMQ - dnf: + yum: name: "/opt/{{ rabbitmq_redhat_package }}" state: present -- cgit v1.2.3