Compare commits
8 Commits
f5fca9171a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5c8c35534 | ||
|
|
5f2d368a97 | ||
|
|
7916ec86b7 | ||
|
|
c86df61152 | ||
|
|
77869f0e50 | ||
|
|
e34cb4adb1 | ||
|
|
01cb285d54 | ||
|
|
edfab0c61c |
5
group_vars/damien_hosts.yml
Normal file
5
group_vars/damien_hosts.yml
Normal 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
|
||||||
19
homelab.yml
19
homelab.yml
@@ -1,8 +1,25 @@
|
|||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/playbook.json
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/playbook.json
|
||||||
---
|
---
|
||||||
- name: Homelab alignment
|
- name: Homelab alignment
|
||||||
hosts: managed
|
hosts: managed:!excluded
|
||||||
become: true
|
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:
|
roles:
|
||||||
- role: ufw
|
- role: ufw
|
||||||
|
|||||||
@@ -5,25 +5,29 @@ all:
|
|||||||
children:
|
children:
|
||||||
root_hosts:
|
root_hosts:
|
||||||
hosts:
|
hosts:
|
||||||
ipfabric:
|
|
||||||
grafana:
|
grafana:
|
||||||
gitea:
|
gitea:
|
||||||
prometheus:
|
prometheus:
|
||||||
prometheus-pve-exporter:
|
prometheus-pve-exporter:
|
||||||
gitea-runner:
|
gitea-runner:
|
||||||
openbao:
|
openbao:
|
||||||
komodo:
|
pve01:
|
||||||
|
|
||||||
debian_hosts:
|
debian_hosts:
|
||||||
hosts:
|
hosts:
|
||||||
proxy:
|
proxy:
|
||||||
|
|
||||||
|
damien_hosts:
|
||||||
|
hosts:
|
||||||
|
komodo:
|
||||||
|
|
||||||
managed:
|
managed:
|
||||||
children:
|
children:
|
||||||
root_hosts:
|
root_hosts:
|
||||||
debian_hosts:
|
debian_hosts:
|
||||||
|
damien_hosts:
|
||||||
|
|
||||||
excluded:
|
excluded:
|
||||||
children:
|
hosts:
|
||||||
hosts:
|
pve01:
|
||||||
pve01:
|
ipfabric:
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
- name: Add UFW to default runlevel (Alpine)
|
- name: Add UFW to default runlevel (Alpine)
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: rc-update add ufw default
|
cmd: /sbin/rc-update add ufw default
|
||||||
register: ufw_rc_update_result
|
register: ufw_rc_update_result
|
||||||
changed_when: >- # " >- : transform multiple lines into one line"
|
changed_when: >- # " >- : transform multiple lines into one line"
|
||||||
'already' not in ufw_rc_update_result.stdout
|
'already' not in ufw_rc_update_result.stdout
|
||||||
|
|||||||
Reference in New Issue
Block a user