Compare commits

..

No commits in common. "f226b09f0a499f1c5e6d2d8bbe13c1d542eb8aee" and "537590d7992e8bf3b128f2fd1a836cd485730b91" have entirely different histories.

9 changed files with 19 additions and 67 deletions

View file

@ -1,5 +1,5 @@
ansible_ssh_private_key_file: ~/.ssh/id_rsa ansible_ssh_private_key_file: ~/.ssh/id_rsa
ssh_public_key: "{{ lookup('file', '~/.ssh/id_ed25519.pub') }}" ssh_public_key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
# Network config # Network config
subnet: "192.168.6.0" subnet: "192.168.6.0"

View file

@ -9,13 +9,8 @@
roles: roles:
- wol-wake - wol-wake
- name: Clean up PXE environment - name: Clean up playbook execution
hosts: localhost hosts: localhost
gather_facts: false gather_facts: false
roles: roles:
- pxe-cleanup - pxe-cleanup
- name: Configure networking
hosts: metal
roles:
- systemd-networkd

View file

@ -2,25 +2,9 @@ metal:
children: children:
masters: masters:
hosts: hosts:
lab-mini-1: lab-mini-1: {ansible_host: 192.168.6.21, mac: '4c:52:62:1c:bf:6c', disk: '/dev/sda'}
ansible_host: 192.168.6.21 lab-mini-2: {ansible_host: 192.168.6.22, mac: '4c:52:62:0f:09:6d', disk: '/dev/sda'}
mac: '4c:52:62:1c:bf:6c' lab-mini-3: {ansible_host: 192.168.6.23, mac: '4c:52:62:0f:0a:23', disk: '/dev/sda'}
disk: '/dev/nvme0n1'
ansible_become_pass: '{{ vault_ansible_become_password }}'
lab-mini-2:
ansible_host: 192.168.6.22
mac: '4c:52:62:0f:09:6d'
disk: '/dev/nvme0n1'
ansible_become_pass: '{{ vault_ansible_become_password }}'
lab-mini-3:
ansible_host: 192.168.6.23
mac: '4c:52:62:0f:0a:23'
disk: '/dev/nvme0n1'
ansible_become_pass: '{{ vault_ansible_become_password }}'
workers: workers:
hosts: hosts:
lab-mini-4: lab-mini-4: {ansible_host: 192.168.6.24, mac: '90:1b:0e:f8:e8:af', disk: '/dev/sda'}
ansible_host: 192.168.6.24
mac: '90:1b:0e:f8:e8:af'
disk: '/dev/nvme0n1'
ansible_become_pass: '{{ vault_ansible_become_password }}'

View file

@ -1,5 +1,8 @@
- name: Tear down PXE stack - name: Tear down PXE stack
ansible.builtin.command: "docker compose --project-name pxe down" docker_compose:
project_name: "pxe"
project_src: "{{ playbook_dir }}/roles/pxe-server/files/"
state: absent
- name: Remove preseed files - name: Remove preseed files
file: file:

View file

@ -1,2 +1,2 @@
os_download_url: "https://deb.debian.org/debian/dists/bullseye/main/installer-amd64/current/images/netboot/netboot.tar.gz" os_download_url: "https://deb.debian.org/debian/dists/bullseye/main/installer-amd64/current/images/netboot/netboot.tar.gz"
os_download_checksum: "sha256:e8edf26ac9837d7dbbcfd96f47f51530260a6c68568938978e1b63ea698d5663" os_download_checksum: "sha256:ec3b71964457f30a57061ea758c12394bf2b792b461c697e61cc2d47053c5878"

View file

@ -30,4 +30,9 @@
loop: "{{ groups['metal'] }}" loop: "{{ groups['metal'] }}"
- name: Start PXE stack - name: Start PXE stack
ansible.builtin.command: "docker compose --project-name pxe -f {{ role_path }}/files/docker-compose.yml up -d --build" docker_compose:
project_src: "{{ role_path }}/files"
project_name: "pxe"
state: present
restarted: true
build: true

View file

@ -1,28 +0,0 @@
- name: "Configure systemd-networkd"
become: true
block:
- name: "Render network config"
template:
src: default.network.j2
dest: "/etc/systemd/network/default.network"
mode: 0644
- name: "Enable systemd-networkd"
ansible.builtin.systemd:
name: systemd-networkd
enabled: true
- name: "Remove /etc/network"
ansible.builtin.file:
path: /etc/network
state: absent
- name: "Reboot with systemd-networkd configured"
ansible.builtin.reboot:
reboot_timeout: 180
- name: "Remove ifupdown"
ansible.builtin.apt:
name: ifupdown
state: absent
purge: true

View file

@ -1,7 +0,0 @@
[Match]
MACAddress={{ hostvars[inventory_hostname]['mac'] }}
[Network]
Address={{ hostvars[inventory_hostname]['ansible_host'] }}/{{ (hostvars[inventory_hostname]['ansible_host'] + '/' + netmask) | ansible.utils.ipaddr('prefix') }}
Gateway={{ gateway }}
DNS={{ nameserver }}

View file

@ -5,4 +5,4 @@
- name: Wait for machines to come online with installed OS - name: Wait for machines to come online with installed OS
wait_for_connection: wait_for_connection:
timeout: 900 timeout: 600