From: Zack Cerza Date: Wed, 11 May 2016 19:51:04 +0000 (-0600) Subject: pcp: update upstream packages X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F241%2Fhead;p=ceph-cm-ansible.git pcp: update upstream packages PCP's upstream doesn't version its dependencies in all cases. This leads to situations where, when setting upstream_repo to True, a system ends up with some old and some new packages. This results in a potentially broken installation. This commit causes all installed pcp packages to be upgraded when upstream_repo is True. Signed-off-by: Zack Cerza --- diff --git a/roles/pcp/tasks/apt_update.yml b/roles/pcp/tasks/apt_update.yml new file mode 100644 index 00000000..1cf903f9 --- /dev/null +++ b/roles/pcp/tasks/apt_update.yml @@ -0,0 +1,6 @@ +--- +- name: Update apt cache + apt: + update_cache: yes + when: + ansible_pkg_mgr == "apt" diff --git a/roles/pcp/tasks/main.yml b/roles/pcp/tasks/main.yml index 39b2fee3..4df72729 100644 --- a/roles/pcp/tasks/main.yml +++ b/roles/pcp/tasks/main.yml @@ -11,8 +11,9 @@ tags: - repo -- name: Miscellaneous preparation - include: prep.yml +- include: apt_update.yml + when: + upstream_repo|bool == false tags: - always diff --git a/roles/pcp/tasks/prep.yml b/roles/pcp/tasks/prep.yml deleted file mode 100644 index 1cf903f9..00000000 --- a/roles/pcp/tasks/prep.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Update apt cache - apt: - update_cache: yes - when: - ansible_pkg_mgr == "apt" diff --git a/roles/pcp/tasks/repo.yml b/roles/pcp/tasks/repo.yml index cdcac193..12f5be67 100644 --- a/roles/pcp/tasks/repo.yml +++ b/roles/pcp/tasks/repo.yml @@ -29,3 +29,15 @@ validate_certs: true when: ansible_pkg_mgr == "yum" + +- include: apt_update.yml + +- name: Ensure packages are updated (apt) + shell: "DEBIAN_FRONTEND=noninteractive apt -y install --only-upgrade .*pcp.*" + when: + ansible_pkg_mgr == "apt" + +- name: Ensure packages are updated (yum) + shell: "yum update *pcp*" + when: + ansible_pkg_mgr == "yum"