Init some skeleton nebula stuff
This commit is contained in:
parent
0ecd884a9a
commit
a44a79031a
9 changed files with 93 additions and 0 deletions
5
ansible/group_vars/all/nebula.yml
Normal file
5
ansible/group_vars/all/nebula.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
nebula:
|
||||||
|
subnet: 10.23.2.0/24
|
||||||
|
clients:
|
||||||
|
casey:
|
||||||
|
ip: 10.23.2.1
|
1
ansible/host_vars/casey.yml
Normal file
1
ansible/host_vars/casey.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
nebula_is_lighthouse: true
|
|
@ -12,6 +12,7 @@
|
||||||
- hosts: casey
|
- hosts: casey
|
||||||
roles:
|
roles:
|
||||||
- gateway
|
- gateway
|
||||||
|
- nebula
|
||||||
|
|
||||||
- hosts:
|
- hosts:
|
||||||
- walker
|
- walker
|
||||||
|
|
1
ansible/roles/nebula/defaults/main.yml
Normal file
1
ansible/roles/nebula/defaults/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
nebula_is_lighthouse: false
|
55
ansible/roles/nebula/files/nebula.yml
Normal file
55
ansible/roles/nebula/files/nebula.yml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
pki:
|
||||||
|
ca: /etc/nebula/ca.crt
|
||||||
|
cert: /etc/nebula/host.crt
|
||||||
|
key: /etc/nebula/host.key
|
||||||
|
|
||||||
|
static_host_map:
|
||||||
|
"{{ nebula_lighthouse_ip }}": ["{{ nebula_lighthouse_public_ip }}:{{ nebula_lighthouse_port }}"]
|
||||||
|
|
||||||
|
|
||||||
|
lighthouse:
|
||||||
|
am_lighthouse: "{{ nebula_is_lighthouse | lower }}"
|
||||||
|
interval: 60
|
||||||
|
hosts:
|
||||||
|
{% if not nebula_is_lighthouse %}
|
||||||
|
- "{{ nebula_lighthouse_ip }}"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
listen:
|
||||||
|
host: 0.0.0.0
|
||||||
|
port: "{{ nebula_is_lighthouse | ternary(nebula_lighthouse_port, 0) }}"
|
||||||
|
|
||||||
|
punchy:
|
||||||
|
punch: true
|
||||||
|
|
||||||
|
tun:
|
||||||
|
disabled: false
|
||||||
|
dev: nebula1
|
||||||
|
drop_local_broadcast: false
|
||||||
|
drop_multicast: false
|
||||||
|
tx_queue: 500
|
||||||
|
mtu: 1300
|
||||||
|
routes:
|
||||||
|
unsafe_routes:
|
||||||
|
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level: info
|
||||||
|
format: text
|
||||||
|
|
||||||
|
firewall:
|
||||||
|
conntrack:
|
||||||
|
tcp_timeout: 12m
|
||||||
|
udp_timeout: 3m
|
||||||
|
default_timeout: 10m
|
||||||
|
max_connections: 100000
|
||||||
|
|
||||||
|
outbound:
|
||||||
|
- port: any
|
||||||
|
proto: any
|
||||||
|
host: any
|
||||||
|
|
||||||
|
inbound:
|
||||||
|
- port: any
|
||||||
|
proto: any
|
||||||
|
host: any
|
19
ansible/roles/nebula/tasks/main.yml
Normal file
19
ansible/roles/nebula/tasks/main.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
- name: Install Nebula
|
||||||
|
package:
|
||||||
|
name: nebula
|
||||||
|
when: ansible_os_family == 'Archlinux'
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Create nebula directory
|
||||||
|
file:
|
||||||
|
path: /etc/nebula
|
||||||
|
state: directory
|
||||||
|
mode: "0700"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Install nebula config
|
||||||
|
template:
|
||||||
|
src: files/nebula.yml
|
||||||
|
dest: /etc/nebula/config.yml
|
||||||
|
mode: "0600"
|
||||||
|
become: true
|
3
ansible/roles/nebula/vars/main.yml
Normal file
3
ansible/roles/nebula/vars/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
nebula_lighthouse_public_ip: "{{ hosts.casey_ip }}"
|
||||||
|
nebula_lighthouse_ip: "{{ nebula.clients.casey.ip }}"
|
||||||
|
nebula_lighthouse_port: 6328
|
|
@ -4,6 +4,7 @@ ignore: |
|
||||||
ansible/galaxy_roles
|
ansible/galaxy_roles
|
||||||
ansible/group_vars/all/hosts.yml
|
ansible/group_vars/all/hosts.yml
|
||||||
ansible/roles/traefik/files/traefik.yml
|
ansible/roles/traefik/files/traefik.yml
|
||||||
|
ansible/roles/nebula/files/nebula.yml
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
document-start: disable
|
document-start: disable
|
||||||
|
|
|
@ -57,3 +57,10 @@ resource "vultr_firewall_rule" "casey_mc" {
|
||||||
from_port = 25566
|
from_port = 25566
|
||||||
network = "0.0.0.0/0"
|
network = "0.0.0.0/0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "vultr_firewall_rule" "casey_nebula" {
|
||||||
|
firewall_group_id = vultr_firewall_group.casey.id
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 6328
|
||||||
|
network = "0.0.0.0/0"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue