-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathper-mac-config.yml
28 lines (25 loc) · 918 Bytes
/
per-mac-config.yml
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
- name: Configure a Boot Image For a Specific MAC Address
hosts: all
become: true
vars:
path_prefix: /var/ftp/pub/pxe/tftpboot
boot_mode: BIOS
architecture: x86_64
mac_prefix: "01"
pxe_menu_title: "PER MAC AUTO BOOT"
distro_family: "rhel"
tasks:
- name: Template the shared menu defaults
ansible.builtin.template:
src: templates/pxelinux-menu-defaults.cfg.j2
dest: "{{ path_prefix }}/{{ boot_mode }}/{{ architecture }}/pxelinux.cfg/pxe-menu-defaults.cfg"
mode: 0644
owner: nobody
group: nobody
- name: Template the pxelinux config for the MAC address
ansible.builtin.template:
src: templates/pxelinux.cfg.j2
dest: "{{ path_prefix }}/{{ boot_mode }}/{{ architecture }}/pxelinux.cfg/{{ mac_prefix }}-{{ mac_address | regex_replace('[:]', '-') }}"
mode: 0644
owner: nobody
group: nobody