Skip to content

Commit 05f63d6

Browse files
committed
Clone kayobe source on Yoga & earlier releases
Yoga & earlier deployments have been broken since the following related changes: #55 #59 #60 The above changes switched to installing Kayobe using SKC's requirements.txt, avoiding the need for a local copy of the repository. This breaks Yoga & earlier releases which require symlinks in etc/kayobe/ansible/ to correctly resolve to a Kayobe source repo. This change reverts to cloning a Kayobe repository when using Yoga & earlier releases.
1 parent 76ecc19 commit 05f63d6

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

ansible/deploy-openstack-config.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,28 @@
143143
create: true
144144
loop: "{{ kayobe_config_custom }}"
145145

146+
- name: Determine OpenStack release
147+
ansible.builtin.shell:
148+
cmd: >
149+
awk -F'=' '/defaultbranch/ {print $2}' {{ src_directory }}/{{ kayobe_config_name }}/.gitreview |
150+
sed -E "s,(stable|unmaintained)/,,"
151+
register: openstack_release
152+
changed_when: false
153+
154+
# Yoga and earlier releases require a Kayobe checkout for the symlinks in
155+
# etc/kayobe/ansible/ to resolve correctly.
156+
- name: Set a fact about whether a Kayobe source checkout is required
157+
ansible.builtin.set_fact:
158+
kayobe_src_required: "{{ openstack_release.stdout != 'zed' and not openstack_release.stdout.startswith('202') }}"
159+
160+
- name: Ensure Kayobe repository is present (Yoga & earlier)
161+
ansible.builtin.git:
162+
repo: "{{ kayobe_repo }}"
163+
version: "{{ kayobe_version or 'stackhpc/' ~ openstack_release.stdout }}"
164+
dest: "{{ src_directory }}/{{ kayobe_name }}"
165+
update: false
166+
when: kayobe_src_required
167+
146168
- name: Ensure `venvs` directory exists
147169
ansible.builtin.file:
148170
path: "{{ ansible_env.HOME }}/venvs"
@@ -177,6 +199,14 @@
177199
virtualenv_command: "/usr/bin/python3 -m venv"
178200
state: present
179201

202+
- name: Ensure `kayobe` is installed (Yoga & earlier)
203+
ansible.builtin.pip:
204+
name: "{{ src_directory }}/{{ kayobe_name }}/"
205+
virtualenv: "{{ ansible_env.HOME }}/venvs/kayobe"
206+
virtualenv_command: "/usr/bin/python3 -m venv"
207+
state: present
208+
when: kayobe_src_required
209+
180210
- name: Ensure vault password is present
181211
ansible.builtin.copy:
182212
src: "{{ vault_password_path }}"

ansible/vars/defaults.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ kayobe_config_custom: []
1919

2020
kayobe_repo: https://github.com/stackhpc/kayobe
2121
kayobe_version:
22+
kayobe_name: kayobe
2223

2324
openstack_config_repo: https://github.com/stackhpc/openstack-config-multinode
2425
openstack_config_version: main

0 commit comments

Comments
 (0)