Skip to content

Commit fb8f7ce

Browse files
authored
Add support for self-hosted Netbird instances and update README (#33)
* Add support for self-hosted Netbird instances and update README - Implemented logic to handle `netbird_deployment_mode` . - Added validation to ensure `netbird_management_url` is defined and non-empty when using self-hosted mode. - Updated README with detailed documentation for `netbird_deployment_mode` and `netbird_management_url`. * Renamed saas to cloud-hosted * Rename variable netbird_management_url to netbird_mgmt_url * Remove netbird_deployment_mode and simplify instance selection with netbird_mgmt_url - Removed `netbird_deployment_mode` variable. - Updated logic to determine instance type based on `netbird_mgmt_url`.
1 parent 90725d8 commit fb8f7ce

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

roles/netbird/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Role Variables
1010
--------------
1111
- `netbird_setup_key`: The key that is used to automate the setup process.
1212
- `netbird_register`: A true/false defining whether or not register netbird.
13+
- `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).
1314

1415
Dependencies
1516
------------

roles/netbird/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
---
22
# defaults file for netbird
3+
netbird_mgmt_url: https://api.netbird.io:443

roles/netbird/tasks/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# tasks file for netbird
33
- name: Check for Netbird Installation
44
ansible.builtin.shell:
5-
cmd: netbird --version
5+
cmd: netbird version
66
ignore_errors: true
77
register: netbird_installed
88

@@ -20,5 +20,7 @@
2020

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

0 commit comments

Comments
 (0)