Reduce complexity when using bifrost roles 73/63173/6
authorManuel Buil <mbuil@suse.com>
Thu, 4 Oct 2018 13:33:04 +0000 (15:33 +0200)
committerManuel Buil <mbuil@suse.com>
Fri, 26 Oct 2018 07:56:02 +0000 (09:56 +0200)
We are using two variables which have a similar scope:
- create_image_via_dib
- use_prebuilt_images

We could use one of them and not both. create_image_via_dib is selected
because it also exists in upstream bifrost

use_prebuilt_images = false is the same as create_image_via_dib = true
use_prebuilt_images = true is the same as create_image_via_dib = false

Change-Id: Ieaab78f1dc2d199746a2b13ebc82e9dc615d92e9
Signed-off-by: Manuel Buil <mbuil@suse.com>
xci/config/user-vars
xci/infra/bifrost/infra-provision.sh
xci/infra/bifrost/playbooks/opnfv-virtual.yml

index 2625de2..951688a 100755 (executable)
@@ -53,6 +53,6 @@ export INFRA_DEPLOYMENT=${INFRA_DEPLOYMENT:-bifrost}
 export XCI_ANSIBLE_PARAMS=${XCI_ANSIBLE_PARAMS:-""}
 export RUN_TEMPEST=${RUN_TEMPEST:-false}
 export CORE_OPENSTACK_INSTALL=${CORE_OPENSTACK_INSTALL:-false}
-export BIFROST_USE_PREBUILT_IMAGES=${BIFROST_USE_PREBUILT_IMAGES:-false}
+export BIFROST_CREATE_IMAGE_VIA_DIB=${BIFROST_CREATE_IMAGE_VIA_DIB:-true}
 # Set this to to true to force XCI to re-create the target OS images
 export CLEAN_DIB_IMAGES=${CLEAN_DIB_IMAGES:-false}
index e60e9de..01019ea 100644 (file)
@@ -71,7 +71,7 @@ ansible-playbook ${XCI_ANSIBLE_PARAMS} \
     -e ironicclient_source_install=true \
     -e ironicclient_git_branch=${BIFROST_IRONIC_CLIENT_VERSION:-master} \
     -e ironic_git_branch=${BIFROST_IRONIC_VERSION:-master} \
-    -e use_prebuilt_images=${BIFROST_USE_PREBUILT_IMAGES:-false} \
+    -e create_image_via_dib=${BIFROST_CREATE_IMAGE_VIA_DIB:-true} \
     -e xci_distro=${XCI_DISTRO} \
     -e ironic_url="http://192.168.122.2:6385/" \
     ${BIFROST_ROOT_DIR}/playbooks/opnfv-virtual.yml
index 313919b..77f4b51 100644 (file)
@@ -52,7 +52,7 @@
             mode: '0755'
             owner: 'root'
             group: 'root'
-      when: use_prebuilt_images | bool == true
+      when: create_image_via_dib | bool == false
     - name: Ensure /etc/hosts has good defaults
       lineinfile:
         create: yes
       when:
         - create_image_via_dib | bool == true
         - transform_boot_image | bool == false
-        - use_prebuilt_images | bool == false
     - role: bifrost-keystone-client-config
       clouds:
         bifrost: