Merge "Use kolla variable to set inspector DHCP config"

This commit is contained in:
Zuul 2018-11-06 10:41:01 +00:00 committed by Gerrit Code Review
commit 08937516d4
12 changed files with 27 additions and 64 deletions

View File

@ -256,3 +256,6 @@
# container.
# We could look at making the SELinux mode configurable in future.
kolla_selinux_state: disabled
kolla_inspector_dhcp_pool_start: "{{ inspection_net_name | net_inspection_allocation_pool_start }}"
kolla_inspector_dhcp_pool_end: "{{ inspection_net_name | net_inspection_allocation_pool_end }}"
kolla_inspector_default_gateway: "{{ inspection_net_name | net_inspection_gateway or inspection_net_name | net_gateway }}"

View File

@ -108,7 +108,6 @@
- { name: heat, file: heat.conf }
- { name: inspector, file: ironic-inspector.conf }
- { name: ironic, file: ironic.conf }
- { name: ironic_dnsmasq, file: ironic/ironic-dnsmasq.conf }
- { name: kafka, file: kafka.server.properties }
- { name: magnum, file: magnum.conf }
- { name: mariadb, file: galera.cnf }
@ -202,10 +201,6 @@
auth_type: token_endpoint
url: "http://{% raw %}{{ api_interface_address }}{% endraw %}:{{ inspector_store_port }}"
token: fake-token
# Ironic inspector's dnsmasq configuration.
kolla_inspector_dhcp_pool_start: "{{ inspection_net_name | net_inspection_allocation_pool_start }}"
kolla_inspector_dhcp_pool_end: "{{ inspection_net_name | net_inspection_allocation_pool_end }}"
kolla_inspector_default_gateway: "{{ inspection_net_name | net_inspection_gateway or inspection_net_name | net_gateway }}"
# Extra free-form user-provided configuration.
kolla_extra_ceph: "{{ kolla_extra_config.ceph | default }}"
kolla_extra_cinder: "{{ kolla_extra_config.cinder | default }}"
@ -215,7 +210,6 @@
kolla_extra_heat: "{{ kolla_extra_config.heat | default }}"
kolla_extra_inspector: "{{ kolla_extra_config.inspector | default }}"
kolla_extra_ironic: "{{ kolla_extra_config.ironic | default }}"
kolla_extra_ironic_dnsmasq: "{{ kolla_extra_config.ironic_dnsmasq | default }}"
kolla_extra_kafka: "{{ kolla_extra_config.kafka | default }}"
kolla_extra_magnum: "{{ kolla_extra_config.magnum | default }}"
kolla_extra_mariadb: "{{ kolla_extra_config.mariadb | default }}"

View File

@ -198,6 +198,17 @@ kolla_neutron_ml2_tenant_network_types: []
kolla_enable_tls_external:
kolla_external_fqdn_cert:
#############################
# Ironic options
#############################
# Start of range of IP addresses for dnsmasq to allocate from.
kolla_inspector_dhcp_pool_start:
# End of range of IP addresses for dnsmasq to allocate from.
kolla_inspector_dhcp_pool_end:
# Default gateway to use for inspection network.
kolla_inspector_default_gateway:
####################
# OpenStack options

View File

@ -287,7 +287,12 @@ enable_{{ feature_flag }}: {{ hostvars[inventory_hostname]['kolla_enable_' ~ fea
#############################
# Ironic options
#############################
#ironic_dnsmasq_dhcp_range:
{% if kolla_inspector_dhcp_pool_start is not none and kolla_inspector_dhcp_pool_end is not none %}
ironic_dnsmasq_dhcp_range: {{ kolla_inspector_dhcp_pool_start }},{{ kolla_inspector_dhcp_pool_end }}
{% endif %}
{% if kolla_inspector_default_gateway is not none %}
ironic_dnsmasq_default_gateway: {{ kolla_inspector_default_gateway }}
{% endif %}
######################################
# Manila - Shared File Systems Options

View File

@ -115,6 +115,8 @@
- bifrost_network_interface
- neutron_external_interface
- neutron_bridge_name
- ironic_dnsmasq_dhcp_range
- ironic_dnsmasq_default_gateway
- name: Check whether inventory files exist
stat:

View File

@ -94,6 +94,9 @@
kolla_external_fqdn_cert: "fake-cert"
kolla_openstack_logging_debug: True
grafana_local_admin_user_name: "grafana-admin"
kolla_inspector_dhcp_pool_start: "1.2.3.4"
kolla_inspector_dhcp_pool_end: "1.2.3.5"
kolla_inspector_default_gateway: "1.2.3.6"
# Enable everything.
kolla_enable_aodh: True
kolla_enable_barbican: True
@ -221,6 +224,8 @@
kolla_external_fqdn_cert: "fake-cert"
openstack_logging_debug: True
grafana_admin_username: "grafana-admin"
ironic_dnsmasq_dhcp_range: "1.2.3.4,1.2.3.5"
ironic_dnsmasq_default_gateway: "1.2.3.6"
# NOTE: The following options are not present in globals.yml.
# It's possible this is related to the use of hostvars and
# include_role, caused by something like

View File

@ -262,21 +262,6 @@ kolla_inspector_swift_auth: {}
# Free form extra configuration to append to ironic-inspector.conf.
kolla_extra_inspector:
###############################################################################
# Ironic inspector dnsmasq configuration.
# Start of range of IP addresses for dnsmasq to allocate from.
kolla_inspector_dhcp_pool_start:
# End of range of IP addresses for dnsmasq to allocate from.
kolla_inspector_dhcp_pool_end:
# IP address of default gateway to advertise via DHCP.
kolla_inspector_default_gateway:
# Free form extra configuration to append to dnsmasq.conf.
kolla_extra_ironic_dnsmasq:
###############################################################################
# Kafka configuration.

View File

@ -49,8 +49,6 @@ provisioner:
foo=bar
kolla_inspector_ipa_kernel_path: ${MOLECULE_TEMP_PATH:-/tmp}/ironic-agent.kernel
kolla_inspector_ipa_ramdisk_path: ${MOLECULE_TEMP_PATH:-/tmp}/ironic-agent.initramfs
kolla_extra_ironic_dnsmasq: |
extra=bar
kolla_enable_kafka: true
kolla_extra_kafka: |
[extra-kafka.server.properties]

View File

@ -86,7 +86,6 @@ def test_service_ini_file(host, path):
'path',
['ironic/ironic-agent.initramfs',
'ironic/ironic-agent.kernel',
'ironic/ironic-dnsmasq.conf',
'ironic/pxelinux.default'])
def test_service_non_ini_file(host, path):
# TODO(mgoddard): Check config file contents.

View File

@ -21,7 +21,6 @@
- { src: grafana.ini.j2, dest: grafana.ini, enabled: "{{ kolla_enable_grafana }}" }
- { src: heat.conf.j2, dest: heat.conf, enabled: "{{ kolla_enable_heat }}" }
- { src: ironic.conf.j2, dest: ironic.conf, enabled: "{{ kolla_enable_ironic }}" }
- { src: ironic-dnsmasq.conf.j2, dest: ironic/ironic-dnsmasq.conf, enabled: "{{ kolla_enable_ironic }}" }
- { src: ironic-inspector.conf.j2, dest: ironic-inspector.conf, enabled: "{{ kolla_enable_ironic }}" }
- { src: kafka.server.properties.j2, dest: kafka.server.properties, enabled: "{{ kolla_enable_kafka }}" }
- { src: magnum.conf.j2, dest: magnum.conf, enabled: "{{ kolla_enable_magnum }}" }

View File

@ -1,37 +0,0 @@
port=0
interface={% raw %}{{ ironic_dnsmasq_interface }}{% endraw %}
bind-interfaces
dhcp-range={{ kolla_inspector_dhcp_pool_start }},{{ kolla_inspector_dhcp_pool_end }},12h
dhcp-sequential-ip
dhcp-option=option:tftp-server,{% raw %}{{ hostvars[inventory_hostname]['ansible_' ~ api_interface | replace('-', '_')]['ipv4']['address'] }}{% endraw %}
dhcp-option=option:server-ip-address,{% raw %}{{ hostvars[inventory_hostname]['ansible_' ~ api_interface | replace('-', '_')]['ipv4']['address'] }}{% endraw %}
dhcp-option=210,/tftpboot/
{% if kolla_inspector_default_gateway %}
dhcp-option=3,{{ kolla_inspector_default_gateway }}
{% endif %}
{% raw %}{% if enable_ironic_ipxe | bool %}
dhcp-match=ipxe,175
dhcp-match=set:efi,option:client-arch,7
dhcp-match=set:efi,option:client-arch,9
# Client is already running iPXE; move to next stage of chainloading
dhcp-option=tag:ipxe,option:bootfile-name,{{ ironic_ipxe_url }}/inspector.ipxe
# Client is PXE booting over EFI without iPXE ROM,
# send EFI version of iPXE chainloader
dhcp-option=tag:efi,tag:!ipxe,option:bootfile-name,ipxe.efi
dhcp-option=option:bootfile-name,{{ ironic_dnsmasq_boot_file | default('undionly.kpxe') }}
{% else %}
dhcp-option=option:bootfile-name,{{ ironic_dnsmasq_boot_file | default('pxelinux.0') }}
{% endif %}{% endraw %}
{% raw %}{% if ironic_inspector_pxe_filter | default == 'dnsmasq' %}
dhcp-hostsdir=/etc/dnsmasq/dhcp-hostsdir
{% endif %}{% endraw %}
{% if kolla_extra_ironic_dnsmasq %}
{{ kolla_extra_ironic_dnsmasq }}
{% endif %}

View File

@ -78,7 +78,6 @@ kolla_openstack_custom_config:
# These are templated by kayobe, so don't remove them.
- ironic-agent.initramfs
- ironic-agent.kernel
- ironic-dnsmasq.conf
- pxelinux.default
- inspector.ipxe
# Kafka.