Compare commits
7 Commits
role_netma
...
9cb2e88193
| Author | SHA1 | Date | |
|---|---|---|---|
| 9cb2e88193 | |||
| 25ceb0f456 | |||
| fcc4f1ed18 | |||
| de0e220004 | |||
| f9cc97a8f2 | |||
| 811fc22eef | |||
| 4cb418e2b6 |
4
netmaker/defauls/netmaker.yml
Normal file
4
netmaker/defauls/netmaker.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
netclient:
|
||||||
|
# Token to join default-network
|
||||||
|
# leave empty to ignore
|
||||||
|
join_network_token:
|
||||||
3
netmaker/meta/main.yml
Normal file
3
netmaker/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- role: docker
|
||||||
4
netmaker/tasks/certs.yml
Normal file
4
netmaker/tasks/certs.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- name: Deploy CA Certificate
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: secret_files/netmaker_server/ca/ca.crt
|
||||||
|
dest: /etc/ssl/certs/netmaker-ca.pem
|
||||||
25
netmaker/tasks/install.yml
Normal file
25
netmaker/tasks/install.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
- name: Install Packages
|
||||||
|
# when: docker_file.stat.exists == False
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- gpg
|
||||||
|
- gpg-agent
|
||||||
|
|
||||||
|
- name: Add netmaker-key
|
||||||
|
apt_key:
|
||||||
|
url: https://apt.netmaker.org/gpg.key
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add netmaker-repository
|
||||||
|
apt_repository:
|
||||||
|
repo: "deb https:apt.netmaker.org stable main"
|
||||||
|
state: present
|
||||||
|
filename: netmaker
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Install wireguard & netclient
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- wireguard
|
||||||
|
- netclient
|
||||||
|
state: latest
|
||||||
5
netmaker/tasks/join-network.yml
Normal file
5
netmaker/tasks/join-network.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
- name: Join netmaker-network
|
||||||
|
when: "netclient.join_network_token is defined"
|
||||||
|
command: "netclient join -t {{ netclient.join_network_token }}"
|
||||||
|
failed_when: command.rc != 0
|
||||||
|
register: command
|
||||||
5
netmaker/tasks/main.yml
Normal file
5
netmaker/tasks/main.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
- import_tasks: ./certs.yml
|
||||||
|
|
||||||
|
- import_tasks: ./install.yml
|
||||||
|
|
||||||
|
- import_tasks: ./join-network.yml
|
||||||
@@ -30,7 +30,7 @@ component netmaker_server {
|
|||||||
component nm_api
|
component nm_api
|
||||||
nm_api -down- nm_api_http
|
nm_api -down- nm_api_http
|
||||||
ng_http --( nm_api_http
|
ng_http --( nm_api_http
|
||||||
nm_api .up.( ng_TLS : db-connection to rqlite-master
|
nm_api -up-( ng_TLS : db-connection to rqlite-master
|
||||||
nm_api --( mq_plain
|
nm_api --( mq_plain
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
per_listener_settings false
|
per_listener_settings false
|
||||||
|
|
||||||
listener 8883
|
listener 8883
|
||||||
protocol websockets
|
|
||||||
allow_anonymous false
|
allow_anonymous false
|
||||||
|
certfile /certs/node.crt
|
||||||
|
keyfile /certs/node.key
|
||||||
|
|
||||||
listener 1883
|
listener 1883
|
||||||
protocol websockets
|
|
||||||
allow_anonymous false
|
allow_anonymous false
|
||||||
|
|
||||||
plugin /usr/lib/mosquitto_dynamic_security.so
|
plugin /usr/lib/mosquitto_dynamic_security.so
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
headers:
|
headers:
|
||||||
Authorization: 'Bearer {{ netmaker_creds.master_key }}'
|
Authorization: 'Bearer {{ netmaker_creds.master_key }}'
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
when: "inventory_hostname == groups['netmaker_server'][0]"
|
when: "inventory_hostname == groups['netmaker'][0]"
|
||||||
register: default_mesh
|
register: default_mesh
|
||||||
until: "default_mesh is not failed"
|
until: "default_mesh is not failed"
|
||||||
retries: 2
|
retries: 2
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
headers:
|
headers:
|
||||||
Authorization: 'Bearer {{ netmaker_creds.master_key }}'
|
Authorization: 'Bearer {{ netmaker_creds.master_key }}'
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
when: "inventory_hostname == groups['netmaker_server'][0]"
|
when: "inventory_hostname == groups['netmaker'][0]"
|
||||||
register: default_mesh_key
|
register: default_mesh_key
|
||||||
until: "default_mesh_key is not failed"
|
until: "default_mesh_key is not failed"
|
||||||
retries: 2
|
retries: 2
|
||||||
|
|||||||
@@ -33,15 +33,15 @@ services:
|
|||||||
|
|
||||||
-auth /config.json
|
-auth /config.json
|
||||||
|
|
||||||
{% if inventory_hostname != groups['netmaker_server'][0] %}
|
{% if inventory_hostname != groups['netmaker'][0] %}
|
||||||
-join-as netmaker
|
-join-as netmaker
|
||||||
-join https://{{ netmaker_rqlite.http_host }}.{{ groups['netmaker_server'][0] }}:{{ netmaker_nginx.advertise_port }}
|
-join https://{{ netmaker_rqlite.http_host }}.{{ groups['netmaker'][0] }}:{{ netmaker_nginx.advertise_port }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
"
|
"
|
||||||
# FIXME: /\ \/ Change http -> https
|
# FIXME: /\ \/ Change http -> https
|
||||||
|
|
||||||
netmaker: # The Primary Server for running Netmaker
|
netmaker: # The Primary Server for running Netmaker
|
||||||
image: gravitl/netmaker:v0.17.1
|
image: gravitl/netmaker:v0.16.1
|
||||||
depends_on:
|
depends_on:
|
||||||
- rqlite
|
- rqlite
|
||||||
cap_add:
|
cap_add:
|
||||||
@@ -104,7 +104,7 @@ services:
|
|||||||
- "51821-51830:51821-51830/udp" # wireguard ports
|
- "51821-51830:51821-51830/udp" # wireguard ports
|
||||||
|
|
||||||
netmaker-ui: # The Netmaker UI Component
|
netmaker-ui: # The Netmaker UI Component
|
||||||
image: gravitl/netmaker-ui:v0.17.1
|
image: gravitl/netmaker-ui:v0.16.1
|
||||||
depends_on:
|
depends_on:
|
||||||
- netmaker
|
- netmaker
|
||||||
links:
|
links:
|
||||||
@@ -120,6 +120,7 @@ services:
|
|||||||
- ./mosquitto/config:/mosquitto/config
|
- ./mosquitto/config:/mosquitto/config
|
||||||
- ./mosquitto/data:/mosquitto/data
|
- ./mosquitto/data:/mosquitto/data
|
||||||
- ./mosquitto/logs:/mosquitto/log
|
- ./mosquitto/logs:/mosquitto/log
|
||||||
|
- "./certs:/certs:ro"
|
||||||
depends_on:
|
depends_on:
|
||||||
- netmaker
|
- netmaker
|
||||||
command: ["/mosquitto/config/wait.sh"]
|
command: ["/mosquitto/config/wait.sh"]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ stream{
|
|||||||
{{ netmaker_ui.host }}.{{ netmaker_base_domain }} 127.0.0.1:8443;
|
{{ netmaker_ui.host }}.{{ netmaker_base_domain }} 127.0.0.1:8443;
|
||||||
{{ netmaker_api.host }}.{{ netmaker_base_domain }} 127.0.0.1:8443;
|
{{ netmaker_api.host }}.{{ netmaker_base_domain }} 127.0.0.1:8443;
|
||||||
|
|
||||||
{{ netmaker_broker.tls_host }}.{{ netmaker_base_domain }} 127.0.0.1:8443;
|
{{ netmaker_broker.tls_host }}.{{ netmaker_base_domain }} mosquitto:8883; # todo: tls-terminate?
|
||||||
|
|
||||||
{{ netmaker_rqlite.http_host }}.{{ ansible_facts.nodename }} 127.0.0.1:8443;
|
{{ netmaker_rqlite.http_host }}.{{ ansible_facts.nodename }} 127.0.0.1:8443;
|
||||||
{{ netmaker_rqlite.cluster_host }}.{{ ansible_facts.nodename }} rqlite:4002;
|
{{ netmaker_rqlite.cluster_host }}.{{ ansible_facts.nodename }} rqlite:4002;
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ map $host $proxy_name {
|
|||||||
|
|
||||||
{{ netmaker_ui.host }}.{{ netmaker_base_domain }} netmaker-ui:80;
|
{{ netmaker_ui.host }}.{{ netmaker_base_domain }} netmaker-ui:80;
|
||||||
{{ netmaker_api.host }}.{{ netmaker_base_domain }} netmaker:8081;
|
{{ netmaker_api.host }}.{{ netmaker_base_domain }} netmaker:8081;
|
||||||
|
|
||||||
{{ netmaker_broker.tls_host }}.{{ netmaker_base_domain }} mosquitto:8883;
|
|
||||||
|
|
||||||
{{ netmaker_rqlite.http_host }}.{{ ansible_facts.nodename }} rqlite:4001;
|
{{ netmaker_rqlite.http_host }}.{{ ansible_facts.nodename }} rqlite:4001;
|
||||||
|
|
||||||
default 444;
|
default 444;
|
||||||
|
|||||||
Reference in New Issue
Block a user