]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
ceph-grafana: Split out repo setup
authorZack Cerza <zack@redhat.com>
Thu, 22 Jun 2017 20:11:18 +0000 (14:11 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 22 Jun 2017 20:15:51 +0000 (14:15 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
ansible/roles/ceph-grafana/tasks/install_packages.yml
ansible/roles/ceph-grafana/tasks/main.yml
ansible/roles/ceph-grafana/tasks/setup_repos.yml [new file with mode: 0644]

index 89af3d67ef6c675ffc26fd076e1cc00f1e58ff8a..8e699d5767e19491799a4896fd5e958f7a899df0 100644 (file)
@@ -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 }}"
index 387429ee24e625b8ee237f97d63ec03bd8112d47..ed26c0da7dc9f2b3f0dcfbb04e26c25495607314 100644 (file)
@@ -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 (file)
index 0000000..b7f0e2e
--- /dev/null
@@ -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