add service logic

This commit is contained in:
2026-04-17 18:14:12 -06:00
parent 7c19f7dafe
commit b21ea34764
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
- name: restart netbird
service:
name: netbird
state: restarted

View File

@@ -40,3 +40,22 @@
group: root group: root
mode: '0755' # Permissions for the target file mode: '0755' # Permissions for the target file
force: yes force: yes
- name: Run command to generate netbird systemd unit file
command:
cmd: /usr/local/bin/netbird service install
creates: /etc/systemd/system/netbird.service
register: netbird_service
- name: systemctl daemon-reload to pickup netbird service changes
systemd_service:
daemon_reload: true
when: netbird_service.changed
notify: restart netbird
- name: Start and enable netbird service
service:
name: netbird
state: started
enabled: true
daemon_reload: true