mirror of
https://github.com/khuedoan/homelab.git
synced 2025-07-04 15:27:52 +07:00
Shutdown before wake up
This commit is contained in:
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 }
|
||||
|
Submodule metal/roles/pxe-server/files updated: 028f617e4d...ba467bcc4d
@ -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
|
||||
|
Reference in New Issue
Block a user