]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
pcp: update upstream packages 241/head
authorZack Cerza <zack@redhat.com>
Wed, 11 May 2016 19:51:04 +0000 (13:51 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 11 May 2016 19:51:04 +0000 (13:51 -0600)
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 <zack@redhat.com>
roles/pcp/tasks/apt_update.yml [new file with mode: 0644]
roles/pcp/tasks/main.yml
roles/pcp/tasks/prep.yml [deleted file]
roles/pcp/tasks/repo.yml

diff --git a/roles/pcp/tasks/apt_update.yml b/roles/pcp/tasks/apt_update.yml
new file mode 100644 (file)
index 0000000..1cf903f
--- /dev/null
@@ -0,0 +1,6 @@
+---
+- name: Update apt cache
+  apt:
+    update_cache: yes
+  when:
+    ansible_pkg_mgr == "apt"
index 39b2fee3d59c1be0603cee02f9e7a453edc517da..4df727292ef95afaea31b945359caed9bacf4105 100644 (file)
@@ -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 (file)
index 1cf903f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
----
-- name: Update apt cache
-  apt:
-    update_cache: yes
-  when:
-    ansible_pkg_mgr == "apt"
index cdcac193f6fe2d0ec88b73b3853b415c2f4edfeb..12f5be6701a93b86a280c9dde253f2d86532b980 100644 (file)
     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"