Compare commits

...

8 Commits

Author SHA1 Message Date
Damien
b5c8c35534 Add ipfabric to excluded hosts 2026-06-21 14:28:39 +02:00
Damien
5f2d368a97 Remove ipfabric from root_hosts and add pve01 to excluded 2026-06-14 16:33:56 +02:00
Damien
7916ec86b7 Add tags to gather facts task 2026-06-14 12:10:18 +02:00
Damien
c86df61152 Add host exclusion and improve UFW task reliability
Add `excluded` host group and skip offline hosts
Fix UFW service initialization command for Alpine Linux
2026-06-13 10:17:13 +02:00
Damien
77869f0e50 Add ipfabric group 2026-06-12 12:54:33 +02:00
Damien
e34cb4adb1 Add pve01 to static inventory groups 2026-06-12 12:49:41 +02:00
Damien
01cb285d54 Add damien_hosts group to static inventory 2026-06-12 12:32:32 +02:00
Damien
edfab0c61c Add damien_hosts group with Ansible config 2026-06-12 12:31:35 +02:00
4 changed files with 33 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/vars.json
---
ansible_user: damien
ansible_become: true
ansible_become_method: sudo

View File

@@ -1,8 +1,25 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/playbook.json
---
- name: Homelab alignment
hosts: managed
hosts: managed:!excluded
become: true
gather_facts: false
environment:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
pre_tasks:
- name: Test connectivity
ansible.builtin.ping:
ignore_unreachable: true
register: ping_result
- name: Skip offline hosts
ansible.builtin.meta: end_host
when: ping_result.unreachable | default(false)
- name: Gather facts
ansible.builtin.setup:
tags: always
roles:
- role: ufw

View File

@@ -5,25 +5,29 @@ all:
children:
root_hosts:
hosts:
ipfabric:
grafana:
gitea:
prometheus:
prometheus-pve-exporter:
gitea-runner:
openbao:
komodo:
pve01:
debian_hosts:
hosts:
proxy:
damien_hosts:
hosts:
komodo:
managed:
children:
root_hosts:
debian_hosts:
damien_hosts:
excluded:
children:
hosts:
pve01:
hosts:
pve01:
ipfabric:

View File

@@ -17,7 +17,7 @@
- name: Add UFW to default runlevel (Alpine)
ansible.builtin.command:
cmd: rc-update add ufw default
cmd: /sbin/rc-update add ufw default
register: ufw_rc_update_result
changed_when: >- # " >- : transform multiple lines into one line"
'already' not in ufw_rc_update_result.stdout