diff --git a/inventory/group_vars/all b/inventory/group_vars/all index 555fb58762..3388e07774 100644 --- a/inventory/group_vars/all +++ b/inventory/group_vars/all @@ -45,6 +45,9 @@ custom_rules: [] nat_rules: [] custom6_rules: [] +# defaults for hw installs +install_noc: none + # defaults for virt installs ks_url: http://infrastructure.fedoraproject.org/repo/rhel/ks/kvm-rhel-7 ks_repo: http://infrastructure.fedoraproject.org/repo/rhel/RHEL7-x86_64/ diff --git a/inventory/host_vars/virthost01.stg.phx2.fedoraproject.org b/inventory/host_vars/virthost01.stg.phx2.fedoraproject.org index ff86a10d32..89831a9add 100644 --- a/inventory/host_vars/virthost01.stg.phx2.fedoraproject.org +++ b/inventory/host_vars/virthost01.stg.phx2.fedoraproject.org @@ -8,3 +8,10 @@ br0_ip: 10.5.128.40 br0_nm: 255.255.255.0 br1_ip: 10.5.127.202 br1_nm: 255.255.255.0 + +install_noc: noc01.phx2.fedoraproject.org +install_mac: 24-6E-96-B1-C7-F4 +# Inside this, expect /vmlinuz and /initrd.img +install_binpath: /uefi/x86_64/el7 +install_ks: http://10.5.126.23/repo/rhel/ks/hardware-rhel-7-08disk +install_repo: http://10.5.126.23/http://10.5.126.23/repo/rhel/RHEL7-x86_64/ diff --git a/roles/tftp_server/tasks/main.yml b/roles/tftp_server/tasks/main.yml index df6d157e48..beacefe15c 100644 --- a/roles/tftp_server/tasks/main.yml +++ b/roles/tftp_server/tasks/main.yml @@ -40,3 +40,10 @@ synchronize: src="{{ bigfiles }}/tftpboot/" dest=/var/lib/tftpboot/ tags: - tftp_server + +- name: generate custom configs + template: src=grubhost.cfg dest="/var/lib/tftpboot/uefi/{{ item.install_mac }}" + with_items: groups['all'] + when: "hostvars[item].install_noc == ansible_inventory_hostname" + tags: + - tftp_server diff --git a/roles/tftp_server/templates/grubhost.cfg.j2 b/roles/tftp_server/templates/grubhost.cfg.j2 new file mode 100644 index 0000000000..b70cbf7b40 --- /dev/null +++ b/roles/tftp_server/templates/grubhost.cfg.j2 @@ -0,0 +1,28 @@ +set default="0" + +function load_video { + if [ x$feature_all_video_module = xy ]; then + insmod all_video + else + insmod efi_gop + insmod efi_uga + insmod ieee1275_fb + insmod vbe + insmod vga + insmod video_bochs + insmod video_cirrus + fi +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=5 + +menuentry 'Install {{ item }}' --class red --class gnu-linux --class gnu --class os { + linux {{ hostvars[item].install_binpath }}/vmlinuz ip=dhcp biosdevname=0 ksdevice=eth0 net.ifnames=0 ks={{ hostvars[item].install_ks }} inst.repo={{ hostvars[item].install_repo }} nomodeset + initrd {{ hostvars[item].install_binpath }}/initrd.img +}