Pin and use known versions of Bifrost dependencies for online deployments
Currently we do not use pinned versions of Bifrost dependencies for
online deployments and this is problematic since any new commit
coming into the branch bifrost checks out has possibility to break
things for us.
Apart from that, the default checkout behavior of bifrost is to
match the branches of the dependencies it checks out to the bifrost
branch. This is also risky and prevents us from bumping bifrost itself
while keeping the rest on known versions. By using pinned versions for
everything, we can bump versions in a more controlled way.
Change-Id: I40f04d1a2baf3fb5659fafdb51cb661a734a10d7
diff --git a/playbooks/roles/install-configure-bifrost/tasks/configure-bifrost-offline.yml b/playbooks/roles/install-configure-bifrost/tasks/configure-bifrost-offline.yml
index fc64785..8556a75 100644
--- a/playbooks/roles/install-configure-bifrost/tasks/configure-bifrost-offline.yml
+++ b/playbooks/roles/install-configure-bifrost/tasks/configure-bifrost-offline.yml
@@ -23,16 +23,6 @@
src: "{{ engine_workspace }}/offline/git/"
dest: "{{ engine_cache }}/repos"
-- name: Create folder to override Bifrost dependencies
- file:
- path: "{{ engine_cache }}/repos/bifrost/playbooks/roles/bifrost-prep-for-install/vars"
- state: directory
-
-- name: Configure local copy of Bifrost dependencies
- template:
- src: "offline-repos.j2"
- dest: "{{ engine_cache }}/repos/bifrost/playbooks/roles/bifrost-prep-for-install/vars/main.yml"
-
- name: Enable use of local repositories in Bifrost
lineinfile:
path: "{{ engine_cache }}/repos/bifrost/playbooks/roles/bifrost-prep-for-install/defaults/main.yml"
diff --git a/playbooks/roles/install-configure-bifrost/tasks/main.yml b/playbooks/roles/install-configure-bifrost/tasks/main.yml
index 77b7952..ffe8ebc 100644
--- a/playbooks/roles/install-configure-bifrost/tasks/main.yml
+++ b/playbooks/roles/install-configure-bifrost/tasks/main.yml
@@ -65,6 +65,19 @@
- include_tasks: configure-bifrost-offline.yml
when: execution_mode == 'offline-deployment'
+- name: Create folder to override Bifrost dependencies
+ file:
+ path: "{{ engine_cache }}/repos/bifrost/playbooks/roles/bifrost-prep-for-install/vars"
+ state: "{{ item }}"
+ with_items:
+ - absent
+ - directory
+
+- name: Create Bifrost dependencies file to set git repos and pinned versions
+ template:
+ src: "bifrost-dependencies.yaml.j2"
+ dest: "{{ engine_cache }}/repos/bifrost/playbooks/roles/bifrost-prep-for-install/vars/main.yml"
+
- name: Create folders to put ipa and deployment images
file:
path: "{{ item }}"
diff --git a/playbooks/roles/install-configure-bifrost/templates/bifrost-dependencies.yaml.j2 b/playbooks/roles/install-configure-bifrost/templates/bifrost-dependencies.yaml.j2
new file mode 100644
index 0000000..d0fe568
--- /dev/null
+++ b/playbooks/roles/install-configure-bifrost/templates/bifrost-dependencies.yaml.j2
@@ -0,0 +1,31 @@
+---
+{% if execution_mode == "offline-deployment" %}
+# Offline installation must use local directories for bifrost dependencies
+dib_git_url: {{ engine_cache }}/repos/diskimage-builder
+ipa_git_url: {{ engine_cache }}/repos/ironic-python-agent
+ipa_builder_git_url: {{ engine_cache }}/repos/ironic-python-agent-builder
+ironic_git_url: {{ engine_cache }}/repos/ironic
+ironicclient_git_url: {{ engine_cache }}/repos/python-ironicclient
+ironicinspectorclient_git_url: {{ engine_cache }}/repos/python-ironic-inspector-client
+ironicinspector_git_url: {{ engine_cache }}/repos/ironic-inspector
+keystone_git_url: {{ engine_cache }}/repos/keystone
+openstacksdk_git_url: {{ engine_cache }}/repos/openstacksdk
+reqs_git_url: {{ engine_cache }}/repos/requirements
+shade_git_url: {{ engine_cache }}/repos/shade
+staging_drivers_git_url: {{ engine_cache }}/repos/ironic-staging-drivers
+sushy_git_url: {{ engine_cache }}/repos/sushy
+{% endif %}
+# These versions are pinned in engine/inventory/group_vars/all/versions.yaml
+dib_git_branch: "{{ diskimage_builder_version }}"
+ipa_git_branch: "{{ ironic_python_agent_version }}"
+ipa_builder_git_branch: "{{ ironic_python_agent_builder_version }}"
+ironic_git_branch: "{{ ironic_version }}"
+ironicclient_git_branch: "{{ python_ironicclient_version }}"
+ironicinspectorclient_git_branch: "{{ python_ironic_inspector_client_version }}"
+ironicinspector_git_branch: "{{ ironic_inspector_version }}"
+keystone_git_branch: "{{ keystone_version }}"
+openstacksdk_git_branch: "{{ openstacksdk_version }}"
+reqs_git_branch: "{{ requirements_version }}"
+shade_git_branch: "{{ shade_version }}"
+staging_drivers_git_branch: "{{ ironic_staging_drivers_version }}"
+sushy_git_branch: "{{ sushy_version }}"
diff --git a/playbooks/roles/install-configure-bifrost/templates/offline-repos.j2 b/playbooks/roles/install-configure-bifrost/templates/offline-repos.j2
deleted file mode 100644
index bc7f393..0000000
--- a/playbooks/roles/install-configure-bifrost/templates/offline-repos.j2
+++ /dev/null
@@ -1,16 +0,0 @@
----
-# This file will override Bifrost's default urls for git repositories to
-# use local directories during the offline installation.
-dib_git_url: {{ engine_cache }}/repos/diskimage-builder
-ironicclient_git_url: {{ engine_cache }}/repos/python-ironicclient
-openstacksdk_git_url: {{ engine_cache }}/repos/openstacksdk
-shade_git_url: {{ engine_cache }}/repos/shade
-ironic_git_url: {{ engine_cache }}/repos/ironic
-ironicinspector_git_url: {{ engine_cache }}/repos/ironic-inspector
-ironicinspectorclient_git_url: {{ engine_cache }}/repos/python-ironic-inspector-client
-reqs_git_url: {{ engine_cache }}/repos/requirements
-staging_drivers_git_url: {{ engine_cache }}/repos/ironic-staging-drivers
-keystone_git_url: {{ engine_cache }}/repos/keystone
-sushy_git_url: {{ engine_cache }}/repos/sushy
-ipa_git_url: {{ engine_cache }}/repos/ironic-python-agent
-ipa_builder_git_url: {{ engine_cache }}/repos/ironic-python-agent-builder