From ec47c8528daa2d6eed0b54afee598dc25eb9b20b Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Mon, 3 Aug 2015 13:47:35 -0400 Subject: [PATCH] Move DIB components to support depends-on Until support for zuul-cloner arrives for bifrost's CI settings, we need mechanisms to allow us test against a dependent revision in the diskimage-builder repositioy. As such, we've moved the diskimage-builder download and installation to align with the other packages from source, and updated the CI prep role to apply dependent revisions. Additionally, correct conditionals in the OpenStack CI prep role. Change-Id: Ie5db11ff7d2160c7cea9a71aebd86d1b369983c1 --- .../roles/bifrost-openstack-ci-prep/tasks/main.yml | 10 +++++++--- .../roles/bifrost-prep-for-install/defaults/main.yml | 2 ++ .../roles/bifrost-prep-for-install/tasks/main.yml | 8 ++++++++ playbooks/roles/ironic-install/defaults/main.yml | 1 + playbooks/roles/ironic-install/tasks/dib_install.yml | 10 +--------- playbooks/test-bifrost-dynamic.yaml | 1 + 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/playbooks/roles/bifrost-openstack-ci-prep/tasks/main.yml b/playbooks/roles/bifrost-openstack-ci-prep/tasks/main.yml index 2c5acb31e..8ff59b5dd 100644 --- a/playbooks/roles/bifrost-openstack-ci-prep/tasks/main.yml +++ b/playbooks/roles/bifrost-openstack-ci-prep/tasks/main.yml @@ -13,15 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. --- +# TODO(TheJulia) Remove this once 199580 has landed - name: "Shade - Apply CI changes if necessary" script: parse_zuul_changes.py {{ shade_git_folder }} https://review.openstack.org openstack-infra/shade "{{ lookup('env', 'ZUUL_CHANGES') }}" when: ci_testing_zuul_changes is defined and skip_install | bool != true - name: "python-ironicclient - Apply CI changes if necessary" script: parse_zuul_changes.py {{ ironicclient_git_folder }} https://review.openstack.org openstack/python-ironicclient "{{ lookup('env', 'ZUUL_CHANGES') }}" - when: ci_testing_zuul_changes is defined and skip_install | bool != True -- name: "Ironic - Apply CI changes if necessary" + when: ci_testing_zuul_changes is defined and skip_install | bool != true +- name: "ironic - Apply CI changes if necessary" script: parse_zuul_changes.py {{ ironic_git_folder }} https://review.openstack.org openstack/ironic "{{ lookup('env', 'ZUUL_CHANGES') }}" - when: ci_testing_zuul_changes is defined and skip_install | bool != True + when: ci_testing_zuul_changes is defined and skip_install | bool != true +- name: "diskimage-builder - Apply CI changes if necessary" + script: parse_zuul_changes.py {{ dib_git_folder }} https://review.openstack.org openstack/diskimage-builder "{{ lookup('env', 'ZUUL_CHANGES') }}" + when: ci_testing_zuul_changes is defined and skip_install | bool != true # NOTE(TheJulia): Override the stored fact values for username/password when operating # in OpenStack CI. - name: "Set facts for OpenStack CI" diff --git a/playbooks/roles/bifrost-prep-for-install/defaults/main.yml b/playbooks/roles/bifrost-prep-for-install/defaults/main.yml index 21bf22b60..5307ff6e8 100644 --- a/playbooks/roles/bifrost-prep-for-install/defaults/main.yml +++ b/playbooks/roles/bifrost-prep-for-install/defaults/main.yml @@ -10,7 +10,9 @@ ironic_git_url: https://git.openstack.org/openstack/ironic ironicclient_git_folder: "{{ git_root}}/python-ironicclient" ironic_git_folder: "{{ git_root}}/ironic" shade_git_folder: "{{ git_root}}/shade" +dib_git_folder: "{{ git_root }}/diskimage-builder" # *_git_branch can be overridden for stable branch testing ironicclient_git_branch: master ironic_git_branch: master shade_git_branch: master +dib_git_branch: master diff --git a/playbooks/roles/bifrost-prep-for-install/tasks/main.yml b/playbooks/roles/bifrost-prep-for-install/tasks/main.yml index a5cc546c9..dd488050c 100644 --- a/playbooks/roles/bifrost-prep-for-install/tasks/main.yml +++ b/playbooks/roles/bifrost-prep-for-install/tasks/main.yml @@ -37,3 +37,11 @@ command: git reset --hard {{ shade_git_branch }} chdir={{ shade_git_folder }} - name: "Shade - Resyncing local repository" command: git pull --ff-only chdir={{ shade_git_folder }} +- name: "Disk Image Builder - Retrieving from git.openstack.org" + command: git clone {{ dib_git_url }} {{ dib_git_folder }} chdir={{ git_root }} creates={{ dib_git_folder }} +- name: "Disk Image Builder - Checking out branch" + command: git checkout -f {{ dib_git_branch }} chdir={{ dib_git_folder }} +- name: "Disk Image Builder - Resetting local repository" + command: git reset --hard {{ dib_git_branch }} chdir={{ dib_git_folder }} +- name: "Disk Image Builder - Resyncing local repository" + command: git pull --ff-only chdir={{ dib_git_folder }} diff --git a/playbooks/roles/ironic-install/defaults/main.yml b/playbooks/roles/ironic-install/defaults/main.yml index 354968ca1..73c3d1f7f 100644 --- a/playbooks/roles/ironic-install/defaults/main.yml +++ b/playbooks/roles/ironic-install/defaults/main.yml @@ -40,5 +40,6 @@ disable_dnsmasq_dns: False ironic_git_folder: /opt/stack/ironic ironicclient_git_folder: /opt/stack/python-ironicclient shade_git_folder: /opt/stack/shade +dib_git_folder: /opt/stack/diskimage-builder # Comma separated list, in the format of a string, of drivers that are enabled. enabled_drivers: "agent_ipmitool,pxe_amt,agent_ilo,agent_ucs" diff --git a/playbooks/roles/ironic-install/tasks/dib_install.yml b/playbooks/roles/ironic-install/tasks/dib_install.yml index f1f1a0a40..957dc131f 100644 --- a/playbooks/roles/ironic-install/tasks/dib_install.yml +++ b/playbooks/roles/ironic-install/tasks/dib_install.yml @@ -13,13 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -- name: "DIB - Retrieving diskimage-builder from git.openstack.org" - command: git clone {{ dib_git_url }} chdir=/opt/stack creates=/opt/stack/diskimage-builder -- name: "DIB - Checking out master branch" - command: git checkout -f master chdir=/opt/stack/diskimage-builder -- name: "DIB- Resetting local repository" - command: git reset --hard master chdir=/opt/stack/diskimage-builder -- name: "DIB - Resyncing local repository" - command: git pull --ff-only chdir=/opt/stack/diskimage-builder - name: "DIB - Installing patched library." - command: pip install --force-reinstall /opt/stack/diskimage-builder + command: pip install --force-reinstall "{{ dib_git_folder }}" diff --git a/playbooks/test-bifrost-dynamic.yaml b/playbooks/test-bifrost-dynamic.yaml index e3d4c0a8d..6b124957b 100644 --- a/playbooks/test-bifrost-dynamic.yaml +++ b/playbooks/test-bifrost-dynamic.yaml @@ -19,6 +19,7 @@ ironic_git_url: /opt/git/openstack/ironic ironicclient_git_url: /opt/git/openstack/python-ironicclient shade_git_url: /opt/git/openstack-infra/shade + dib_git_url: /opt/git/openstack/diskimage-builder when: lookup('env', 'ZUUL_BRANCH') != "" - name: "Set ci_testing_zuul_changes if ZUUL_CHANGES is set" set_fact: