From 1ddab8a2a4b1776fd07694734d06d3ffbce3777d Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Tue, 31 Aug 2021 05:11:42 +0700 Subject: [PATCH] Move dhcp and grub config to data --- metal/roles/pxe-server/files/data/pxe-config/.gitignore | 2 ++ metal/roles/pxe-server/files/docker-compose.yml | 4 ++-- metal/roles/pxe-server/tasks/main.yml | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 metal/roles/pxe-server/files/data/pxe-config/.gitignore diff --git a/metal/roles/pxe-server/files/data/pxe-config/.gitignore b/metal/roles/pxe-server/files/data/pxe-config/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/metal/roles/pxe-server/files/data/pxe-config/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/metal/roles/pxe-server/files/docker-compose.yml b/metal/roles/pxe-server/files/docker-compose.yml index 8cb7d340..c8814857 100644 --- a/metal/roles/pxe-server/files/docker-compose.yml +++ b/metal/roles/pxe-server/files/docker-compose.yml @@ -4,13 +4,13 @@ services: dhcp: build: ./dhcp volumes: - - ./dhcp/dhcpd.conf:/etc/dhcp/dhcpd.conf + - ./data/pxe-config/dhcpd.conf:/etc/dhcp/dhcpd.conf network_mode: host tftp: build: ./tftp network_mode: host volumes: - - ./tftp/grub.cfg:/var/lib/tftpboot/grub.cfg + - ./data/pxe-config/grub.cfg:/var/lib/tftpboot/grub.cfg - ./data/os/EFI/BOOT/grubx64.efi:/var/lib/tftpboot/grubx64.efi - ./data/os/images/pxeboot/initrd.img:/var/lib/tftpboot/initrd.img - ./data/os/images/pxeboot/vmlinuz:/var/lib/tftpboot/vmlinuz diff --git a/metal/roles/pxe-server/tasks/main.yml b/metal/roles/pxe-server/tasks/main.yml index 899bdcdb..c1d88e3f 100644 --- a/metal/roles/pxe-server/tasks/main.yml +++ b/metal/roles/pxe-server/tasks/main.yml @@ -13,12 +13,12 @@ - name: Render DHCP config template: src: dhcpd.conf.j2 - dest: "{{ role_path }}/files/dhcp/dhcpd.conf" + dest: "{{ role_path }}/files/data/pxe-config/dhcpd.conf" - name: Render GRUB config template: src: grub.cfg.j2 - dest: "{{ role_path }}/files/tftp/grub.cfg" + dest: "{{ role_path }}/files/data/pxe-config/grub.cfg" - name: Render machine specific init config template: