mirror of
https://github.com/BluemediaGER/homelab.git
synced 2024-11-22 19:05:29 +01:00
Clean up roles and add makefile
This commit is contained in:
parent
d75f487712
commit
f8ffbe3452
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.vscode
|
|
@ -1,7 +1,6 @@
|
||||||
# Homelab automation
|
# Homelab automation
|
||||||
|
|
||||||
This project contains the ansible and docker based automation of my homelab. The structure is inspired by [Khue Doan's Homelab Project](https://github.com/khuedoan/homelab).
|
This project contains the ansible and docker based automation of my homelab. The structure is inspired by [Khue Doan's Homelab Project](https://github.com/khuedoan/homelab).
|
||||||
The repo is currently work in progress. Nothing is tested yet, so everything could burst into flames at any time :)
|
|
||||||
|
|
||||||
## Hardware
|
## Hardware
|
||||||
|
|
||||||
|
@ -9,7 +8,7 @@ The repo is currently work in progress. Nothing is tested yet, so everything cou
|
||||||
- CPU: `Intel Core i5-7500T @ 2.70 GHz`
|
- CPU: `Intel Core i5-7500T @ 2.70 GHz`
|
||||||
- RAM: `16 GB`
|
- RAM: `16 GB`
|
||||||
- NVMe SSD: `256 GB`
|
- NVMe SSD: `256 GB`
|
||||||
- SATA SSD: `128 GB`
|
- SATA SSD: `225 GB`
|
||||||
- 1 × Raspberry Pi 4 (4 GB)
|
- 1 × Raspberry Pi 4 (4 GB)
|
||||||
|
|
||||||
## Current features
|
## Current features
|
||||||
|
|
18
metal/Makefile
Normal file
18
metal/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
.POSIX:
|
||||||
|
|
||||||
|
default: os-install
|
||||||
|
|
||||||
|
os-install:
|
||||||
|
ansible-playbook \
|
||||||
|
--inventory inventories/lab.yml \
|
||||||
|
--ask-vault-pass \
|
||||||
|
install-os.yml
|
||||||
|
|
||||||
|
cluster:
|
||||||
|
ansible-playbook \
|
||||||
|
--inventory inventories/lab.yml \
|
||||||
|
cluster.yml
|
||||||
|
|
||||||
|
console:
|
||||||
|
ansible-console \
|
||||||
|
--inventory inventories/lab.yml
|
|
@ -9,8 +9,8 @@
|
||||||
roles:
|
roles:
|
||||||
- wol-wake
|
- wol-wake
|
||||||
|
|
||||||
- name: Tear down PXE stack
|
- name: Clean up playbook execution
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
roles:
|
roles:
|
||||||
- pxe-teardown
|
- pxe-cleanup
|
|
@ -2,9 +2,9 @@ metal:
|
||||||
children:
|
children:
|
||||||
masters:
|
masters:
|
||||||
hosts:
|
hosts:
|
||||||
lab-mini-1: {ansible_host: 192.168.6.21, mac: '4c:52:62:1c:bf:6c', disk: '/dev/nvme0n1'}
|
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/nvme0n1'}
|
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/nvme0n1'}
|
lab-mini-3: {ansible_host: 192.168.6.23, mac: '4c:52:62:0f:0a:23', disk: '/dev/sda'}
|
||||||
workers:
|
workers:
|
||||||
hosts:
|
hosts:
|
||||||
lab-mini-4: {ansible_host: 192.168.6.24, mac: '90:1b:0e:f8:e8:af', disk: '/dev/nvme0n1'}
|
lab-mini-4: {ansible_host: 192.168.6.24, mac: '90:1b:0e:f8:e8:af', disk: '/dev/sda'}
|
11
metal/roles/pxe-cleanup/tasks/main.yml
Normal file
11
metal/roles/pxe-cleanup/tasks/main.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
- name: Tear down PXE stack
|
||||||
|
docker_compose:
|
||||||
|
project_name: "pxe"
|
||||||
|
project_src: "{{ playbook_dir }}/roles/pxe-server/files/"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Remove preseed files
|
||||||
|
file:
|
||||||
|
path: "{{ playbook_dir }}/roles/pxe-server/files/data/preseed/{{ hostvars[item]['mac'] }}.cfg"
|
||||||
|
state: "absent"
|
||||||
|
loop: "{{ groups['metal'] }}"
|
|
@ -1,5 +0,0 @@
|
||||||
- name: Tear down PXE stack
|
|
||||||
docker_compose:
|
|
||||||
project_name: "pxe"
|
|
||||||
project_src: "{{ playbook_dir }}/roles/pxe-server/files/"
|
|
||||||
state: absent
|
|
Loading…
Reference in a new issue