]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-common: use a handler
authorSébastien Han <seb@redhat.com>
Tue, 30 Oct 2018 14:53:07 +0000 (15:53 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 31 Oct 2018 13:18:36 +0000 (14:18 +0100)
We need a handler because the task changed, the old implementation was
basically mimicing a handler.

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-common/handlers/main.yml [new file with mode: 0644]
roles/ceph-common/tasks/installs/debian_community_repository.yml
roles/ceph-common/tasks/installs/debian_custom_repository.yml
roles/ceph-common/tasks/installs/debian_dev_repository.yml
roles/ceph-common/tasks/installs/debian_uca_repository.yml
roles/ceph-common/tasks/installs/install_on_debian.yml
roles/ceph-common/tasks/installs/prerequisite_rhcs_cdn_install_debian.yml
roles/ceph-common/tasks/installs/prerequisite_rhcs_iso_install_debian.yml

diff --git a/roles/ceph-common/handlers/main.yml b/roles/ceph-common/handlers/main.yml
new file mode 100644 (file)
index 0000000..9bcab1b
--- /dev/null
@@ -0,0 +1,8 @@
+---
+- name: update apt cache if a repo was added
+  apt:
+    update_cache: yes
+  register: update_apt_cache
+  retries: 5
+  delay: 2
+  until: update_apt_cache | success
\ No newline at end of file
index 6b41290c6afe2a5916e32a14306e33ba324d9b91..3471f0184e4a284d1fb32a6d66c52d08bedac82c 100644 (file)
@@ -9,4 +9,4 @@
     repo: "deb {{ ceph_stable_repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main"
     state: present
     update_cache: no
-  register: add_debian_apt_repo
+  notify: update apt cache if a repo was added
index 2ba350447694b385d575e6bd5bc94fbd7c74701f..d544be19c241ec1f2b71e113d70d3d25ea599123 100644 (file)
@@ -4,4 +4,5 @@
     repo: "deb {{ ceph_custom_repo }} {{ ansible_lsb.codename }} main"
     state: present
     update_cache: no
-  register: add_debian_apt_repo
+  notify: update apt cache if a repo was added
+
index 3aab4a03d65bfddd9d7a3bda27bdcc740e9a2a49..e0d3195cb79dd76f187f8c3693866fb198a93e43 100644 (file)
@@ -10,4 +10,4 @@
     repo: "{{ ceph_dev_deb_repo.content }}"
     state: present
     update_cache: no
-  register: add_debian_apt_repo
+  notify: update apt cache if a repo was added
index 5fb970a0bd244d8d7bcbe4acc558bfea08cb4591..2629b47e3c3e5b0f1baa4d6dca41a097211d1876 100644 (file)
@@ -8,4 +8,5 @@
     repo: "deb {{ ceph_stable_repo_uca }} {{ ceph_stable_release_uca }} main"
     state: present
     update_cache: no
-  register: add_debian_apt_repo
+  notify: update apt cache if a repo was added
+
index 9b8471ba14afe6f79a0994de6bf51b73a9998b34..30b70a97b552eeb7dc58f98dd6f8da7533abfc47 100644 (file)
@@ -4,17 +4,6 @@
   when:
     - ceph_origin == 'repository'
 
-- name: update apt cache if a repo was added
-  apt:
-    update_cache: yes
-  register: update_apt_cache
-  retries: 5
-  delay: 2
-  until: update_apt_cache | success
-  when:
-    - add_debian_apt_repo is defined
-    - add_debian_apt_repo.changed | default(false)
-
 - name: update apt cache if cache_valid_time has expired
   apt:
     update_cache: yes
index c8f00f80680f5061cd44f714907681045ccc785f..5a43e92a080c5b2a9e8e7144db18098fc96265d8 100644 (file)
@@ -9,9 +9,9 @@
     repo: "deb {{ ceph_rhcs_cdn_debian_repo }}{{ ceph_rhcs_cdn_debian_repo_version }}/{{ item.repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main"
     state: present
     update_cache: no
-  register: add_debian_apt_repo
   with_items:
     - { repo: "MON", configure: (mon_group_name in group_names or mgr_group_name in group_names) }
     - { repo: "OSD", configure: (osd_group_name in group_names) }
     - { repo: "Tools", configure: (rgw_group_name in group_names or mds_group_name in group_names or nfs_group_name in group_names or iscsi_gw_group_name in group_names or client_group_name in group_names) }
   when: item.configure
+  notify: update apt cache if a repo was added
index 68743ad9e01641420fb32ad6cf8ea67f0a8c25a2..7671e09f61a062e582aad6ca5cf9d13523170071 100644 (file)
@@ -53,8 +53,8 @@
     repo: "deb file://{{ ceph_rhcs_repository_path }}/{{ item }} {{ ansible_lsb.codename }} main"
     state: present
     update_cache: no
-  register: add_debian_apt_repo
   with_items:
     - MON
     - OSD
     - Tools
+  notify: update apt cache if a repo was added