ceph-common: update_cache whenever a new deb repo is added

The use of a handler meant that the cache would be updated at the very
end of the play, which doesn't work when adding a development repo and
trying to install right after it. This mostly reverts
53cdddf886 without an actual `git revert`
because that caused other conflicts.

Signed-off-by: Alfredo Deza <adeza@redhat.com>
pull/3301/head
Alfredo Deza 2018-11-01 14:48:06 -04:00 committed by Sébastien Han
parent ed1d53b2f8
commit 21f9126fc4
5 changed files with 4 additions and 16 deletions

View File

@ -1,8 +0,0 @@
---
- 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

@ -8,5 +8,4 @@
apt_repository: apt_repository:
repo: "deb {{ ceph_stable_repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main" repo: "deb {{ ceph_stable_repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main"
state: present state: present
update_cache: no update_cache: yes
notify: update apt cache if a repo was added

View File

@ -9,5 +9,4 @@
apt_repository: apt_repository:
repo: "{{ ceph_dev_deb_repo.content }}" repo: "{{ ceph_dev_deb_repo.content }}"
state: present state: present
update_cache: no update_cache: yes
notify: update apt cache if a repo was added

View File

@ -8,10 +8,9 @@
apt_repository: apt_repository:
repo: "deb {{ ceph_rhcs_cdn_debian_repo }}{{ ceph_rhcs_cdn_debian_repo_version }}/{{ item.repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main" 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 state: present
update_cache: no update_cache: yes
with_items: with_items:
- { repo: "MON", configure: (mon_group_name in group_names or mgr_group_name in group_names) } - { 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: "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) } - { 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 when: item.configure
notify: update apt cache if a repo was added

View File

@ -52,9 +52,8 @@
apt_repository: apt_repository:
repo: "deb file://{{ ceph_rhcs_repository_path }}/{{ item }} {{ ansible_lsb.codename }} main" repo: "deb file://{{ ceph_rhcs_repository_path }}/{{ item }} {{ ansible_lsb.codename }} main"
state: present state: present
update_cache: no update_cache: yes
with_items: with_items:
- MON - MON
- OSD - OSD
- Tools - Tools
notify: update apt cache if a repo was added