Make init element configurable for bifrost vagrant VM

Bifrost vagrant uses simple-init by default for post install modifications.
This patch allows the use of an alternate init mechanism, eg: cloud-init

Change-Id: If22416f48fbf43173f008c86b978f11d937a8a99
Co-Authored-By: John.L.Villalovos <john.l.villalovos@intel.com>
Closes-Bug: #1541548
This commit is contained in:
Ganesh Mahalingam 2016-02-04 08:47:47 -08:00
parent 2e19f19fc7
commit 802cec490b
3 changed files with 20 additions and 2 deletions

View File

@ -8,7 +8,7 @@
- { role: bifrost-prep-for-install, when: skip_install is not defined } - { role: bifrost-prep-for-install, when: skip_install is not defined }
- bifrost-ironic-install - bifrost-ironic-install
- { 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: "{{ 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 serial-console simple-init {{ extra_dib_elements|default('') }}", when: create_image_via_dib == true and transform_boot_image == false } - { role: bifrost-create-dib-image, dib_imagename: "{{ deploy_image }}", dib_imagetype: "qcow2", dib_elements: "vm serial-console {{ dib_init_element|default('simple-init') }} {{ extra_dib_elements|default('') }}", when: create_image_via_dib == true and transform_boot_image == false }
environment: environment:
http_proxy: "{{ lookup('env','http_proxy') }}" http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}" https_proxy: "{{ lookup('env','https_proxy') }}"

View File

@ -39,7 +39,16 @@ dib_os_element: "ubuntu"
dib_elements is a space-separated list of elements that will be dib_elements is a space-separated list of elements that will be
added to the resulting disk image. added to the resulting disk image.
dib_elements: "vm serial-console simple-init" dib_elements: "vm serial-console"
dib_init_element is used to set the init tool that will be used to provision
the installed OS. This is an argument that is passed to
[diskimage-builder](http://docs.openstack.org/developer/diskimage-builder/)
which generates a deployable image of the OS defined in 'dib_os_element'. By
default we use 'simple-init'. You can modify this to use other init tools, for
example: cloud-init (see below)
dib_init_element: simple-init
dib_packages is a comma-separated list of packages to be installed dib_packages is a comma-separated list of packages to be installed
on the resulting disk image. on the resulting disk image.
@ -81,6 +90,14 @@ for further information.
| --ramdisk-element | dib_rdelement | element name | | --ramdisk-element | dib_rdelement | element name |
| -t | dib_installtype | source or package | | -t | dib_installtype | source or package |
Using cloud-init
----------------
By default, bifrost uses the 'simple-init' dib element, which will disable
cloud-init. If you have cloud-init enabled in your image(Ubuntu/Fedora) and you
wish to allow configdrive to work with it, you set 'dib_init_element' to
['cloud-init-datasources'](http://docs.openstack.org/developer/diskimage-builder/elements/cloud-init-datasources/README.html).
Dependencies Dependencies
------------ ------------

View File

@ -1,5 +1,6 @@
--- ---
dib_os_element: "debian" dib_os_element: "debian"
dib_init_element: "simple-init"
dib_env_vars: dib_env_vars:
http_proxy: "{{ lookup('env','http_proxy') }}" http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}" https_proxy: "{{ lookup('env','https_proxy') }}"