Merge "Add iPXE support to Ironic Conductor"
This commit is contained in:
commit
af9cf08525
@ -114,8 +114,8 @@ ironic_service_in_ldap: False
|
|||||||
# config file. If this is set to False, then Ironic will use
|
# config file. If this is set to False, then Ironic will use
|
||||||
# Swift to host the floppy images and generated boot_iso.
|
# Swift to host the floppy images and generated boot_iso.
|
||||||
ironic_enable_web_server_for_images: False
|
ironic_enable_web_server_for_images: False
|
||||||
ironic_http_url: null
|
ironic_http_url: "{{ ironic_ipxe_proto }}://{{ ansible_host }}:{{ ironic_ipxe_port }}"
|
||||||
ironic_http_root: null
|
ironic_http_root: "/httpboot"
|
||||||
#
|
#
|
||||||
### Swift Config
|
### Swift Config
|
||||||
#
|
#
|
||||||
@ -320,6 +320,10 @@ ironic_inspector_db_pool_timeout: 30
|
|||||||
|
|
||||||
ironic_inspector_pip_install_args: "{{ pip_install_options | default('') }}"
|
ironic_inspector_pip_install_args: "{{ pip_install_options | default('') }}"
|
||||||
|
|
||||||
|
# Ironic iPXE support
|
||||||
|
ironic_ipxe_enabled: False
|
||||||
|
ironic_ipxe_port: 8051
|
||||||
|
ironic_ipxe_proto: "http"
|
||||||
|
|
||||||
# Auth
|
# Auth
|
||||||
ironic_inspector_service_user_name: "ironic_inspector"
|
ironic_inspector_service_user_name: "ironic_inspector"
|
||||||
|
@ -52,3 +52,16 @@
|
|||||||
name: "dnsmasq"
|
name: "dnsmasq"
|
||||||
state: restarted
|
state: restarted
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
|
- name: Restart web server
|
||||||
|
service:
|
||||||
|
name: "nginx"
|
||||||
|
enabled: yes
|
||||||
|
state: restarted
|
||||||
|
daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}"
|
||||||
|
register: _restart
|
||||||
|
until: _restart is success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
listen:
|
||||||
|
- "venv changed"
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- New variables have been added to allow a deployer to enable
|
||||||
|
iPXE support for Ironic Conductor, which uses HTTP rather
|
||||||
|
than TFTP, and can speed up baremetal provisioning considerably.
|
||||||
|
To enable, simply set the ``ironic_ipxe_enabled`` override to ``True``.
|
@ -66,4 +66,48 @@
|
|||||||
service:
|
service:
|
||||||
name: "{{ ironic_tftpd_service_name }}"
|
name: "{{ ironic_tftpd_service_name }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
- name: Disable default nginx configuration
|
||||||
|
file:
|
||||||
|
path: /etc/nginx/sites-enabled/default
|
||||||
|
state: absent
|
||||||
|
when: "ironic_ipxe_enabled | bool"
|
||||||
|
notify:
|
||||||
|
- Restart web server
|
||||||
|
|
||||||
|
- name: Remove default nginx config
|
||||||
|
file:
|
||||||
|
path: /etc/nginx/conf.d/default.conf
|
||||||
|
state: absent
|
||||||
|
when: "ironic_ipxe_enabled | bool"
|
||||||
|
notify:
|
||||||
|
- Restart web server
|
||||||
|
|
||||||
|
- name: Ensure nginx configuration directories exist
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
when: "ironic_ipxe_enabled | bool"
|
||||||
|
with_items:
|
||||||
|
- "/etc/nginx/{{ ironic_nginx_conf_path }}"
|
||||||
|
- "/etc/nginx/conf.d"
|
||||||
|
|
||||||
|
- name: Configure nginx virtual hosts
|
||||||
|
template:
|
||||||
|
src: ironic-ipxe.conf.j2
|
||||||
|
dest: "/etc/nginx/{{ ironic_nginx_conf_path }}/ironic-ipxe.conf"
|
||||||
|
when: "ironic_ipxe_enabled | bool"
|
||||||
|
notify:
|
||||||
|
- Restart web server
|
||||||
|
|
||||||
|
- name: Link to enable nginx virtual hosts
|
||||||
|
file:
|
||||||
|
src: "/etc/nginx/sites-available/ironic-ipxe.conf"
|
||||||
|
path: "/etc/nginx/sites-enabled/ironic-ipxe.conf"
|
||||||
|
state: link
|
||||||
|
when:
|
||||||
|
- ansible_os_family == "Debian"
|
||||||
|
- "ironic_ipxe_enabled | bool"
|
||||||
|
notify:
|
||||||
|
- Restart web server
|
||||||
|
17
templates/ironic-ipxe.conf.j2
Normal file
17
templates/ironic-ipxe.conf.j2
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 0.0.0.0:{{ ironic_ipxe_port }};
|
||||||
|
server_name ironic-ipxe;
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
access_log /var/log/nginx/ironic-ipxe.access.log combined gzip buffer=32k;
|
||||||
|
error_log /var/log/nginx/ironix-ipxe.error.log notice;
|
||||||
|
|
||||||
|
# directory to store ipxe
|
||||||
|
location / {
|
||||||
|
root /httpboot;
|
||||||
|
autoindex off;
|
||||||
|
expires 1h;
|
||||||
|
}
|
||||||
|
}
|
@ -24,6 +24,10 @@ enabled_inspect_interfaces = {{ filtered_ironic_drivers | json_query('[*].inspec
|
|||||||
enabled_management_interfaces = {{ filtered_ironic_drivers | json_query('[*].management') | unique | join(',') }}
|
enabled_management_interfaces = {{ filtered_ironic_drivers | json_query('[*].management') | unique | join(',') }}
|
||||||
enabled_power_interfaces = {{ filtered_ironic_drivers | json_query('[*].power') | unique | join(',') }}
|
enabled_power_interfaces = {{ filtered_ironic_drivers | json_query('[*].power') | unique | join(',') }}
|
||||||
|
|
||||||
|
# Ironic boot interface (defaults to None)
|
||||||
|
{% if ironic_ipxe_enabled | bool %}
|
||||||
|
default_boot_interface = ipxe
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
[agent]
|
[agent]
|
||||||
|
|
||||||
@ -185,6 +189,13 @@ pool_max_size = {{ ironic_wsgi_processes }}
|
|||||||
[oslo_policy]
|
[oslo_policy]
|
||||||
|
|
||||||
[pxe]
|
[pxe]
|
||||||
|
{% if ironic_ipxe_enabled | bool %}
|
||||||
|
pxe_bootfile_name = undionly.kpxe
|
||||||
|
uefi_pxe_bootfile_name = ipxe.efi
|
||||||
|
pxe_config_template = $pybasedir/drivers/modules/ipxe_config.template
|
||||||
|
uefi_pxe_config_template = $pybasedir/drivers/modules/ipxe_config.template
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
tftp_server = {{ ironic_tftp_server_address }}
|
tftp_server = {{ ironic_tftp_server_address }}
|
||||||
pxe_append_params = {{ ironic_pxe_append_params }}
|
pxe_append_params = {{ ironic_pxe_append_params }}
|
||||||
tftp_root = {{ ironic_tftpd_root }}
|
tftp_root = {{ ironic_tftpd_root }}
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
|
{% if not ironic_ipxe_enabled | bool %}
|
||||||
re ^({{ ironic_tftpd_root }}/) {{ ironic_tftpd_root }}/\2
|
re ^({{ ironic_tftpd_root }}/) {{ ironic_tftpd_root }}/\2
|
||||||
re ^{{ ironic_tftpd_root }}/ {{ ironic_tftpd_root }}/
|
re ^{{ ironic_tftpd_root }}/ {{ ironic_tftpd_root }}/
|
||||||
re ^(^/) {{ ironic_tftpd_root }}/\1
|
re ^(^/) {{ ironic_tftpd_root }}/\1
|
||||||
re ^([^/]) {{ ironic_tftpd_root }}/\1
|
re ^([^/]) {{ ironic_tftpd_root }}/\1
|
||||||
|
{% else %}
|
||||||
|
r ^([^/]) {{ ironic_tftpd_root }}/\1
|
||||||
|
r ^({{ ironic_tftpd_root }}/) {{ ironic_tftpd_root }}/\2
|
||||||
|
{% endif %}
|
||||||
|
@ -37,6 +37,8 @@ ironic_conductor_distro_packages:
|
|||||||
- ipmitool
|
- ipmitool
|
||||||
- tftpd-hpa
|
- tftpd-hpa
|
||||||
- gdisk
|
- gdisk
|
||||||
|
- ipxe
|
||||||
|
- nginx
|
||||||
|
|
||||||
ironic_conductor_standalone_distro_packages:
|
ironic_conductor_standalone_distro_packages:
|
||||||
- isc-dhcp-server
|
- isc-dhcp-server
|
||||||
@ -45,6 +47,8 @@ ironic_library_modules_paths:
|
|||||||
- "/usr/lib/PXELINUX/pxelinux.0"
|
- "/usr/lib/PXELINUX/pxelinux.0"
|
||||||
- "/usr/lib/syslinux/modules/efi64/chain.c32"
|
- "/usr/lib/syslinux/modules/efi64/chain.c32"
|
||||||
- "/usr/lib/syslinux/modules/bios/ldlinux.c32"
|
- "/usr/lib/syslinux/modules/bios/ldlinux.c32"
|
||||||
|
- "/usr/lib/ipxe/undionly.kpxe"
|
||||||
|
- "/usr/lib/ipxe/ipxe.efi"
|
||||||
|
|
||||||
ironic_tftpd_service_name: tftpd-hpa
|
ironic_tftpd_service_name: tftpd-hpa
|
||||||
ironic_tftpd_root: /tftpboot
|
ironic_tftpd_root: /tftpboot
|
||||||
@ -84,3 +88,5 @@ ironic_inspector_library_modules_paths:
|
|||||||
- "/usr/lib/syslinux/modules/efi64/chain.c32"
|
- "/usr/lib/syslinux/modules/efi64/chain.c32"
|
||||||
- "/usr/lib/syslinux/modules/bios/ldlinux.c32"
|
- "/usr/lib/syslinux/modules/bios/ldlinux.c32"
|
||||||
- "/usr/lib/syslinux/modules/efi64/ldlinux.e64"
|
- "/usr/lib/syslinux/modules/efi64/ldlinux.e64"
|
||||||
|
|
||||||
|
ironic_nginx_conf_path: "sites-available"
|
||||||
|
@ -311,7 +311,11 @@ uwsgi_ironic_services: |-
|
|||||||
{{ services }}
|
{{ services }}
|
||||||
|
|
||||||
filtered_ironic_drivers: |-
|
filtered_ironic_drivers: |-
|
||||||
|
{% if ironic_ipxe_enabled | bool %}
|
||||||
|
{% set concat_drivers = [{'boot': 'ipxe'}] %}
|
||||||
|
{% else %}
|
||||||
{% set concat_drivers = [] %}
|
{% set concat_drivers = [] %}
|
||||||
|
{% endif %}
|
||||||
{% for driver in ironic_drivers_enabled %}
|
{% for driver in ironic_drivers_enabled %}
|
||||||
{% if driver in ironic_driver_types.keys() %}
|
{% if driver in ironic_driver_types.keys() %}
|
||||||
{% set _ = concat_drivers.append(ironic_driver_types[driver]) %}
|
{% set _ = concat_drivers.append(ironic_driver_types[driver]) %}
|
||||||
|
@ -35,6 +35,8 @@ ironic_conductor_distro_packages:
|
|||||||
- ipmitool
|
- ipmitool
|
||||||
- tftp-server
|
- tftp-server
|
||||||
- gdisk
|
- gdisk
|
||||||
|
- ipxe-bootimgs
|
||||||
|
- nginx
|
||||||
|
|
||||||
ironic_conductor_standalone_distro_packages:
|
ironic_conductor_standalone_distro_packages:
|
||||||
- isc-dhcp-server
|
- isc-dhcp-server
|
||||||
@ -43,6 +45,8 @@ ironic_library_modules_paths:
|
|||||||
- "/usr/share/syslinux/pxelinux.0"
|
- "/usr/share/syslinux/pxelinux.0"
|
||||||
- "/usr/share/syslinux/chain.c32"
|
- "/usr/share/syslinux/chain.c32"
|
||||||
- "/usr/share/syslinux/linux.c32"
|
- "/usr/share/syslinux/linux.c32"
|
||||||
|
- "/usr/share/ipxe/undionly.kpxe"
|
||||||
|
- "/usr/share/ipxe/ipxe-x86_64.efi"
|
||||||
|
|
||||||
ironic_tftpd_service_name: tftp
|
ironic_tftpd_service_name: tftp
|
||||||
ironic_tftpd_root: /var/lib/tftpboot
|
ironic_tftpd_root: /var/lib/tftpboot
|
||||||
@ -72,3 +76,5 @@ ironic_inspector_library_modules_paths:
|
|||||||
- "/usr/lib/syslinux/modules/bios/ldlinux.c32"
|
- "/usr/lib/syslinux/modules/bios/ldlinux.c32"
|
||||||
- "/usr/lib/SYSLINUX.EFI/efi64/syslinux.efi"
|
- "/usr/lib/SYSLINUX.EFI/efi64/syslinux.efi"
|
||||||
- "/usr/lib/syslinux/modules/efi64/ldlinux.e64"
|
- "/usr/lib/syslinux/modules/efi64/ldlinux.e64"
|
||||||
|
|
||||||
|
ironic_nginx_conf_path: "conf.d"
|
||||||
|
@ -36,6 +36,7 @@ ironic_conductor_distro_packages:
|
|||||||
- syslinux
|
- syslinux
|
||||||
- tftp
|
- tftp
|
||||||
- gptfdisk
|
- gptfdisk
|
||||||
|
- nginx
|
||||||
|
|
||||||
ironic_conductor_standalone_distro_packages:
|
ironic_conductor_standalone_distro_packages:
|
||||||
- dhcp-server
|
- dhcp-server
|
||||||
@ -73,3 +74,5 @@ ironic_inspector_library_modules_paths:
|
|||||||
- "/usr/lib/syslinux/modules/bios/ldlinux.c32"
|
- "/usr/lib/syslinux/modules/bios/ldlinux.c32"
|
||||||
- "/usr/lib/SYSLINUX.EFI/efi64/syslinux.efi"
|
- "/usr/lib/SYSLINUX.EFI/efi64/syslinux.efi"
|
||||||
- "/usr/lib/syslinux/modules/efi64/ldlinux.e64"
|
- "/usr/lib/syslinux/modules/efi64/ldlinux.e64"
|
||||||
|
|
||||||
|
ironic_nginx_conf_path: "conf.d"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user