Skip to content

Commit 1ab3cae

Browse files
committed
fix(ansible): resolve docker binding and coturn task errors
1 parent f59ea66 commit 1ab3cae

File tree

28 files changed

+236
-212
lines changed

28 files changed

+236
-212
lines changed
Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,65 @@
11
all:
22
vars:
33
# NetBird Configuration
4-
netbird_domain: "vpn.example.com"
4+
netbird_domain: "ec2-16-171-59-171.eu-north-1.compute.amazonaws.com"
55
netbird_version: "latest"
6-
relay_auth_secret: "CHANGE_ME"
7-
coturn_password: "CHANGE_ME"
8-
netbird_encryption_key: "CHANGE_ME"
6+
coturn_version: "latest"
7+
caddy_version: "latest"
8+
docker_compose_version: "v2.24.0"
9+
netbird_log_level: "info"
10+
relay_auth_secret: "b&{iWS+B}X>9IpiG#XS(2pLBGSX{vmFW"
11+
netbird_encryption_key: "J1tVwuoWBOxGIpXY25tO82WhzzPQWHFGxv0Il6Zw2R0="
12+
coturn_password: "[HlY!rSbtF?gpu(6Ya}=F0=jt0D%wBdY"
13+
14+
# Paths
15+
netbird_data_dir: "/var/lib/netbird"
16+
netbird_config_dir: "/etc/netbird"
917

1018
# Database Configuration
1119
database_type: "sqlite"
1220
database_engine: "sqlite"
1321
database_dsn: "/var/lib/netbird/store.db"
1422
database_endpoint: "local"
23+
db_host: "local"
24+
db_port: 0
25+
db_name: ""
26+
db_user: ""
27+
db_password: ""
28+
db_sslmode: "require"
1529
sqlite_database_path: "/var/lib/netbird/store.db"
1630

1731
# Keycloak Configuration
18-
keycloak_url: "https://keycloak.example.com/auth"
32+
keycloak_url: "https://keycloak.net.observe.camer.digital/auth"
1933
keycloak_realm: "netbird"
2034
keycloak_client_id: "netbird-client"
21-
keycloak_client_secret: "CHANGE_ME"
22-
keycloak_oidc_endpoint: "https://keycloak.example.com/auth/realms/netbird/.well-known/openid-configuration"
35+
keycloak_backend_client_id: "netbird-backend"
36+
keycloak_backend_client_secret: "wahUSWrKpszPenDxQMHxgZiYSquyz265"
37+
keycloak_oidc_endpoint: "https://keycloak.net.observe.camer.digital/auth/realms/netbird/.well-known/openid-configuration"
2338

39+
# Relay & STUN Addresses
40+
relay_addresses: ["rels://16.171.59.171:33080"]
41+
stun_addresses: ["stun://16.171.59.171:3478"]
42+
2443
# Ansible Connection
25-
ansible_user: "ubuntu"
2644
ansible_ssh_private_key_file: "~/.ssh/private_key"
2745

2846
children:
2947
management:
3048
hosts:
31-
net:
32-
ansible_host: 1.2.3.4
33-
private_ip: 10.0.0.1
49+
netbird-all-in-one:
50+
ansible_host: 16.171.59.171
51+
private_ip: 16.171.59.171
52+
ansible_user: ubuntu
3453
reverse_proxy:
3554
hosts:
36-
net:
37-
ansible_host: 1.2.3.4
38-
private_ip: 10.0.0.1
55+
netbird-all-in-one:
56+
ansible_host: 16.171.59.171
57+
private_ip: 16.171.59.171
58+
ansible_user: ubuntu
3959
relay:
4060
hosts:
41-
net:
42-
ansible_host: 1.2.3.4
43-
private_ip: 10.0.0.1
61+
netbird-all-in-one:
62+
ansible_host: 16.171.59.171
63+
private_ip: 16.171.59.171
64+
ansible_user: ubuntu
65+
relay_domain: 16.171.59.171

configuration/ansible/roles/common/tasks/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
---
2+
- name: Wipe all existing Docker repository configurations
3+
ansible.builtin.shell: |
4+
rm -f /etc/apt/sources.list.d/*docker*
5+
sed -i '/download.docker.com/d' /etc/apt/sources.list
6+
args:
7+
executable: /bin/bash
8+
register: cleanup_docker
9+
changed_when: true
10+
211
- name: Install dependencies
312
ansible.builtin.apt:
413
name:
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
2-
coturn_version: \"4.6.2\"
3-
coturn_port: 3478
2+
coturn_version: latest
43
coturn_min_port: 49152
54
coturn_max_port: 65535
6-
coturn_realm: \"{{ netbird_domain }}\"
5+
coturn_port: 3478
6+
coturn_realm: "{{ netbird_domain }}"
7+
coturn_password: ""
8+
netbird_domain: ""

configuration/ansible/roles/netbird-coturn/tasks/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: Create Coturn configuration directory
33
ansible.builtin.file:
4-
path: \"/etc/coturn\"
4+
path: "/etc/coturn"
55
state: directory
66
owner: root
77
group: root
@@ -19,9 +19,9 @@
1919
- name: Allow Coturn ports (UFW)
2020
community.general.ufw:
2121
rule: allow
22-
port: \"{{ item.port }}\"
23-
proto: \"{{ item.proto }}\"
24-
comment: \"{{ item.comment }}\"
22+
port: "{{ item.port }}"
23+
proto: "{{ item.proto }}"
24+
comment: "{{ item.comment }}"
2525
loop:
2626
- { port: '3478', proto: 'udp', comment: 'Coturn STUN/TURN UDP' }
2727
- { port: '3478', proto: 'tcp', comment: 'Coturn STUN/TURN TCP' }
@@ -30,13 +30,13 @@
3030
- name: Run Coturn container
3131
community.docker.docker_container:
3232
name: coturn
33-
image: \"coturn/coturn:{{ coturn_version }}\"
33+
image: "coturn/coturn:{{ coturn_version }}"
3434
restart_policy: unless-stopped
3535
network_mode: host
3636
volumes:
3737
- /etc/coturn/turnserver.conf:/etc/coturn/turnserver.conf:ro
38-
command: [\"-c\", \"/etc/coturn/turnserver.conf\"]
39-
log_driver: \"json-file\"
38+
command: ["-c", "/etc/coturn/turnserver.conf"]
39+
log_driver: "json-file"
4040
log_options:
41-
max-size: \"500m\"
42-
max-file: \"2\"
41+
max-size: "500m"
42+
max-file: "2"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
netbird_version: latest
3+
netbird_domain: ""
4+
keycloak_url: ""
5+
keycloak_realm: ""
6+
keycloak_client_id: ""

configuration/ansible/roles/netbird-dashboard/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
AUTH_SILENT_REDIRECT_URI: "https://{{ netbird_domain }}/nb-silent-auth"
2525
LETSENCRYPT_DOMAIN: "none"
2626
ports:
27-
- "{{ private_ip }}:8080:80"
27+
- "8080:80"
2828
log_driver: "json-file"
2929
log_options:
3030
max-size: "500m"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
netbird_data_dir: /var/lib/netbird
3+
netbird_config_dir: /etc/netbird
4+
netbird_version: latest
5+
netbird_log_level: info

configuration/ansible/roles/netbird-management/handlers/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
- name: Restart NetBird Management
33
community.docker.docker_container:
44
name: netbird-management
5-
state: restarted
5+
state: started
6+
restart: true

configuration/ansible/roles/netbird-management/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
networks:
3939
- name: netbird
4040
ports:
41-
- "{{ private_ip }}:8081:80"
42-
- "{{ private_ip }}:10000:10000"
43-
- "{{ private_ip }}:9000:9000"
41+
- "8081:80"
42+
- "10000:10000"
43+
- "9000:9000"
4444
volumes:
4545
- "{{ netbird_data_dir }}:/var/lib/netbird"
4646
- "{{ netbird_config_dir }}:/etc/netbird"

configuration/ansible/roles/netbird-management/templates/management.json.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
22
"Stuns": [
3+
{% for addr in stun_addresses %}
4+
{
5+
"URI": "{{ addr }}"
6+
}{{ "," if not loop.last else "" }}
7+
{% else %}
38
{
49
"URI": "stun:{{ netbird_domain }}:3478"
510
}
11+
{% endfor %}
612
],
713
"Relay": {
814
"Addresses": {{ relay_addresses | to_json }},

0 commit comments

Comments
 (0)