-
Notifications
You must be signed in to change notification settings - Fork 203
Expand file tree
/
Copy pathtftp.yml
More file actions
70 lines (59 loc) · 1.89 KB
/
tftp.yml
File metadata and controls
70 lines (59 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
- name: 'create the provisioning libvirt network'
community.libvirt.virt_net:
command: define
name: provision
xml: '{{ lookup("template", "../templates/network.xml.j2") }}'
# libvirt seems to have bug that it does not create the symlink even if the network was defined with auto provisioning
# so we ensure the symlink exists and network autostarts after reboot
- name: 'make provisioning network autostart on reboot'
file:
state: link
src: /etc/libvirt/qemu/networks/provision.xml
path: /etc/libvirt/qemu/networks/autostart/provision.xml
- name: 'create the provisioning storage'
community.libvirt.virt_pool:
command: define
name: provision
xml: '{{ lookup("template", "../templates/storage.xml.j2") }}'
# Setup TFTP for libvirt
- name: 'create /var/lib/tftpboot'
file:
path: /var/lib/tftpboot
state: directory
mode: '0755'
- name: 'create /var/lib/tftpboot/boot'
file:
path: /var/lib/tftpboot/boot
state: directory
mode: '0755'
- name: 'create /var/lib/tftpboot/pxelinux.cfg'
file:
path: /var/lib/tftpboot/pxelinux.cfg
state: directory
mode: '0755'
- name: 'install syslinux for tftp directory'
yum:
name: syslinux
state: present
- name: 'copy syslinux files to /var/lib/tftpboot'
shell: cp /usr/share/syslinux/{pxelinux.0,menu.c32,chain.c32} /var/lib/tftpboot
- name: 'chown /var/lib/tftpboot for foreman-proxy user'
file:
path: /var/lib/tftpboot
state: directory
owner: foreman-proxy
group: nobody
recurse: true
- name: 'setuid on /var/lib/tftpboot'
shell: set -o pipefail && find /var/lib/tftpboot/ -type d | xargs chmod g+s
- name: 'start the provision libvirt network'
community.libvirt.virt_net:
state: active
name: provision
autostart: yes
- name: 'start the provision libvirt storage pool'
community.libvirt.virt_pool:
state: active
name: provision
autostart: yes