Fix typos, add block size option

This commit is contained in:
Gabriel Adrian Samfira 2020-08-31 10:20:59 +00:00
parent 82102ccf3e
commit 3e7a5691e3
8 changed files with 32 additions and 10 deletions

View File

@ -58,5 +58,17 @@ options:
type: string
description: |
The API port ironic-api will listen on.
max-tftp-block-size:
default: 0
type: integer
description: |
The maximum block size to use in the TFTP server. Setting this option
to anything other than 0, will force the block size sent over TFTP to
the value specified here. Valid range is 512-65535. By default, clients
will negotiate the block size.
Use this option if you're running ironic in a network with lower
MTU. The value of this option should be 32 bits less than the MTU.
If your MTU is 1450, the value for this option should be 1418.

View File

@ -11,8 +11,8 @@ _IRONIC_GROUP = "ironic"
class PXEBootBase(object):
TFTP_ROOT = "/tftproot"
HTTP_ROOT = "/httproot"
TFTP_ROOT = "/tftpboot"
HTTP_ROOT = "/httpboot"
IPXE_BOOT = os.path.join(HTTP_ROOT, "boot.ipxe")
GRUB_DIR = os.path.join(TFTP_ROOT, "grub")
MAP_FILE = os.path.join(TFTP_ROOT, "map-file")
@ -30,7 +30,7 @@ class PXEBootBase(object):
"/usr/lib/ipxe/ipxe.efi": "ipxe.efi",
}
TFTP_PACKAGES = ["tftp-hpa"]
TFTP_PACKAGES = ["tftpd-hpa"]
PACKAGES = [
'syslinux-common',
'pxelinux',
@ -101,12 +101,14 @@ class PXEBootBase(object):
cfg_dir = os.path.dirname(self.TFTP_CONFIG)
if os.path.isdir(cfg_dir) is False:
raise Exception("Could not find %s" % cfg_dir)
render(source='tftp-hpa',
render(source='tftpd-hpa',
target=self.TFTP_CONFIG,
owner="root",
perms=0o644,
context={
"tftpboot": self.TFTP_ROOT,
"max_tftp_block_size": self._config.get(
"max_tftp_block_size", 0)
})
def configure_resources(self):

View File

@ -58,9 +58,9 @@ def assess_status():
def setup_endpoint(keystone):
charm = IronicAPICharm.singleton
public_ep = '{}/v1'.format(charm.public_url)
internal_ep = '{}/v1'.format(charm.internal_url)
admin_ep = '{}/v1'.format(charm.admin_url)
public_ep = '{}'.format(charm.public_url)
internal_ep = '{}'.format(charm.internal_url)
admin_ep = '{}'.format(charm.admin_url)
keystone.register_endpoints(charm.service_type,
charm.region,
public_ep,

View File

@ -4,4 +4,9 @@
TFTP_USERNAME="root"
TFTP_DIRECTORY="{{ tftpboot }}"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure -4 -v -v -v -v -v --map-file {{tftpboot}}/map-file"
{% if max_tftp_block_size != 0 %}
TFTP_OPTIONS="-4 -v -v -v -v -v --map-file {{tftpboot}}/map-file --blocksize {{ max_tftp_block_size }}"
{% else %}
TFTP_OPTIONS="-4 -v -v -v -v -v --map-file {{tftpboot}}/map-file"
{% endif %}

View File

@ -1,6 +1,9 @@
[pxe]
# Ironic compute node's tftp root path. (string value)
tftp_root=/tftpboot
{% if not tftpboot -%}
{% set tftpboot = "/tftpboot" -%}
{% endif -%}
tftp_root={{tftpboot}}
# IP address of Ironic compute node's tftp server. (string
# value)

View File

@ -9,7 +9,7 @@ enabled_boot_interfaces = pxe,ipxe,ilo-pxe,ilo-ipxe,irmc-pxe
{% else -%}
enabled_boot_interfaces = pxe,ilo-pxe,irmc-pxe
{% endif -%}
enabled_management_interfaces = ipmitool,redfish,ilo,irmc,idrac
enabled_management_interfaces = ipmitool,redfish,ilo,irmc,idrac,noop
enabled_inspect_interfaces = idrac,ilo,irmc,redfish,no-inspect
enabled_network_interfaces = flat,neutron
enabled_power_interfaces = ipmitool,redfish,ilo,irmc,idrac