kayobe/ansible/seed-service-upgrade-prep.yml
Mark Goddard 6496af1f67 Add kayobe seed service upgrade command
Adds a new command to upgrade containerised services on the seed:

kayobe seed service upgrade

This is largely the same as the deploy command, since there is no
kolla-ansible bifrost-upgrade command yet.

A limitation in Bifrost requires us to remove IPA images before
upgrading the bifrost container.

Change-Id: Ibbe01e972487e69dbb753a67efcf13e3ae0800de
Story: 2004308
Task: 27872
2018-12-21 15:21:30 +00:00

33 lines
1.1 KiB
YAML

---
- name: Prepare for an upgrade of the seed services
hosts: seed
tasks:
# Bifrost fails if IPA images exist with a different checksum. Move them
# out of the way.
- block:
- name: Find IPA deployment images
find:
path: /var/lib/docker/volumes/bifrost_httpboot/_data
patterns:
# Specify filenames individually to avoid movind previously moved
# images.
- ipa.initramfs
- ipa.initramfs.sha256
- ipa.vmlinuz
- ipa.vmlinuz.sha256
register: find_result
become: true
- name: Set a fact about the current time
set_fact:
ipa_extension: "{{ ansible_date_time.iso8601 }}"
- name: Move old IPA deployment images to make way for new ones
command: mv {{ item.path }} {{ item.path }}.{{ ipa_extension }}
with_items: "{{ find_result.files }}"
loop_control:
label: "{{ item.path }}"
become: true
when: not ipa_build_images | bool