Remove package if service stopped and disabled

Adds a UpgradeRemoveUnusedPackages param to use
in the ansible when conditional for the removal

Adds package removal to step2 right after a service
is stopped and disabled on step2. Package updates
happen in step3 so ideally remove before that.

The package removal task has ignore_errors true
so dependencies or other issue removing packages will
not fail the upgrade workflow.

Also adds this to the upgrade environment files
for visibility and defaulting false

Change-Id: Ie4e4a2d41f7752c5a13507a7c15c6f68e203cfca
Related-Bug: 1701501
(cherry picked from commit ce0ef2fa20)
This commit is contained in:
marios
2017-07-03 19:20:30 +03:00
committed by Emilien Macchi
parent c4bd0a3468
commit 6d150b03cf
33 changed files with 296 additions and 3 deletions

View File

@@ -36,6 +36,11 @@ parameters:
default: {}
description: Parameters specific to the role
type: json
UpgradeRemoveUnusedPackages:
default: false
description: Remove package if the service is being disabled during upgrade
type: boolean
resources:
ContainersCommon:
@@ -126,3 +131,8 @@ outputs:
- name: Stop and disable ceilometer agent central service
tags: step2
service: name=openstack-ceilometer-central state=stopped enabled=no
- name: Remove openstack-ceilometer-central package if operator requests it
yum: name=openstack-ceilometer-central state=removed
tags: step2
ignore_errors: True
when: {get_param: UpgradeRemoveUnusedPackages}