mirror of
https://github.com/khuedoan/homelab.git
synced 2025-02-25 22:18:53 +07:00
Shutdown before wake up
This commit is contained in:
parent
f5b988991c
commit
bfa7fa26a8
13
README.md
13
README.md
@ -10,6 +10,15 @@
|
||||
- SSD: 128GB
|
||||
- Switch TP-Link TL-SG108
|
||||
|
||||
## Design
|
||||
|
||||
| Layer | Name | Description | Provisioner |
|
||||
|-------|----------|---------------------------------------------|---------------------|
|
||||
| 0 | metal | bare metal PXE boot, etcd, docker, lxd, | Ansible, PXE server |
|
||||
| 1 | infra | Cloud-like infrastructure, based on KVM/LXC | Terraform |
|
||||
| 2 | platform | kubernetes, vault, git, ci/cd... | Helm |
|
||||
| 3 | apps | Plex, PeerTube, Nextcloud... | ArgoCD |
|
||||
|
||||
## Features
|
||||
|
||||
### Infrastructure
|
||||
@ -29,7 +38,3 @@
|
||||

|
||||

|
||||

|
||||
|
||||
## Notes
|
||||
|
||||
- Node hostname must be different and has proper domain (for example `node0.homelab.local`)
|
||||
|
@ -3,13 +3,14 @@
|
||||
roles:
|
||||
- { role: pxe-server, tag: pxe-server }
|
||||
|
||||
- name: Shutdown all nodes
|
||||
hosts: homelab
|
||||
roles:
|
||||
- { role: shutdown, tag: shutdown }
|
||||
ignore_unreachable: yes
|
||||
|
||||
- name: Wake all nodes up
|
||||
hosts: homelab
|
||||
gather_facts: no
|
||||
roles:
|
||||
- { role: wake, tag: wake }
|
||||
|
||||
# - name: Shutdown all nodes
|
||||
# hosts: homelab
|
||||
# roles:
|
||||
# - { role: shutdown, tag: shutdown }
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 028f617e4dc9018182ec8d8c9fa26dfffd56522a
|
||||
Subproject commit ba467bcc4d74e37468b2a63c956ca5271f1acbbd
|
@ -2,28 +2,7 @@
|
||||
# community.general.docker_compose:
|
||||
# project_src: "{{ role_path }}/files/pxe-servers"
|
||||
|
||||
- name: Render DHCP config
|
||||
- name: Render environment file
|
||||
template:
|
||||
src: "dhcp/dhcpd.conf.j2"
|
||||
dest: "{{ role_path }}/files/dhcp/dhcpd.conf"
|
||||
|
||||
- name: Render GRUB config
|
||||
template:
|
||||
src: "tftp/tftpboot/grub.cfg.j2"
|
||||
dest: "{{ role_path }}/files/tftp/tftpboot/grub.cfg"
|
||||
|
||||
- name: Create directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ role_path }}/build/{{ item.path }}"
|
||||
state: directory
|
||||
mode: '{{ item.mode }}'
|
||||
with_community.general.filetree: "{{ role_path }}/templates"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: Template files (explicitly skip directories in order to use the 'src' attribute)
|
||||
ansible.builtin.template:
|
||||
src: '{{ item.src }}'
|
||||
dest: "{{ role_path }}/build/{{ item.path }}"
|
||||
mode: '{{ item.mode }}'
|
||||
with_community.general.filetree: "{{ role_path }}/templates"
|
||||
when: item.state == 'file'
|
||||
src: "{{ role_path }}/files/.env.j2"
|
||||
dest: "{{ role_path }}/files/.env"
|
||||
|
@ -1,3 +1,8 @@
|
||||
- name: Unconditionally shut down the machine with all defaults
|
||||
community.general.shutdown:
|
||||
delay: 0
|
||||
|
||||
- name: Wait for the machine to shutdown
|
||||
wait_for:
|
||||
timeout: 30
|
||||
delegate_to: localhost
|
||||
|
Loading…
Reference in New Issue
Block a user