Merge "tftp: start on boot & fix tftp paths"
This commit is contained in:
commit
6e98f55b25
files
handlers
tasks
templates
vars
@ -1,4 +0,0 @@
|
|||||||
re ^(/tftpboot/) /tftpboot/\2
|
|
||||||
re ^/tftpboot/ /tftpboot/
|
|
||||||
re ^(^/) /tftpboot/\1
|
|
||||||
re ^([^/]) /tftpboot/\1
|
|
@ -23,10 +23,22 @@
|
|||||||
listen:
|
listen:
|
||||||
- "venv changed"
|
- "venv changed"
|
||||||
|
|
||||||
- name: Restart tftpd-hpa
|
- name: Restart tftpd socket
|
||||||
service:
|
service:
|
||||||
name: "tftpd-hpa"
|
name: "{{ ironic_tftpd_service_name }}.socket"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
||||||
|
failed_when: false
|
||||||
|
when:
|
||||||
|
- "ansible_pkg_mgr in ['zypper']"
|
||||||
|
|
||||||
|
- name: Restart tftpd
|
||||||
|
service:
|
||||||
|
name: "{{ ironic_tftpd_service_name }}"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Restart isc-dhcp-server
|
- name: Restart isc-dhcp-server
|
||||||
|
@ -21,9 +21,9 @@
|
|||||||
notify:
|
notify:
|
||||||
- Restart isc-dhcp-server
|
- Restart isc-dhcp-server
|
||||||
|
|
||||||
- name: Create /tftpboot
|
- name: Create tftpboot path
|
||||||
file:
|
file:
|
||||||
path: "/tftpboot"
|
path: "{{ ironic_tftpd_root }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ ironic_system_user_name }}"
|
owner: "{{ ironic_system_user_name }}"
|
||||||
group: "{{ ironic_system_group_name }}"
|
group: "{{ ironic_system_group_name }}"
|
||||||
@ -33,19 +33,37 @@
|
|||||||
template:
|
template:
|
||||||
src: "tftpd-hpa.j2"
|
src: "tftpd-hpa.j2"
|
||||||
dest: "/etc/default/tftpd-hpa"
|
dest: "/etc/default/tftpd-hpa"
|
||||||
|
when:
|
||||||
|
- ansible_os_family == 'Debian'
|
||||||
notify:
|
notify:
|
||||||
- Restart tftpd-hpa
|
- Restart tftpd
|
||||||
|
|
||||||
- name: Copy in tftpd-hpa map file
|
- name: Copy in tftpd map file
|
||||||
copy:
|
template:
|
||||||
src: "map-file"
|
src: "map-file"
|
||||||
dest: "/tftpboot/map-file"
|
dest: "{{ ironic_tftpd_root }}/map-file"
|
||||||
notify:
|
notify:
|
||||||
- Restart tftpd-hpa
|
- Restart tftpd
|
||||||
|
|
||||||
- name: Copy library modules into /tftpboot
|
- name: Copy library modules into tftpboot
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "/tftpboot/"
|
dest: "{{ ironic_tftpd_root }}/"
|
||||||
remote_src: True
|
remote_src: True
|
||||||
with_items: "{{ ironic_library_modules_paths }}"
|
with_items: "{{ ironic_library_modules_paths }}"
|
||||||
|
|
||||||
|
# Add 'yum' in condition if tftp socket required to be started for centos.
|
||||||
|
- name: Start up tftp socket
|
||||||
|
when:
|
||||||
|
- "ansible_pkg_mgr in ['zypper']"
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
name: "{{ ironic_tftpd_service_name }}.socket"
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
- name: Start up tftp
|
||||||
|
service:
|
||||||
|
name: "{{ ironic_tftpd_service_name }}"
|
||||||
|
state: started
|
||||||
|
enabled: true
|
@ -176,6 +176,8 @@ pool_max_size = {{ ironic_wsgi_processes }}
|
|||||||
[pxe]
|
[pxe]
|
||||||
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_master_path = {{ ironic_tftpd_root }}/master_images
|
||||||
|
|
||||||
[seamicro]
|
[seamicro]
|
||||||
|
|
||||||
|
4
templates/map-file
Normal file
4
templates/map-file
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
re ^({{ ironic_tftpd_root }}/) {{ ironic_tftpd_root }}/\2
|
||||||
|
re ^{{ ironic_tftpd_root }}/ {{ ironic_tftpd_root }}/
|
||||||
|
re ^(^/) {{ ironic_tftpd_root }}/\1
|
||||||
|
re ^([^/]) {{ ironic_tftpd_root }}/\1
|
@ -1,4 +1,4 @@
|
|||||||
TFTP_USERNAME="tftp"
|
TFTP_USERNAME="tftp"
|
||||||
TFTP_DIRECTORY="/tftpboot"
|
TFTP_DIRECTORY="{{ ironic_tftpd_root }}"
|
||||||
TFTP_ADDRESS="{{ ironic_tftp_server_address }}:69"
|
TFTP_ADDRESS="{{ ironic_tftp_server_address }}:69"
|
||||||
TFTP_OPTIONS="-vvvv --map-file /tftpboot/map-file"
|
TFTP_OPTIONS="-vvvv --map-file {{ ironic_tftpd_root }}/map-file"
|
||||||
|
@ -44,3 +44,6 @@ 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"
|
||||||
|
|
||||||
|
ironic_tftpd_service_name: tftpd-hpa
|
||||||
|
ironic_tftpd_root: /tftpboot
|
@ -44,3 +44,6 @@ 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"
|
||||||
|
|
||||||
|
ironic_tftpd_service_name: tftp
|
||||||
|
ironic_tftpd_root: /var/lib/tftpboot
|
@ -43,3 +43,6 @@ 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"
|
||||||
|
|
||||||
|
ironic_tftpd_service_name: tftp
|
||||||
|
ironic_tftpd_root: /srv/tftpboot
|
Loading…
x
Reference in New Issue
Block a user