diff --git a/ansible/kolla-ansible.yml b/ansible/kolla-ansible.yml index 5eaab07ab..4be1751b6 100644 --- a/ansible/kolla-ansible.yml +++ b/ansible/kolla-ansible.yml @@ -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 }}" diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index 19e0c23c7..a4409103e 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -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 } @@ -198,10 +197,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 }}" @@ -211,7 +206,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 }}" diff --git a/ansible/roles/kolla-ansible/defaults/main.yml b/ansible/roles/kolla-ansible/defaults/main.yml index bc0b1b0db..fc0bd9e32 100644 --- a/ansible/roles/kolla-ansible/defaults/main.yml +++ b/ansible/roles/kolla-ansible/defaults/main.yml @@ -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 diff --git a/ansible/roles/kolla-ansible/templates/globals.yml.j2 b/ansible/roles/kolla-ansible/templates/globals.yml.j2 index 6835ba163..1f722e5c7 100644 --- a/ansible/roles/kolla-ansible/templates/globals.yml.j2 +++ b/ansible/roles/kolla-ansible/templates/globals.yml.j2 @@ -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 diff --git a/ansible/roles/kolla-ansible/tests/test-defaults.yml b/ansible/roles/kolla-ansible/tests/test-defaults.yml index ebd2679a2..2439f8ccb 100644 --- a/ansible/roles/kolla-ansible/tests/test-defaults.yml +++ b/ansible/roles/kolla-ansible/tests/test-defaults.yml @@ -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: diff --git a/ansible/roles/kolla-ansible/tests/test-extras.yml b/ansible/roles/kolla-ansible/tests/test-extras.yml index bd052ae10..9678e8c3c 100644 --- a/ansible/roles/kolla-ansible/tests/test-extras.yml +++ b/ansible/roles/kolla-ansible/tests/test-extras.yml @@ -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 diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml index 301f96aa3..b42da3e91 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -246,21 +246,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. diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml index 64740f60a..858231c27 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml @@ -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] diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py index 6e0a3e32d..4e187c79c 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py @@ -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. diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml index 8946eeec0..04b567d33 100644 --- a/ansible/roles/kolla-openstack/tasks/config.yml +++ b/ansible/roles/kolla-openstack/tasks/config.yml @@ -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 }}" } diff --git a/ansible/roles/kolla-openstack/templates/ironic-dnsmasq.conf.j2 b/ansible/roles/kolla-openstack/templates/ironic-dnsmasq.conf.j2 deleted file mode 100644 index 6742c8359..000000000 --- a/ansible/roles/kolla-openstack/templates/ironic-dnsmasq.conf.j2 +++ /dev/null @@ -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 %} diff --git a/ansible/roles/kolla-openstack/vars/main.yml b/ansible/roles/kolla-openstack/vars/main.yml index f0ede72fc..793164f9c 100644 --- a/ansible/roles/kolla-openstack/vars/main.yml +++ b/ansible/roles/kolla-openstack/vars/main.yml @@ -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.