diff options
Diffstat (limited to 'bifrost')
-rw-r--r-- | bifrost/playbooks/opnfv-virtual.yaml | 48 | ||||
-rwxr-xr-x | bifrost/scripts/bifrost-provision.sh | 13 |
2 files changed, 58 insertions, 3 deletions
diff --git a/bifrost/playbooks/opnfv-virtual.yaml b/bifrost/playbooks/opnfv-virtual.yaml index 4e985db8..2ebf86f8 100644 --- a/bifrost/playbooks/opnfv-virtual.yaml +++ b/bifrost/playbooks/opnfv-virtual.yaml @@ -24,6 +24,45 @@ - name: "Override the ipv4_gateway setting" set_fact: ipv4_gateway: "192.168.122.1" + - name: Prepare the XCI pre-built images + block: + - name: Create the PXE directory + file: + path: /httpboot + state: directory + become: yes + - name: Download the {{ xci_distro }} image checksum file + get_url: + dest: /httpboot/deployment_image.qcow2.sha256.txt + force: no + url: http://artifacts.opnfv.org/releng/xci/images/{{ xci_distro }}.qcow2.sha256.txt + timeout: 3000 + become: yes + - name: Extract checksum + shell: awk '{print $1}' /httpboot/deployment_image.qcow2.sha256.txt + register: _image_checksum + - fail: + msg: "Failed to get image checksum" + when: _image_checksum == '' + - set_fact: + image_checksum: "{{ _image_checksum.stdout }}" + - name: Download the {{ xci_distro }} image file + get_url: + url: http://artifacts.opnfv.org/releng/xci/images/{{ xci_distro }}.qcow2 + checksum: "sha256:{{ image_checksum }}" + timeout: 3000 + dest: /httpboot/deployment_image.qcow2 + force: no + become: yes + - name: Set correct mode for {{ xci_distro }}.qcow2 file + file: + path: /httpboot/deployment_image.qcow2 + mode: '0755' + owner: 'root' + group: 'root' + become: yes + when: use_prebuilt_images | bool == true + roles: - { role: bifrost-prep-for-install, when: skip_install is not defined } environment: @@ -49,7 +88,9 @@ dib_os_release: "jessie" dib_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}" dib_notmpfs: true - when: create_ipa_image | bool == true + when: + - create_ipa_image | bool == true + - not use_prebuilt_images | bool == false - role: bifrost-create-dib-image dib_imagetype: "qcow2" dib_imagename: "{{deploy_image}}" @@ -61,7 +102,10 @@ dib_elements: "vm enable-serial-console simple-init devuser openssh-server growroot pip-and-virtualenv {{ extra_dib_elements }}" dib_packages: "{{ lookup('env', 'DIB_OS_PACKAGES') }}" dib_notmpfs: true - when: create_image_via_dib | bool == true and transform_boot_image | bool == false + when: + - create_image_via_dib | bool == true + - transform_boot_image | bool == false + - use_prebuilt_images | bool == false - role: bifrost-keystone-client-config user: "{{ ansible_env.SUDO_USER }}" clouds: diff --git a/bifrost/scripts/bifrost-provision.sh b/bifrost/scripts/bifrost-provision.sh index d641d506..dccb3231 100755 --- a/bifrost/scripts/bifrost-provision.sh +++ b/bifrost/scripts/bifrost-provision.sh @@ -28,6 +28,9 @@ BIFROST_IRONIC_INSPECTOR_CLIENT_VERSION=${BIFROST_IRONIC_INSPECTOR_CLIENT_VERSIO BIFROST_IRONIC_CLIENT_VERSION=${BIFROST_IRONIC_CLIENT_VERSION:-master} BIFROST_IRONIC_VERSION=${BIFROST_IRONIC_VERSION:-master} +# set UPPER_CONSTRAINTS_FILE since it is needed in order to limit libvirt-python to 4.0.0 +export UPPER_CONSTRAINTS_FILE=https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt + # Ensure the right inventory files is used based on branch CURRENT_BIFROST_BRANCH=$(git rev-parse --abbrev-ref HEAD) if [ $CURRENT_BIFROST_BRANCH = "master" ]; then @@ -74,6 +77,12 @@ export DIB_OS_PACKAGES=${DIB_OS_PACKAGES:-"vlan,vim,less,bridge-utils,language-p # Additional dib elements export EXTRA_DIB_ELEMENTS=${EXTRA_DIB_ELEMENTS:-"openssh-server"} +# Copy the OS images if found +if [[ -e ${XCI_PATH}/deployment_image.qcow2 ]]; then + sudo mkdir -p /httpboot + sudo mv ${XCI_PATH}/deployment_image.qcow2* /httpboot/ +fi + if [ ${USE_VENV} = "true" ]; then export VENV=/opt/stack/bifrost $SCRIPT_HOME/env-setup.sh &>/dev/null @@ -138,7 +147,9 @@ ${ANSIBLE} ${XCI_ANSIBLE_VERBOSITY} \ -e ironicinspectorclient_git_branch=${BIFROST_IRONIC_INSPECTOR_CLIENT_VERSION} \ -e ironicclient_source_install=true \ -e ironicclient_git_branch=${BIFROST_IRONIC_CLIENT_VERSION} \ - -e ironic_git_branch=${BIFROST_IRONIC_VERSION} + -e ironic_git_branch=${BIFROST_IRONIC_VERSION} \ + -e use_prebuilt_images=${BIFROST_USE_PREBUILT_IMAGES} \ + -e xci_distro=${XCI_DISTRO} EXITCODE=$? if [ $EXITCODE != 0 ]; then |