Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tun
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
tun
Commits
bead71cb
Commit
bead71cb
authored
Dec 29, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
the gwgroup
parent
fa5c3cd7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
96 deletions
+66
-96
ansible/bird.conf.j2
ansible/bird.conf.j2
+0
-36
ansible/configure.yaml
ansible/configure.yaml
+59
-53
ansible/install.yaml
ansible/install.yaml
+3
-3
src/inventory.ts
src/inventory.ts
+4
-4
No files found.
ansible/bird.conf.j2
deleted
100644 → 0
View file @
fa5c3cd7
# MyCard bird
# Force change in 12.14
log stderr all;
router id {{address}};
protocol device {}
protocol kernel {
learn;
ipv4 {
import where net = 0.0.0.0/0;
export where net != 0.0.0.0/0;
};
#ipv6 { export all; };
}
{% for plan in routePlans %}
ipv4 table {{plan.name}};
{% if plan.addressesString %}
protocol pipe {
table master4;
peer table {{plan.name}};
export where ospf_router_id ~ {{plan.addressesString}};
}
{% endif %}
protocol kernel {
ipv4 {
table {{plan.name}};
export all;
};
persist;
kernel table {{plan.destMark}};
}
{% endfor %}
ansible/configure.yaml
View file @
bead71cb
...
@@ -113,18 +113,24 @@
...
@@ -113,18 +113,24 @@
content
:
'
{{dockerServices
|
to_yaml}}'
content
:
'
{{dockerServices
|
to_yaml}}'
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/docker-compose.yml'
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/docker-compose.yml'
when
:
not noBird
when
:
not noBird
-
name
:
bird conf
#
- name: bird conf
template
:
#
template:
src
:
bird.conf.j2
#
src: bird.conf.j2
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/bird.conf'
#
dest: '{{ansible_user_dir}}/nextgen-network/services/bird.conf'
notify
:
restart_bird
#
notify: restart_bird
when
:
not noBird
#
when: not noBird
-
name
:
babeld conf
-
name
:
babeld conf
template
:
template
:
src
:
babeld.conf.j2
src
:
babeld.conf.j2
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/babeld.conf'
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/babeld.conf'
#notify: restart_babeld
#notify: restart_babeld
when
:
not noBird
when
:
not noBird
-
name
:
monitor route plans
template
:
src
:
route-plans.j2
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/route-plans'
notify
:
restart_monitor
when
:
not noBird
-
name
:
babeld reload conf
-
name
:
babeld reload conf
template
:
template
:
src
:
babeld-reload.conf.j2
src
:
babeld-reload.conf.j2
...
@@ -142,56 +148,56 @@
...
@@ -142,56 +148,56 @@
remove_orphans
:
true
remove_orphans
:
true
# pull: true
# pull: true
when
:
not noBird
when
:
not noBird
-
name
:
systemd bird
#
- name: systemd bird
become
:
true
#
become: true
template
:
#
template:
src
:
bird.conf.j2
#
src: bird.conf.j2
dest
:
'
/etc/bird/bird.conf'
#
dest: '/etc/bird/bird.conf'
notify
:
restart_bird_systemd
#
notify: restart_bird_systemd
when
:
systemBird
#
when: systemBird
-
name
:
enable systemd bird
#
- name: enable systemd bird
become
:
true
#
become: true
systemd
:
#
systemd:
name
:
bird
#
name: bird
state
:
started
#
state: started
enabled
:
true
#
enabled: true
masked
:
false
#
masked: false
when
:
systemBird
#
when: systemBird
-
name
:
systemd babeld conf
#
- name: systemd babeld conf
become
:
true
#
become: true
template
:
#
template:
src
:
babeld.conf.j2
#
src: babeld.conf.j2
dest
:
'
/etc/babeld.conf'
#
dest: '/etc/babeld.conf'
#notify: restart_babeld_systemd
#
#notify: restart_babeld_systemd
when
:
systemBird
#
when: systemBird
-
name
:
enable systemd babeld
#
- name: enable systemd babeld
become
:
true
#
become: true
systemd
:
#
systemd:
name
:
babeld
#
name: babeld
state
:
started
#
state: started
enabled
:
true
#
enabled: true
masked
:
false
#
masked: false
when
:
systemBird
#
when: systemBird
handlers
:
handlers
:
-
name
:
reload_switch_rules
-
name
:
reload_switch_rules
become
:
true
become
:
true
shell
:
'
{{ansible_user_dir}}/nextgen-network/scripts/switch-rules-down.sh
;
{{ansible_user_dir}}/nextgen-network/scripts/switch-rules-up.sh'
shell
:
'
{{ansible_user_dir}}/nextgen-network/scripts/switch-rules-down.sh
;
{{ansible_user_dir}}/nextgen-network/scripts/switch-rules-up.sh'
-
name
:
restart_b
ird
-
name
:
restart_b
abeld
# ocserv would be always restarted whenever key changes..
docker_compose
:
docker_compose
:
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
restarted
:
true
restarted
:
true
services
:
services
:
-
b
ir
d
-
b
abel
d
when
:
not noBird
when
:
not noBird
-
name
:
restart_babeld
# ocserv would be always restarted whenever key changes..
-
name
:
reload_babeld
shell
:
cat /tmp/babeld-reload.conf | timeout 1 nc ::1 33123 ||
true
-
name
:
restart_monitor
docker_compose
:
docker_compose
:
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
restarted
:
true
restarted
:
true
services
:
services
:
-
babeld
-
gateways-monitor
when
:
not noBird
when
:
not noBird
-
name
:
reload_babeld
shell
:
cat /tmp/babeld-reload.conf | timeout 1 nc ::1 33123 ||
true
-
name
:
restart_frps
-
name
:
restart_frps
docker_compose
:
docker_compose
:
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
...
@@ -222,17 +228,17 @@
...
@@ -222,17 +228,17 @@
-
openconnect-{{item.name}}
-
openconnect-{{item.name}}
with_items
:
'
{{connections}}'
with_items
:
'
{{connections}}'
when
:
'
item.protocol
==
"oc"
and
item.ocType
==
"client"
and
not
noBird
and
not
item.noUpdate'
when
:
'
item.protocol
==
"oc"
and
item.ocType
==
"client"
and
not
noBird
and
not
item.noUpdate'
-
name
:
restart_bird_systemd
#
- name: restart_bird_systemd
become
:
true
#
become: true
systemd
:
#
systemd:
name
:
bird
#
name: bird
state
:
restarted
#
state: restarted
-
name
:
restart_babeld_systemd
#
- name: restart_babeld_systemd
become
:
true
#
become: true
systemd
:
#
systemd:
name
:
babeld
#
name: babeld
state
:
restarted
#
state: restarted
when
:
systemBird
#
when: systemBird
-
name
:
reload_chnroute
-
name
:
reload_chnroute
become
:
true
become
:
true
shell
:
|
shell
:
|
...
...
ansible/install.yaml
View file @
bead71cb
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
name
:
'
{{item}}'
name
:
'
{{item}}'
source
:
pull
source
:
pull
with_items
:
with_items
:
-
fatedier/frps:v0.34.2
#
- fatedier/frps:v0.34.2
-
fatedier/frpc:v0.34.2
#
- fatedier/frpc:v0.34.2
-
git-registry.mycard.moe/
nanahira/docker-bird
-
git-registry.mycard.moe/
railgun/gateways-monitor
-
git-registry.mycard.moe/railgun/babeld
-
git-registry.mycard.moe/railgun/babeld
-
git-registry.mycard.moe/nanahira/docker-ocserv
-
git-registry.mycard.moe/nanahira/docker-ocserv
-
git-registry.mycard.moe/railgun/openconnect
-
git-registry.mycard.moe/railgun/openconnect
...
...
src/inventory.ts
View file @
bead71cb
...
@@ -156,7 +156,7 @@ class InventoryBuilder {
...
@@ -156,7 +156,7 @@ class InventoryBuilder {
if
(
!
addresses
.
length
)
{
if
(
!
addresses
.
length
)
{
return
null
;
return
null
;
}
}
return
`[
${
addresses
.
join
(
"
,
"
)}
]`
;
return
addresses
.
join
(
"
"
)
;
}
}
getAddressesFromGatewayGroup
(
gatewayGroup
:
GatewayGroup
,
hosts
:
any
[])
{
getAddressesFromGatewayGroup
(
gatewayGroup
:
GatewayGroup
,
hosts
:
any
[])
{
const
locationPrefixes
=
gatewayGroup
.
locationPrefix
.
split
(
"
,
"
);
const
locationPrefixes
=
gatewayGroup
.
locationPrefix
.
split
(
"
,
"
);
...
@@ -209,12 +209,12 @@ class InventoryBuilder {
...
@@ -209,12 +209,12 @@ class InventoryBuilder {
host
.
dockerServices
=
{
host
.
dockerServices
=
{
version
:
'
2.4
'
,
version
:
'
2.4
'
,
services
:
{
services
:
{
bird
:
{
'
gateways-monitor
'
:
{
restart
:
'
always
'
,
restart
:
'
always
'
,
image
:
'
git-registry.mycard.moe/
nanahira/docker-bird
'
,
image
:
'
git-registry.mycard.moe/
railgun/gateways-monitor
'
,
network_mode
:
'
host
'
,
network_mode
:
'
host
'
,
cap_add
:
[
'
NET_ADMIN
'
],
cap_add
:
[
'
NET_ADMIN
'
],
volumes
:
[
'
./
bird.conf:/etc/bird/bird.conf
:ro
'
]
volumes
:
[
'
./
route-plans:/usr/src/app/route-plans
:ro
'
]
},
},
babeld
:
{
babeld
:
{
restart
:
'
always
'
,
restart
:
'
always
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment