From 0514ccb74c02c45b667c324c10af2398af73d373 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 11 May 2016 13:51:04 -0600 Subject: [PATCH] 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 --- roles/pcp/tasks/{prep.yml => apt_update.yml} | 0 roles/pcp/tasks/main.yml | 5 +++-- roles/pcp/tasks/repo.yml | 12 ++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) rename roles/pcp/tasks/{prep.yml => apt_update.yml} (100%) diff --git a/roles/pcp/tasks/prep.yml b/roles/pcp/tasks/apt_update.yml similarity index 100% rename from roles/pcp/tasks/prep.yml rename to roles/pcp/tasks/apt_update.yml 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/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" -- 2.47.3