From 704f25cae78676e9d92acd70e30eef3e677ecf23 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 30 Mar 2017 11:24:53 +0100 Subject: [PATCH] Flesh out Ironic configuration, particularly drivers Also adds PXE append params with arguments to enable consoles --- ansible/group_vars/all/inspector | 2 +- ansible/group_vars/all/ironic | 113 +++++++++++++++++- .../roles/kolla-openstack/defaults/main.yml | 82 +++++++++++++ .../kolla-openstack/templates/ironic.conf.j2 | 29 ++++- etc/kayobe/ironic.yml | 88 ++++++++++++++ 5 files changed, 309 insertions(+), 5 deletions(-) diff --git a/ansible/group_vars/all/inspector b/ansible/group_vars/all/inspector index 8f9021b44..36f675942 100644 --- a/ansible/group_vars/all/inspector +++ b/ansible/group_vars/all/inspector @@ -37,7 +37,7 @@ inspector_port_addition: "all" inspector_enable_discovery: True # The Ironic driver with which to register newly discovered nodes. -inspector_discovery_enroll_node_driver: "agent_ipmitool" +inspector_discovery_enroll_node_driver: "ipmi" ############################################################################### # Ironic inspector configuration. diff --git a/ansible/group_vars/all/ironic b/ansible/group_vars/all/ironic index ac7f8b788..64f791267 100644 --- a/ansible/group_vars/all/ironic +++ b/ansible/group_vars/all/ironic @@ -4,13 +4,122 @@ # List of enabled Ironic drivers. kolla_ironic_drivers: - - agent_ssh - agent_ipmitool - - pxe_ssh - pxe_ipmitool +# Specify the list of hardware types to load during service initialization. +kolla_ironic_enabled_hardware_types: + - ipmi + +# Specify the list of boot interfaces to load during service initialization. +kolla_ironic_enabled_boot_interfaces: + - pxe + +# Default boot interface to be used for nodes that do not have boot_interface +# field set. +kolla_ironic_default_boot_interface: pxe + +# Specify the list of console interfaces to load during service initialization. +kolla_ironic_enabled_console_interfaces: + - ipmitool-socat + - no-console + +# Default console interface to be used for nodes that do not have +# console_interface field set. +kolla_ironic_default_console_interface: ipmitool-socat + +# Specify the list of deploy interfaces to load during service initialization. +kolla_ironic_enabled_deploy_interfaces: + - direct + - iscsi + +# Default deploy interface to be used for nodes that do not have +# deploy_interface field set. +kolla_ironic_default_deploy_interface: iscsi + +# Specify the list of inspect interfaces to load during service initialization. +kolla_ironic_enabled_inspect_interfaces: + - inspector + - no-inspect + +# Default inspect interface to be used for nodes that do not have +# inspect_interface field set. +kolla_ironic_default_inspect_interface: inspector + +# Specify the list of management interfaces to load during service +# initialization. +kolla_ironic_enabled_management_interfaces: + - ipmitool + +# Default management interface to be used for nodes that do not have +# management_interface field set. +kolla_ironic_default_management_interface: ipmitool + +# Specify the list of network interfaces to load during service initialization. +kolla_ironic_enabled_network_interfaces: + - noop + - flat + - neutron + +# Default network interface to be used for nodes that do not have +# network_interface field set. +kolla_ironic_default_network_interface: neutron + +# Specify the list of power interfaces to load during service initialization. +kolla_ironic_enabled_power_interfaces: + - ipmitool + +# Default power interface to be used for nodes that do not have power_interface +# field set. +kolla_ironic_default_power_interface: ipmitool + +# Specify the list of raid interfaces to load during service initialization. +kolla_ironic_enabled_raid_interfaces: + - agent + - no-raid + +# Default raid interface to be used for nodes that do not have +# raid_interface field set. +kolla_ironic_default_raid_interface: no-raid + +# Specify the list of storage interfaces to load during +# service initialization. +#kolla_ironic_enabled_storage_interfaces: + +# Default storage interface to be used for nodes that do not +# have storage_interface field set. +#kolla_ironic_default_storage_interface: + +# Specify the list of vendor interfaces to load during service initialization. +kolla_ironic_enabled_vendor_interfaces: + - no-vendor + +# Default vendor interface to be used for nodes that do not have +# vendor_interface field set. +kolla_ironic_default_vendor_interface: no-vendor + +# Default boot option to use when no boot option is requested in node's +# driver_info. +kolla_ironic_default_boot_option: local + # Name of the Neutron network to use for cleaning. kolla_ironic_cleaning_network: 'provision-net' # Name of the Neutron network to use for provisioning. kolla_ironic_provisioning_network: 'provision-net' + +# List of default kernel parameters to append for baremetal PXE boot. +kolla_ironic_pxe_append_params_default: + - nofb + - nomodeset + - vga=normal + - console=tty0 + - console=ttyS0,115200n8 + +# List of additional kernel parameters to append for baremetal PXE boot. +kolla_ironic_pxe_append_params_extra: [] + +# List of kernel parameters to append for baremetal PXE boot. +kolla_ironic_pxe_append_params: > + {{ kolla_ironic_pxe_append_params_default + + kolla_ironic_pxe_append_params_extra }} diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml index 746aef5a5..bf10e3e94 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -12,12 +12,94 @@ kolla_ironic_drivers: - pxe_ssh - pxe_ipmitool +# Specify the list of hardware types to load during service initialization. +kolla_ironic_enabled_hardware_types: [] + +# Specify the list of boot interfaces to load during service initialization. +kolla_ironic_enabled_boot_interfaces: [] + +# Default boot interface to be used for nodes that do not have boot_interface +# field set. +kolla_ironic_default_boot_interface: + +# Specify the list of console interfaces to load during service initialization. +kolla_ironic_enabled_console_interfaces: [] + +# Default console interface to be used for nodes that do not have +# console_interface field set. +kolla_ironic_default_console_interface: + +# Specify the list of deploy interfaces to load during service initialization. +kolla_ironic_enabled_deploy_interfaces: [] + +# Default deploy interface to be used for nodes that do not have +# deploy_interface field set. +kolla_ironic_default_deploy_interface: + +# Specify the list of inspect interfaces to load during service initialization. +kolla_ironic_enabled_inspect_interfaces: [] + +# Default inspect interface to be used for nodes that do not have +# inspect_interface field set. +kolla_ironic_default_inspect_interface: + +# Specify the list of management interfaces to load during service +# initialization. +kolla_ironic_enabled_management_interfaces: [] + +# Default management interface to be used for nodes that do not have +# management_interface field set. +kolla_ironic_default_management_interface: + +# Specify the list of network interfaces to load during service initialization. +kolla_ironic_enabled_network_interfaces: [] + +# Default network interface to be used for nodes that do not have +# network_interface field set. +kolla_ironic_default_network_interface: + +# Specify the list of power interfaces to load during service initialization. +kolla_ironic_enabled_power_interfaces: [] + +# Default power interface to be used for nodes that do not have power_interface +# field set. +kolla_ironic_default_power_interface: + +# Specify the list of raid interfaces to load during service initialization. +kolla_ironic_enabled_raid_interfaces: [] + +# Default raid interface to be used for nodes that do not have +# raid_interface field set. +kolla_ironic_default_raid_interface: + +# Specify the list of storage interfaces to load during +# service initialization. +kolla_ironic_enabled_storage_interfaces: [] + +# Default storage interface to be used for nodes that do not +# have storage_interface field set. +kolla_ironic_default_storage_interface: + +# Specify the list of vendor interfaces to load during service initialization. +kolla_ironic_enabled_vendor_interfaces: [] + +# Default vendor interface to be used for nodes that do not have +# vendor_interface field set. +kolla_ironic_default_vendor_interface: + +# Default boot option to use when no boot option is requested in node's +# driver_info. +kolla_ironic_default_boot_option: + # Name or UUID of the Neutron network to use for cleaning. kolla_ironic_cleaning_network: # Name or UUID of the Neutron network to use for provisioning. kolla_ironic_provisioning_network: +# List of additional append parameters for baremetal PXE boot. +kolla_ironic_pxe_append_params: [] + # Free form extra configuration to append to ironic.conf. kolla_extra_ironic: diff --git a/ansible/roles/kolla-openstack/templates/ironic.conf.j2 b/ansible/roles/kolla-openstack/templates/ironic.conf.j2 index 2b6d84a15..0f9d9531c 100644 --- a/ansible/roles/kolla-openstack/templates/ironic.conf.j2 +++ b/ansible/roles/kolla-openstack/templates/ironic.conf.j2 @@ -3,19 +3,44 @@ [DEFAULT] enabled_drivers = {{ kolla_ironic_drivers | join(',') }} +{% if kolla_ironic_enabled_hardware_types %} +enabled_hardware_types: {{ kolla_ironic_enabled_hardware_types | join(',') }} +{% endif %} + +{# Add configuration of enabled and default dynamic driver interfaces. #} +{% set interfaces=['boot', 'console', 'deploy', 'inspect', 'management', + 'network', 'power', 'raid', 'storage', 'vendor'] %} +{% for interface in interfaces %} +{% if hostvars[inventory_hostname]['kolla_ironic_enabled_' ~ interface ~ '_interfaces'] | default %} +{{ 'enabled_' ~ interface ~ '_interfaces' }} = {{ hostvars[inventory_hostname]['kolla_ironic_enabled_' ~ interface ~ '_interfaces'] | join(',') }} +{% endif %} +{% if hostvars[inventory_hostname]['kolla_ironic_default_' ~ interface ~ '_interface'] | default %} +{{ 'default_' ~ interface ~ '_interface' }} = {{ hostvars[inventory_hostname]['kolla_ironic_default_' ~ interface ~ '_interface'] }} +{% endif %} +{% endfor %} + +[agent] +deploy_logs_local_path = /var/log/kolla/ironic/deploy + [conductor] {% raw %} api_url = {{ internal_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + provision_interface | replace('-', '_')]['ipv4']['address'] }}:{{ ironic_api_port }} {% endraw %} -[agent] -deploy_logs_local_path = /var/log/kolla/ironic/deploy +[deploy] +{% if kolla_ironic_default_boot_option %} +default_boot_option = {{ kolla_ironic_default_boot_option }} +{% endif %} [neutron] cleaning_network = {{ kolla_ironic_cleaning_network }} provisioning_network = {{ kolla_ironic_provisioning_network }} [pxe] +{% if kolla_ironic_pxe_append_params %} +pxe_append_params = {{ kolla_ironic_pxe_append_params | join(',') }} +{% endif %} + {% raw %} tftp_server = {{ hostvars[inventory_hostname]['ansible_' + provision_interface | replace('-', '_')]['ipv4']['address'] }} {% endraw %} diff --git a/etc/kayobe/ironic.yml b/etc/kayobe/ironic.yml index 6d9a3c526..59f1d3e37 100644 --- a/etc/kayobe/ironic.yml +++ b/etc/kayobe/ironic.yml @@ -5,12 +5,100 @@ # List of enabled Ironic drivers. #kolla_ironic_drivers: +# Specify the list of hardware types to load during service initialization. +#kolla_ironic_enabled_hardware_types: + +# Specify the list of boot interfaces to load during service initialization. +#kolla_ironic_enabled_boot_interfaces: + +# Default boot interface to be used for nodes that do not have boot_interface +# field set. +#kolla_ironic_default_boot_interface: + +# Specify the list of console interfaces to load during service initialization. +#kolla_ironic_enabled_console_interfaces: + +# Default console interface to be used for nodes that do not have +# console_interface field set. +#kolla_ironic_default_console_interface: + +# Specify the list of deploy interfaces to load during service initialization. +#kolla_ironic_enabled_deploy_interfaces: + +# Default deploy interface to be used for nodes that do not have +# deploy_interface field set. +#kolla_ironic_default_deploy_interface: + +# Specify the list of inspect interfaces to load during service initialization. +#kolla_ironic_enabled_inspect_interfaces: + +# Default inspect interface to be used for nodes that do not have +# inspect_interface field set. +#kolla_ironic_default_inspect_interface: + +# Specify the list of management interfaces to load during service +# initialization. +#kolla_ironic_enabled_management_interfaces: + +# Default management interface to be used for nodes that do not have +# management_interface field set. +#kolla_ironic_default_management_interface: + +# Specify the list of network interfaces to load during service initialization. +#kolla_ironic_enabled_network_interfaces: + +# Default network interface to be used for nodes that do not have +# network_interface field set. +#kolla_ironic_default_network_interface: + +# Specify the list of power interfaces to load during service initialization. +#kolla_ironic_enabled_power_interfaces: + +# Default power interface to be used for nodes that do not have power_interface +# field set. +#kolla_ironic_default_power_interface: + +# Specify the list of raid interfaces to load during service initialization. +#kolla_ironic_enabled_raid_interfaces: + +# Default raid interface to be used for nodes that do not have +# raid_interface field set. +#kolla_ironic_default_raid_interface: + +# Specify the list of storage interfaces to load during +# service initialization. +#kolla_ironic_enabled_storage_interfaces: + +# Default storage interface to be used for nodes that do not +# have storage_interface field set. +#kolla_ironic_default_storage_interface: + +# Specify the list of vendor interfaces to load during service initialization. +#kolla_ironic_enabled_vendor_interfaces: + +# Default vendor interface to be used for nodes that do not have +# vendor_interface field set. +#kolla_ironic_default_vendor_interface: + +# Default boot option to use when no boot option is requested in node's +# driver_info. +#kolla_ironic_default_boot_option: + # Name of the Neutron network to use for cleaning. #kolla_ironic_cleaning_network: # Name of the Neutron network to use for provisioning. #kolla_ironic_provisioning_network: +# List of default kernel parameters to append for baremetal PXE boot. +#kolla_ironic_pxe_append_params_default: + +# List of additional kernel parameters to append for baremetal PXE boot. +#kolla_ironic_pxe_append_params_extra: + +# List of kernel parameters to append for baremetal PXE boot. +#kolla_ironic_pxe_append_params: + ############################################################################### # Dummy variable to allow Ansible to accept this file. workaround_ansible_issue_8743: yes