ceph-common: use a handler

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>
pull/3285/head
Sébastien Han 2018-10-30 15:53:07 +01:00 committed by Guillaume Abrioux
parent 53972ee672
commit 53cdddf886
8 changed files with 16 additions and 17 deletions

View File

@ -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

View 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

View 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

View 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

View 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

View 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

View 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

View 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