Skip to content

Commit 68e992c

Browse files
committed
Further fixups for register playbook
1 parent df5481e commit 68e992c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

etc/kayobe/ansible/octavia-amphora-image-register.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- openstacksdk
2222
- python-openstackclient
2323
state: latest
24-
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}"
24+
extra_args: "{% if openstacksdk_upper_constraints_file %}-c {{ openstacksdk_upper_constraints_file }}{% endif %}"
2525

2626
- name: Query Octavia Amphora image
2727
vars:
@@ -40,7 +40,14 @@
4040
checksum_algorithm: md5
4141
changed_when: false
4242
register: image_checksum
43-
when: image_info.openstack_image
43+
when: image_info.image
44+
45+
- name: Assert that Amphora image exists
46+
assert:
47+
that: image_checksum.stat.exists
48+
fail_msg: |
49+
The amphora image: {{ image_cache_path }}/amphora-x64-haproxy-{{ openstack_release }}.qcow2
50+
does not exist. Did you build the image?
4451
4552
- name: Ensure Octavia Amphora image is renamed
4653
vars:
@@ -49,8 +56,8 @@
4956
cmd: >-
5057
{{ venv }}/bin/openstack image set amphora-x64-haproxy --name amphora-x64-haproxy-{{ ansible_facts.date_time.iso8601_basic_short }}
5158
when:
52-
- image_info.openstack_image
53-
- image_info.openstack_image.checksum != image_checksum.stat.checksum
59+
- image_info.image
60+
- image_info.image.checksum != image_checksum.stat.checksum
5461
changed_when: true
5562
environment: "{{ openstack_auth_env }}"
5663

0 commit comments

Comments
 (0)