Add Ansible playbook to configure PiKVM
Add Nix shell to flake Monitor PiKVM with Prometheus Serve Prometheus on /
This commit is contained in:
parent
04439a9ee5
commit
b139f3d469
14 changed files with 82 additions and 18 deletions
4
ansible/ansible.cfg
Normal file
4
ansible/ansible.cfg
Normal file
|
@ -0,0 +1,4 @@
|
|||
[defaults]
|
||||
inventory = inventory
|
||||
remote_tmp = /tmp/ansible
|
||||
ansible_python_interpreter = /usr/bin/python3.12
|
5
ansible/inventory/pikvm.yml
Normal file
5
ansible/inventory/pikvm.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
all:
|
||||
hosts:
|
||||
pikvm:
|
||||
ansible_host: pikvm.dmz
|
||||
ansible_user: root
|
6
ansible/main.yml
Normal file
6
ansible/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: Configure PiKVM server
|
||||
hosts: all
|
||||
|
||||
roles:
|
||||
- pikvm
|
20
ansible/roles/pikvm/tasks/main.yml
Normal file
20
ansible/roles/pikvm/tasks/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
- name: Mount filesystem as read-write
|
||||
ansible.builtin.command: rw
|
||||
vars:
|
||||
root_mount: "{{ ansible_mounts | selectattr('mount', 'equalto', '/') | first }}"
|
||||
when: "'ro' in root_mount.options.split(',')"
|
||||
|
||||
- name: Install Tailscale
|
||||
community.general.pacman:
|
||||
name: tailscale-pikvm
|
||||
state: latest
|
||||
|
||||
- name: Enable Tailscale
|
||||
ansible.builtin.systemd_service:
|
||||
name: tailscaled
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Mount filesystem as read-only
|
||||
ansible.builtin.command: ro
|
Reference in a new issue