kolla-ansible/ansible/roles/ironic/templates/ironic-tftp.json.j2
yann.degat 81948f5b16 Use better default bind address for ironic-tftp
ironic tftp service binds on 0.0.0.0. This may be
an issue in some setup. This patch propose a better
default, such as using the same listen address as
the dnsmasq service

Closes-Bug: #2024664

Change-Id: I0401bfc03cd31d72c5a2ae0a111889d5c29a8aa2
2023-06-22 13:12:18 +00:00

47 lines
1.6 KiB
Django/Jinja

{% if enable_ironic_pxe_uefi | bool %}
{% if kolla_base_distro in ['debian', 'ubuntu'] %}
{% set pxe_dir = '/var/lib/ironic/tftpboot/grub' %}
{% elif kolla_base_distro in ['centos', 'rocky'] %}
{% set pxe_dir = '/var/lib/ironic/tftpboot/EFI/{{ kolla_base_distro }}' %}
{% endif %}
{% else %}
{% set pxe_dir = '/var/lib/ironic/tftpboot/pxelinux.cfg' %}
{% endif %}
{% set pxe_cfg = 'grub.cfg' if enable_ironic_pxe_uefi | bool else 'default' %}
{
"command": "/usr/sbin/in.tftpd --verbose --foreground --user nobody --address {{ ironic_tftp_listen_address }}:69 --map-file /map-file /var/lib/ironic/tftpboot",
"config_files": [
{% if not ironic_dnsmasq_serve_ipxe | bool and groups['ironic-inspector'] | length > 0 %}
{% if not enable_ironic_pxe_uefi | bool %}
{
"source": "{{ container_config_directory }}/ironic-agent.kernel",
"dest": "/var/lib/ironic/tftpboot/ironic-agent.kernel",
"owner": "root",
"perm": "0644"
},
{
"source": "{{ container_config_directory }}/ironic-agent.initramfs",
"dest": "/var/lib/ironic/tftpboot/ironic-agent.initramfs",
"owner": "root",
"perm": "0644"
},
{% endif %}
{
"source": "{{ container_config_directory }}/default",
"dest": "{{ pxe_dir }}/{{ pxe_cfg }}",
"owner": "root",
"perm": "0644"
}
{% endif %}
],
"permissions": [
{
"path": "{{ pxe_dir }}",
"owner": "ironic:ironic",
"recurse": true
}
]
}