Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DNS or GW for use by dnsmasq #389

Merged
merged 1 commit into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ The following environment variables can be passed in to customize run-time funct
- OS_<section>_\_<name>=<value> - This format can be used to set arbitary ironic config options
- IRONIC_RAMDISK_SSH_KEY - A public key to allow ssh access to nodes running IPA, takes the format "ssh-rsa AAAAB3....."
- IRONIC_KERNEL_PARAMS - This parameter can be used to add additional kernel parameters to nodes running IPA
- GATEWAY_IP - gateway IP address to use for ironic dnsmasq(dhcpd)
- DNS_IP - DNS IP address to use for ironic dnsmasq(dhcpd)

The ironic configuration can be overridden by various environment variables. The following can serve as an example:
- OS_CONDUCTOR__DEPLOY_CALLBACK_TIMEOUT=4800 - timeout (seconds) to wait for a callback from a deploy ramdisk
Expand Down
24 changes: 22 additions & 2 deletions ironic-config/dnsmasq.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ port={{ env.DNS_PORT }}
log-dhcp
dhcp-range={{ env.DHCP_RANGE }}

# Disable default router(s) and DNS over provisioning network
# It can be used when setting DNS or GW variables.
{%- if env["GATEWAY_IP"] is undefined %}
# Disable default router(s)
dhcp-option=3
{% else %}
dhcp-option=3,{{ env["GATEWAY_IP"] }}
{% endif %}
{%- if env["DNS_IP"] is undefined %}
# Disable DNS over provisioning network
dhcp-option=6
{% else %}
dhcp-option=6,{{ env["DNS_IP"] }}
{% endif %}

{%- if env.IPV == "4" or env.IPV is undefined %}
# IPv4 Configuration:
Expand Down Expand Up @@ -42,8 +52,18 @@ dhcp-userclass=set:ipxe6,iPXE
dhcp-option=tag:pxe6,option6:bootfile-url,tftp://{{ env.IRONIC_URL_HOST }}/snponly.efi
dhcp-option=tag:ipxe6,option6:bootfile-url,http://{{ env.IRONIC_URL_HOST }}:{{ env.HTTP_PORT }}/boot.ipxe

# Disable default router(s) and DNS over provisioning network
# It can be used when setting DNS or GW variables.
{%- if env["GATEWAY_IP"] is undefined %}
# Disable default router(s)
dhcp-option=3
{% else %}
dhcp-option=3,{{ env["GATEWAY_IP"] }}
{% endif %}
{%- if env["DNS_IP"] is undefined %}
# Disable DNS over provisioning network
dhcp-option=6
{% else %}
dhcp-option=6,{{ env["DNS_IP"] }}
{% endif %}
{% endif %}
{% endif %}
4 changes: 4 additions & 0 deletions scripts/rundnsmasq
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ DNSMASQ_EXCEPT_INTERFACE=${DNSMASQ_EXCEPT_INTERFACE:-"lo"}
export DNS_PORT=${DNS_PORT:-0}

wait_for_interface_or_ip
if [[ "${DNS_IP:-}" == "provisioning" ]]; then
export DNS_IP=$IRONIC_IP
fi

Comment on lines +10 to +13
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dtantsur
added it, but I don't know if it can act as an 'ironic' dns.


mkdir -p /shared/tftpboot
mkdir -p /shared/html/images
Expand Down