From f86bbd4309ee0f847104887d5933f31a87d7bf8a Mon Sep 17 00:00:00 2001 From: Olivier Bourdon Date: Tue, 27 Feb 2018 17:24:19 +0100 Subject: [PATCH] Add variable for deploy image type This way, user can change the default deployment image to be either vm or baremetal or anything else Change-Id: I855ed4bb00d27c912130be3fd412f942b9e41136 --- playbooks/install.yaml | 2 +- playbooks/inventory/group_vars/localhost | 1 + playbooks/inventory/group_vars/target | 1 + playbooks/roles/bifrost-ironic-install/defaults/main.yml | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/playbooks/install.yaml b/playbooks/install.yaml index 1dffbdd1f..94ceb590a 100644 --- a/playbooks/install.yaml +++ b/playbooks/install.yaml @@ -23,7 +23,7 @@ config_region_name: "{{ keystone.bootstrap.region_name }}" config_auth_url: "{{ keystone.bootstrap.public_url }}" - { role: bifrost-create-dib-image, dib_imagename: "{{ http_boot_folder }}/ipa", build_ramdisk: false, dib_os_element: "{{ ipa_dib_os_element|default('debian') }}", dib_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}", when: create_ipa_image | bool == true } - - { role: bifrost-create-dib-image, dib_imagename: "{{ deploy_image }}", dib_imagetype: "qcow2", dib_elements: "vm enable-serial-console {{ dib_init_element|default('simple-init') }} {{ extra_dib_elements|default('') }}", when: create_image_via_dib | bool == true and transform_boot_image | bool == false } + - { role: bifrost-create-dib-image, dib_imagename: "{{ deploy_image }}", dib_imagetype: "qcow2", dib_elements: "{{ dib_image_type|default('vm') }} enable-serial-console {{ dib_init_element|default('simple-init') }} {{ extra_dib_elements|default('') }}", when: create_image_via_dib | bool == true and transform_boot_image | bool == false } environment: http_proxy: "{{ lookup('env','http_proxy') }}" https_proxy: "{{ lookup('env','https_proxy') }}" diff --git a/playbooks/inventory/group_vars/localhost b/playbooks/inventory/group_vars/localhost index 3165c75b2..75f676d2b 100644 --- a/playbooks/inventory/group_vars/localhost +++ b/playbooks/inventory/group_vars/localhost @@ -52,6 +52,7 @@ mysql_password: # Setting to utilize diskimage-builder to create a bootable image. create_image_via_dib: true +dib_image_type: vm # Transform boot image is intended for use with the Ubuntu trusty image. # It makes the image bootable by installing Grub. diff --git a/playbooks/inventory/group_vars/target b/playbooks/inventory/group_vars/target index 3165c75b2..75f676d2b 100644 --- a/playbooks/inventory/group_vars/target +++ b/playbooks/inventory/group_vars/target @@ -52,6 +52,7 @@ mysql_password: # Setting to utilize diskimage-builder to create a bootable image. create_image_via_dib: true +dib_image_type: vm # Transform boot image is intended for use with the Ubuntu trusty image. # It makes the image bootable by installing Grub. diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index 32a243016..c53f053bd 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -12,6 +12,7 @@ ironicinspectorclient_source_install: false staging_drivers_source_install: false # Setting to utilize diskimage-builder to create a bootable image. create_image_via_dib: true +dib_image_type: vm # Setting to install diskimage-builder install_dib: "{{ create_image_via_dib }}" # Setting to prepend a partition image with a boot sector and partition table.