add netbird setup

This commit is contained in:
tolerryan
2026-09-01 22:25:10 +00:00
parent b38701193f
commit d9e0ea938e
2 changed files with 67 additions and 1 deletions

View File

@@ -5,3 +5,13 @@ security_ufw_allowed_tcp_ports_extra: []
ssh_permit_root_login: "no"
ssh_password_authentication: "no"
ssh_port: 25456
# Netbird Setup key
netbird_setup_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
39613534636437396661383737356635343832613362653161663030633239643030663138383435
6666626537653764373838396135366333393262313638370a396362623035663231613361666362
36326437646265353438323330626464326366313531613062343731613463323033623764663433
3462356238363433370a316631656433633834316364643431356431363766613366326634633766
62373662626330336430666238346462343437396139306431383265353937633135353433643334
6431396538663865363734313739353733633438366232653865

View File

@@ -56,3 +56,59 @@
name: fail2ban
state: started
enabled: true
- name: Install required packages for netbird
apt:
name:
- curl
- gnupg
- ca-certificates
state: present
update_cache: no
- name: Configure network buffer sizes (increased speed)
ansible.posix.sysctl:
name: "{{ item.key }}"
value: "{{ item.value }}"
state: present
reload: yes
ignoreerrors: yes
loop:
- { key: 'net.core.rmem_max', value: '7500000' }
- { key: 'net.core.wmem_max', value: '7500000' }
- name: Add repository with key
ansible.builtin.deb822_repository:
name: netbird
types: [deb]
uris: "https://pkgs.netbird.io/debian"
components: [main]
suites: ["stable"]
signed_by: https://pkgs.netbird.io/debian/public.key
state: present
enabled: true
- name: Install netbird
apt:
name:
- netbird
state: present
update_cache: yes
- name: Enable netbird service
systemd:
name: netbird
state: started
enabled: yes
- name: Check NetBird status
ansible.builtin.command: netbird status
register: netbird_status
ignore_errors: yes
changed_when: False
- name: Start NetBird if needed
ansible.builtin.command: netbird up --management-url https://api.netbird.io --setup-key "{{ netbird_setup_key }}"
when: netbird_status.stdout is search("NeedsLogin")
vars:
ansible_command_timeout: 3600