]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-common: export repository configuration to a single task
authorSeena Fallah <seenafallah@gmail.com>
Thu, 5 Aug 2021 15:46:04 +0000 (20:16 +0430)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 18 Oct 2021 16:38:47 +0000 (18:38 +0200)
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit e79bda9a054d6a3ffc69c52711ea9a8bb2bfb514)

roles/ceph-common/tasks/configure_repository.yml [new file with mode: 0644]
roles/ceph-common/tasks/installs/install_on_debian.yml
roles/ceph-common/tasks/installs/install_on_redhat.yml [deleted file]
roles/ceph-common/tasks/installs/install_on_suse.yml [deleted file]
roles/ceph-common/tasks/main.yml

diff --git a/roles/ceph-common/tasks/configure_repository.yml b/roles/ceph-common/tasks/configure_repository.yml
new file mode 100644 (file)
index 0000000..0f7d7b2
--- /dev/null
@@ -0,0 +1,31 @@
+---
+- name: config repository for Red Hat based OS
+  when: ansible_facts['os_family'] == 'RedHat'
+  block:
+    - name: include installs/configure_redhat_repository_installation.yml
+      include_tasks: installs/configure_redhat_repository_installation.yml
+      when: ceph_origin == 'repository'
+
+    - name: include installs/configure_redhat_local_installation.yml
+      include_tasks: installs/configure_redhat_local_installation.yml
+      when: ceph_origin == 'local'
+
+- name: config repository for Debian based OS
+  when: ansible_facts['os_family'] == 'Debian'
+  block:
+    - name: include installs/configure_debian_repository_installation.yml
+      include_tasks: installs/configure_debian_repository_installation.yml
+      when: ceph_origin == 'repository'
+
+    - name: update apt cache if cache_valid_time has expired
+      apt:
+        update_cache: yes
+        cache_valid_time: 3600
+      register: result
+      until: result is succeeded
+
+- name: include installs/configure_suse_repository_installation.yml
+  include_tasks: installs/configure_suse_repository_installation.yml
+  when:
+    - ansible_facts['os_family'] == 'Suse'
+    - ceph_origin == 'repository'
index 78143a61ace59d6d9d3830e6527f20c95e73d1e7..b10d04fafa13c4bd9b3881c76339f38640888893 100644 (file)
@@ -1,15 +1,3 @@
----
-- name: include configure_debian_repository_installation.yml
-  include_tasks: configure_debian_repository_installation.yml
-  when: ceph_origin == 'repository'
-
-- name: update apt cache if cache_valid_time has expired
-  apt:
-    update_cache: yes
-    cache_valid_time: 3600
-  register: result
-  until: result is succeeded
-
 - name: install dependencies
   apt:
     name: "{{ debian_package_dependencies }}"
diff --git a/roles/ceph-common/tasks/installs/install_on_redhat.yml b/roles/ceph-common/tasks/installs/install_on_redhat.yml
deleted file mode 100644 (file)
index 93e2614..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
----
-- name: include configure_redhat_repository_installation.yml
-  include_tasks: configure_redhat_repository_installation.yml
-  when: ceph_origin == 'repository'
-
-- name: include configure_redhat_local_installation.yml
-  include_tasks: configure_redhat_local_installation.yml
-  when: ceph_origin == 'local'
-
-- name: include install_redhat_packages.yml
-  include_tasks: install_redhat_packages.yml
-  when: (ceph_origin == 'repository' or ceph_origin == 'distro')
diff --git a/roles/ceph-common/tasks/installs/install_on_suse.yml b/roles/ceph-common/tasks/installs/install_on_suse.yml
deleted file mode 100644 (file)
index 442400b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
----
-- name: include configure_suse_repository_installation.yml
-  include_tasks: configure_suse_repository_installation.yml
-  when: ceph_origin == 'repository'
-
-- name: include install_suse_packages.yml
-  include_tasks: install_suse_packages.yml
index 648eee117d78172363e8c8d3d559e431cea801e7..a3fa31e3324475b6a924e683bd4ac5534514b6ea 100644 (file)
@@ -1,11 +1,17 @@
 ---
-- name: include_tasks installs/install_on_redhat.yml
-  include_tasks: installs/install_on_redhat.yml
-  when: ansible_facts['os_family'] == 'RedHat'
+- name: include configure_repository.yml
+  include_tasks: configure_repository.yml
+  tags: package-configure
+
+- name: include installs/install_redhat_packages.yml
+  include_tasks: installs/install_redhat_packages.yml
+  when:
+    - ansible_facts['os_family'] == 'RedHat'
+    - (ceph_origin == 'repository' or ceph_origin == 'distro')
   tags: package-install
 
-- name: include_tasks installs/install_on_suse.yml
-  include_tasks: installs/install_on_suse.yml
+- name: include installs/install_suse_packages.yml
+  include_tasks: installs/install_suse_packages.yml
   when: ansible_facts['os_family'] == 'Suse'
   tags: package-install