tripleo-heat-templates/puppet/services/openvswitch-upgrade.yaml
Carlos Camacho 0a0e2ee629 Update the template_version alias for all the templates to pike.
Master is now the development branch for pike
changing the release alias name.

Change-Id: I938e4a983e361aefcaa0bd9a4226c296c5823127
2017-05-19 09:58:07 +02:00

51 lines
1.8 KiB
YAML

heat_template_version: pike
description: >
Openvswitch package special handling for upgrade.
outputs:
role_data:
description: Upgrade task for special handling of Openvswitch (OVS) upgrade.
value:
service_name: openvswitch_upgrade
upgrade_tasks:
- name: Check openvswitch version.
tags: step2
register: ovs_version
ignore_errors: true
shell: rpm -qa | awk -F- '/^openvswitch-2/{print $2 "-" $3}'
- name: Check openvswitch packaging.
tags: step2
shell: rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep -q "systemctl.*try-restart"
register: ovs_packaging_issue
ignore_errors: true
- block:
- name: "Ensure empty directory: emptying."
file:
state: absent
path: /root/OVS_UPGRADE
- name: "Ensure empty directory: creating."
file:
state: directory
path: /root/OVS_UPGRADE
owner: root
group: root
mode: 0750
- name: Download OVS packages.
command: yumdownloader --destdir /root/OVS_UPGRADE --resolve openvswitch
- name: Get rpm list for manual upgrade of OVS.
shell: ls -1 /root/OVS_UPGRADE/*.rpm
register: ovs_list_of_rpms
- name: Manual upgrade of OVS
shell: |
rpm -U --test {{item}} 2>&1 | grep "already installed" || \
rpm -U --replacepkgs --notriggerun --nopostun {{item}};
args:
chdir: /root/OVS_UPGRADE
with_items:
- "{{ovs_list_of_rpms.stdout_lines}}"
tags: step2
when: "'2.5.0-14' in '{{ovs_version.stdout}}'
or
ovs_packaging_issue|succeeded"