Remove the group_vars/all file for easy customization

Removal and split of the group_vars all file resulted in a general
clean-up and optomization of dependency information with-in the
roles as defaults are required and a number of them were being
supplied from group_vars/all.

Additionally split out the group_vars/all file into
group_vars/baremetal and group_vars/localhost files with
improved comments to help direct a user wanting to perform
deeper customization.

Due to variable loading processes, additionally unwire the bifrost-
create-bootable-image role, as it is no longer developed upon and
the default vars are conflicting with the variables used across
role.

Additionally updated READMEs where appropriate.

Co-Authored-By: stephane <stephane@alum.mit.edu>
Change-Id: Ia6226a8573753ff02da19dcb3c2b5abfb9b3c297
This commit is contained in:
Julia Kreger 2015-08-06 10:41:44 -04:00 committed by Stephanie Miller
parent 938b6a58e3
commit 3aa2cebe35
13 changed files with 154 additions and 54 deletions

View File

@ -79,7 +79,11 @@ The installation is split into two parts.
The first part is a bash script which lays the basic groundwork of installing
Ansible itself.
Edit ``./playbooks/inventory/group_vars/all`` to match your environment.
Edit ``./playbooks/inventory/group_vars/*`` to match your environment. The
localhost file is intended for steps executed upon the localhost, such as
installation, or image generation. The baremetal file is geared for steps
performed on baremetal nodes, such as enrollment, deployment, or any other
custom playbooks that a user may bolt on to this toolkit.
- If MySQL is already installed, update mysql_password to match your local installation.
- Change network_interface to match the interface that will need to service DHCP requests.
@ -339,7 +343,7 @@ virtual machines.
An SSH key is generated for the ``ironic`` user when testing. The ironic conductor
will use this key to connect to the host machine and run virsh commands.
#. Set ``testing`` to *true* in the ``playbooks/inventory/group_vars/all`` file.
#. Set ``testing`` to *true* in the ``playbooks/inventory/group_vars/localhost`` file.
#. You may need to adjust the value for ``ssh_public_key_path``.
#. Run the install step, as documented above, however adding "-e testing=true" to the Ansible command line.
#. Execute the ``ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml`` command to create a test virtual machine.

View File

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

View File

@ -1,45 +0,0 @@
---
ironic_url: "http://localhost:6385/"
network_interface: "virbr0"
# ironic_db_password ironic user password for rabbit
ironic_db_password: aSecretPassword473z
# mysql_password: mysql root user password
mysql_password:
# If testing is true, then the environment is setup for using libvirt
# virtual machines for the hardware instead of real hardware.
# testing: true
#
# Normally this user should be root, however if cirros is used,
# a user may wish to define a specific user for testing VM
# connectivity during a test sequence
testing_user: root
http_boot_folder: /httpboot
nginx_port: 8080
ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz"
ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz"
ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
# When using disk image builder based image generation, which is the
# default at this time, the deploy_image_filename must end with .qcow2
# due to the image creation process.
deploy_image_filename: "deployment_image.qcow2"
deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"
# Setting to utilize diskimage-builder to create a bootable image.
create_image_via_dib: true
# Add any extra elements you wish to have in the disk image
extra_dib_elements: ""
# Transform boot image is intended for use with the Ubuntu trusty image. It makes the image bootable by installing Grub.
# Setting to prepend a partition image with a boot sector and partition table.
transform_boot_image: false
node_default_network_interface: eth0
# ipv4_subnet_mask is intended for the static ipv4 address assignments.
ipv4_subnet_mask: 255.255.255.0
ipv4_gateway: 192.168.1.1
ipv4_nameserver: 8.8.8.8
network_mtu: 1500
dhcp_pool_start: 192.168.1.200
dhcp_pool_end: 192.168.1.250
# ipmi_bridging: Default undefined. Valid values: "no", "single", and "dual"
# See http://docs.openstack.org/developer/ironic/_modules/ironic/drivers/modules/ipmitool.html
#ipmi_bridging: no

View File

@ -0,0 +1,44 @@
---
# The Ironic API URL for Bifrost Operations. Defaults to localhost.
#ironic_url: "http://localhost:6385/"
# The network interface that Bifrost will be operating on. Defaults
# to virbr0 in roles, can be overridden here.
#network_interface: "virbr0"
# The path to the SSH key to be utilized for testing and burn-in
# to configuration drives. When set, it should be set in both baremetal
# and localhost groups, however this is only an override to the default.
# ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
# Normally this user should be root, however if cirros is used,
# a user may wish to define a specific user for testing VM
# connectivity during a test sequence
testing_user: root
# The default port to download files via. Required for IPA URL generation.
# Presently the defaults are located in the roles, however if changed both
# the localhost and baremetal group files must be updated.
# nginx_port: 8080
#IPA Image parameters. If these are changed, they must be changed in
# Both localhost and baremetal groups. Presently the defaults
# in each role should be sufficent for proper operation.
#ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
#ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz"
#ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz"
#ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
# The http_boot_folder defines the root folder for the webserver.
# If this setting is changed, it must be applied to both the baremetal
# and localhost groups. Presently the role defaults are set to the value
# below.
#http_boot_folder: /httpboot
# The settings for the name of the image to be deployed along with the
# on disk location are below. If changed, these settings must be applied
# to both the baremetal and localhost groups. If the file is already on
# disk, then the image generation will not take place, otherwise an image
# will be generated using diskimage-builder.
#deploy_image_filename: "deployment_image.qcow2"
#deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"

View File

@ -0,0 +1,56 @@
---
# The Ironic API URL for Bifrost Operations. Defaults to localhost.
#ironic_url: "http://localhost:6385/"
# The network interface that Bifrost will be operating on. Defaults
# to virbr0 in roles, can be overridden here.
#network_interface: "virbr0"
# ironic_db_password ironic user password for rabbit
ironic_db_password: aSecretPassword473z
# mysql_password: mysql root user password
mysql_password:
# The path to the SSH key to be utilized for testing and burn-in
# to configuration drives. When set, it should be set in both baremetal
# and localhost groups, however this is only an override to the default.
# ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
# If testing is true, then the environment is setup for using libvirt
# virtual machines for the hardware instead of real hardware.
# testing: true
# The default port to download files via. Required for IPA URL generation.
# Presently the defaults are located in the roles, however if changed both
# the localhost and baremetal group files must be updated.
# nginx_port: 8080
#IPA Image parameters. If these are changed, they must be changed in
# Both localhost and baremetal groups. Presently the defaults
# in each role should be sufficent for proper operation.
#ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
#ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz"
#ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz"
#ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
# The http_boot_folder defines the root folder for the webserver.
# If this setting is changed, it must be applied to both the baremetal
# and localhost groups. Presently the role defaults are set to the value
# below.
#http_boot_folder: /httpboot
# The settings for the name of the image to be deployed along with the
# on disk location are below. If changed, these settings must be applied
# to both the baremetal and localhost groups. If the file is already on
# disk, then the image generation will not take place, otherwise an image
# will be generated using diskimage-builder.
#deploy_image_filename: "deployment_image.qcow2"
#deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"
# Setting to utilize diskimage-builder to create a bootable image.
create_image_via_dib: true
# Transform boot image is intended for use with the Ubuntu trusty image. It makes the image bootable by installing Grub.
# Setting to prepend a partition image with a boot sector and partition table.
transform_boot_image: false

View File

@ -1 +1,2 @@
[localhost]
localhost

View File

@ -4,3 +4,17 @@
# such that cirros will receive basic network configuration when
# performing basic testing.
write_interfaces_file: false
http_boot_folder: /httpboot
# Default location to the ssh public key for the user operating Bifrost.
ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
# Default interface name
# TODO(TheJulia): Remove this default.
node_default_network_interface: eth0
# Basic networking defaults
# TODO(TheJulia): Require these to be supplied some other way.
ipv4_subnet_mask: 255.255.255.0
ipv4_gateway: 192.168.1.1
ipv4_nameserver: 8.8.8.8
network_mtu: 1500

View File

@ -2,3 +2,7 @@
# defaults file for bifrost-deploy-nodes-dynamic
ironic_url: "http://localhost:6385/"
nginx_port: 8080
network_interface: "virbr0"
http_boot_folder: "/httpboot"
deploy_image_filename: "deployment_image.qcow2"
deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"

View File

@ -1,2 +1,3 @@
---
# defaults file for bifrost-openstack-ci-prep
# Default location to the ssh public key for the user operating Bifrost.
ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"

View File

@ -1,2 +1,6 @@
---
ironic_url: "http://localhost:6385/"
nginx_port: 8080
network_interface: "virbr0"
ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.vmlinuz"
ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.initramfs"

View File

@ -41,11 +41,24 @@ however testing may require master branch or custom patches.
ironicclient_source_install: false
shade_source_install: false
Bifrost requires access to the network where nodes are located, in order to
provision the nodes. By default, this setting is set to a value for local
VM based testing, however if and when your ready to deploy to a physical
environment, you will need to set the network_interface variable to the
attached network.
network_interface: "virbr0"
By default this role installs dnsmasq to act as a DHCP server for provisioning
hosts. In the event this is not required, set the following configuration:
include_dhcp_server: false
If you chose to utilize the dhcp server, You may wish to set default ranges:
dhcp_pool_start: 192.168.1.200
dhcp_pool_end: 192.168.1.250
In case your HW needs a kernel option to boot, set the following variable:
extra_kernel_options: Default undefined.
@ -81,6 +94,7 @@ Example Playbook
- role: ironic-install
cleaning: false
testing: true
network_interface: "virbr0"
License
-------

View File

@ -14,11 +14,11 @@ transform_boot_image: false
# virtual machines for the hardware instead of real hardware.
testing: false
ci_testing: false
ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz"
ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz"
ipa_kernel: "{{http_boot_folder}}/ipa.vmlinuz"
ipa_ramdisk: "{{http_boot_folder}}/ipa.initramfs"
ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.vmlinuz"
ipa_kernel_upstream_url: http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe.vmlinuz
ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.initramfs"
ipa_ramdisk_upstream_url: http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem.cpio.gz
deploy_image_filename: "deployment_image.qcow2"
deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"
@ -42,3 +42,8 @@ ironicclient_git_folder: /opt/stack/python-ironicclient
shade_git_folder: /opt/stack/shade
# Comma separated list, in the format of a string, of drivers that are enabled.
enabled_drivers: "agent_ipmitool,pxe_amt,agent_ilo,agent_ucs"
# DHCP pool for requests
dhcp_pool_start: 192.168.1.200
dhcp_pool_end: 192.168.1.250
# Default network interface that Bifrost will be attached to.
network_interface: "virbr0"

View File

@ -51,7 +51,6 @@
cleaning: false
testing: true
- { role: bifrost-create-dib-image, dib_imagetype: "qcow2", dib_imagename: "{{deploy_image}}", dib_os_element: "{{ dib_os_element|default('debian') }}", dib_elements: "vm serial-console simple-init {{ extra_dib_elements|default('') }}", dib_packages: "{{ dib_packages|default('') }}", when: create_image_via_dib == true and transform_boot_image == false }
- { role: bifrost-create-bootable-image, when: create_image_via_dib == false and transform_boot_image == true }
environment:
http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}"