Use template for Butane configs

This commit is contained in:
Khue Doan 2021-06-13 13:03:36 +07:00
parent 0157d25093
commit f1dc32c009
2 changed files with 5 additions and 10 deletions

View File

@ -47,15 +47,10 @@
src: tftp/tftpboot/grub.cfg.j2
dest: "{{ role_path }}/build/tftp/tftpboot/grub.cfg"
- name: Render shared kickstart config
- name: Render machine specific Butane config
template:
src: http/kickstart/fedora.ks.j2
dest: "{{ role_path }}/build/http/kickstart/fedora.ks"
- name: Render seperate network kickstart config for each node
template:
src: http/kickstart/network/network.ks.j2
dest: "{{ role_path }}/build/http/kickstart/network/{{ hostvars[item]['mac'] }}.ks"
src: http/ignition/ignition.yaml
dest: "{{ role_path }}/build/http/ignition/{{ hostvars[item]['mac'] }}.yaml"
loop: "{{ groups['metal'] }}"
- name: Start ephemeral PXE server

View File

@ -4,7 +4,7 @@ passwd:
users:
- name: core
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbqNJWKwLmwkeHQVUVT/pEis/wvRqRSKG9Dpl166NGp # TODO template
- {{ ssh_public_key }}
storage:
# Set hostname
@ -12,7 +12,7 @@ storage:
- path: /etc/hostname
mode: 0644
contents:
inline: metal3 # TODO template
inline: {{ hostvars[item]['inventory_hostname'] }}
# Set timezone
links:
- path: /etc/localtime