mirror of
https://github.com/BluemediaGER/homelab.git
synced 2024-11-23 03:15:29 +01:00
Compare commits
No commits in common. "f226b09f0a499f1c5e6d2d8bbe13c1d542eb8aee" and "537590d7992e8bf3b128f2fd1a836cd485730b91" have entirely different histories.
f226b09f0a
...
537590d799
|
@ -1,5 +1,5 @@
|
|||
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
|
||||
subnet: "192.168.6.0"
|
||||
|
|
|
@ -9,13 +9,8 @@
|
|||
roles:
|
||||
- wol-wake
|
||||
|
||||
- name: Clean up PXE environment
|
||||
- name: Clean up playbook execution
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
roles:
|
||||
- pxe-cleanup
|
||||
|
||||
- name: Configure networking
|
||||
hosts: metal
|
||||
roles:
|
||||
- systemd-networkd
|
|
@ -2,25 +2,9 @@ metal:
|
|||
children:
|
||||
masters:
|
||||
hosts:
|
||||
lab-mini-1:
|
||||
ansible_host: 192.168.6.21
|
||||
mac: '4c:52:62:1c:bf:6c'
|
||||
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 }}'
|
||||
lab-mini-1: {ansible_host: 192.168.6.21, mac: '4c:52:62:1c:bf:6c', disk: '/dev/sda'}
|
||||
lab-mini-2: {ansible_host: 192.168.6.22, mac: '4c:52:62:0f:09:6d', disk: '/dev/sda'}
|
||||
lab-mini-3: {ansible_host: 192.168.6.23, mac: '4c:52:62:0f:0a:23', disk: '/dev/sda'}
|
||||
workers:
|
||||
hosts:
|
||||
lab-mini-4:
|
||||
ansible_host: 192.168.6.24
|
||||
mac: '90:1b:0e:f8:e8:af'
|
||||
disk: '/dev/nvme0n1'
|
||||
ansible_become_pass: '{{ vault_ansible_become_password }}'
|
||||
lab-mini-4: {ansible_host: 192.168.6.24, mac: '90:1b:0e:f8:e8:af', disk: '/dev/sda'}
|
|
@ -1,5 +1,8 @@
|
|||
- 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
|
||||
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_checksum: "sha256:e8edf26ac9837d7dbbcfd96f47f51530260a6c68568938978e1b63ea698d5663"
|
||||
os_download_checksum: "sha256:ec3b71964457f30a57061ea758c12394bf2b792b461c697e61cc2d47053c5878"
|
|
@ -30,4 +30,9 @@
|
|||
loop: "{{ groups['metal'] }}"
|
||||
|
||||
- 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
|
|
@ -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
|
|
@ -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 }}
|
|
@ -5,4 +5,4 @@
|
|||
|
||||
- name: Wait for machines to come online with installed OS
|
||||
wait_for_connection:
|
||||
timeout: 900
|
||||
timeout: 600
|
Loading…
Reference in a new issue