Skip to content

Add support for self-hosted Netbird instances and update README #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/netbird/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Role Variables
--------------
- `netbird_setup_key`: The key that is used to automate the setup process.
- `netbird_register`: A true/false defining whether or not register netbird.
- `netbird_mgmt_url`: The management URL for the self-hosted instance. If not specified, defaults to the cloud-hosted instance (https://api.netbird.io:443).

Dependencies
------------
Expand Down
1 change: 1 addition & 0 deletions roles/netbird/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
# defaults file for netbird
netbird_mgmt_url: https://api.netbird.io:443
8 changes: 5 additions & 3 deletions roles/netbird/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# tasks file for netbird
- name: Check for Netbird Installation
ansible.builtin.shell:
cmd: netbird --version
cmd: netbird version
ignore_errors: true
register: netbird_installed

Expand All @@ -20,5 +20,7 @@

- name: Start Netbird
become: true
ansible.builtin.shell: netbird up --setup-key="{{ netbird_setup_key }}"
when: netbird_register is true and 'NeedsLogin' in netbird_status.stdout
ansible.builtin.shell: netbird up --setup-key="{{ netbird_setup_key }}" --management-url="{{ netbird_mgmt_url }}"
when:
- netbird_register is true
- "'NeedsLogin' in netbird_status.stdout or 'LoginFailed' in netbird_status.stdout"