From: Zack Cerza Date: Thu, 22 Jun 2017 20:11:18 +0000 (-0600) Subject: ceph-grafana: Split out repo setup X-Git-Tag: v1.0~67^2~1^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=159ca4632c92b6a756b9ff4ac22a5058e3242a2d;p=cephmetrics.git ceph-grafana: Split out repo setup Signed-off-by: Zack Cerza --- diff --git a/ansible/roles/ceph-grafana/tasks/install_packages.yml b/ansible/roles/ceph-grafana/tasks/install_packages.yml index 89af3d6..8e699d5 100644 --- a/ansible/roles/ceph-grafana/tasks/install_packages.yml +++ b/ansible/roles/ceph-grafana/tasks/install_packages.yml @@ -1,34 +1,4 @@ --- -- name: Enable EPEL - yum: - name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" - state: "{{ 'present' if use_epel else 'absent' }}" - when: ansible_pkg_mgr == "yum" - -- name: Install chacra repo - copy: - src: files/cephmetrics.repo - dest: /etc/yum.repos.d/cephmetrics.repo - when: ansible_pkg_mgr == "yum" and not use_epel - -- name: Remove chacra repo - file: - path: /etc/yum.repos.d/cephmetrics.repo - state: absent - when: ansible_pkg_mgr == "yum" and use_epel - -- name: Add Grafana repo - template: - src: grafana.repo - dest: /etc/yum.repos.d/grafana.repo - when: ansible_pkg_mgr == 'yum' and use_epel - -- name: Remove Grafana repo - file: - path: /etc/yum.repos.d/grafana.repo - state: absent - when: ansible_pkg_mgr == "yum" and not use_epel - - name: Install packages package: name: "{{ item }}" diff --git a/ansible/roles/ceph-grafana/tasks/main.yml b/ansible/roles/ceph-grafana/tasks/main.yml index 387429e..ed26c0d 100644 --- a/ansible/roles/ceph-grafana/tasks/main.yml +++ b/ansible/roles/ceph-grafana/tasks/main.yml @@ -1,4 +1,9 @@ --- +- include: setup_repos.yml + when: not containerized_deployment + tags: + - packages + - include: install_packages.yml when: not containerized_deployment tags: diff --git a/ansible/roles/ceph-grafana/tasks/setup_repos.yml b/ansible/roles/ceph-grafana/tasks/setup_repos.yml new file mode 100644 index 0000000..b7f0e2e --- /dev/null +++ b/ansible/roles/ceph-grafana/tasks/setup_repos.yml @@ -0,0 +1,39 @@ +--- +- name: Enable EPEL + yum: + name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" + state: "{{ 'present' if use_epel else 'absent' }}" + when: + - ansible_pkg_mgr == "yum" + +- name: Install chacra repo + copy: + src: files/cephmetrics.repo + dest: /etc/yum.repos.d/cephmetrics.repo + when: + - ansible_pkg_mgr == "yum" + - not use_epel + +- name: Remove chacra repo + file: + path: /etc/yum.repos.d/cephmetrics.repo + state: absent + when: + - ansible_pkg_mgr == "yum" + - use_epel + +- name: Add Grafana repo + template: + src: grafana.repo + dest: /etc/yum.repos.d/grafana.repo + when: + - ansible_pkg_mgr == 'yum' + - use_epel + +- name: Remove Grafana repo + file: + path: /etc/yum.repos.d/grafana.repo + state: absent + when: + - ansible_pkg_mgr == "yum" + - not use_epel