Commit e6c30a2c authored by nanahira's avatar nanahira

simplify

parent f25499df
version: '2.4' version: '2.4'
services: services:
{% for ppp in ppps %} {% for srcbr in bridges %}
{% if ppp.dhcpv6Client is defined and ppp.dhcpv6Client %} {% if srcbr.dhcpv6Client is defined and srcbr.dhcpv6Client %}
{% for br in bridges %} {% for br in bridges %}
{% if br.dhcpv6Receive is defined and br.dhcpv6Receive %} {% if br.dhcpv6Receive is defined and br.dhcpv6Receive %}
dhcpv6-ppp{{ppp.id}}-{{br.name}}: dhcpv6-{{srcbr.name}}-{{br.name}}:
restart: always
image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client
network_mode: host network_mode: host
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
environment: environment:
WAN_INTERFACE: ppp{{ppp.id}} WAN_INTERFACE: {{srcbr.name}}
LAN_INTERFACE: {{br.name}} LAN_INTERFACE: {{br.name}}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for srcbr in bridges %} {% if ppps is defined and ppps %}
{% if srcbr.dhcpv6Client is defined and srcbr.dhcpv6Client %} {% for ppp in ppps %}
{% if ppp.dhcpv6Client is defined and ppp.dhcpv6Client %}
{% for br in bridges %} {% for br in bridges %}
{% if br.dhcpv6Receive is defined and br.dhcpv6Receive %} {% if br.dhcpv6Receive is defined and br.dhcpv6Receive %}
dhcpv6-{{srcbr.name}}-{{br.name}}: dhcpv6-ppp{{ppp.id}}-{{br.name}}:
restart: always
image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client
network_mode: host network_mode: host
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
environment: environment:
WAN_INTERFACE: {{srcbr.name}} WAN_INTERFACE: ppp{{ppp.id}}
LAN_INTERFACE: {{br.name}} LAN_INTERFACE: {{br.name}}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %}
...@@ -24,15 +24,19 @@ force-AAAA-SOA yes ...@@ -24,15 +24,19 @@ force-AAAA-SOA yes
dualstack-ip-selection yes dualstack-ip-selection yes
{% endif %} {% endif %}
{% if ssmartdns.tls_dns is defined and smartdns.tls_dns %}
# TLS DNSes # TLS DNSes
{% for dns in smartdns.tls_dns %} {% for dns in smartdns.tls_dns %}
server-tls {{dns}} -group tls server-tls {{dns}} -group tls
{% endfor %} {% endfor %}
{% endfor %}
{% if ssmartdns.tls_dns is defined and smartdns.tls_dns %}
# HTTPS DNSes # HTTPS DNSes
{% for dns in smartdns.https_dns %} {% for dns in smartdns.https_dns %}
server-https {{dns}} -group tls server-https {{dns}} -group tls
{% endfor %} {% endfor %}
{% endfor %}
# China DNSes # China DNSes
{% for dns in smartdns.china_dns %} {% for dns in smartdns.china_dns %}
......
...@@ -19,7 +19,7 @@ iface {{link.name}} inet6 manual ...@@ -19,7 +19,7 @@ iface {{link.name}} inet6 manual
# end Links # end Links
{% if bonds is defined and bonds and bonds | length > 0 %} {% if bonds is defined and bonds %}
# Bonds # Bonds
{% for bond in bonds %} {% for bond in bonds %}
...@@ -44,7 +44,7 @@ bond-xmit-hash-policy layer2+3 ...@@ -44,7 +44,7 @@ bond-xmit-hash-policy layer2+3
# end bonds # end bonds
{% endif %} {% endif %}
{% if vlans is defined and vlans and vlans | length > 0 %} {% if vlans is defined and vlans %}
# Vlans # Vlans
{% for vlan in vlans %} {% for vlan in vlans %}
...@@ -94,6 +94,7 @@ pre-down {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-down.sh ...@@ -94,6 +94,7 @@ pre-down {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-down.sh
# PPPs # PPPs
{% if ppps is defined and ppps %}
{% for ppp in ppps %} {% for ppp in ppps %}
## ppp{{ppp.id}} ## ppp{{ppp.id}}
auto ppp{{ppp.id}} auto ppp{{ppp.id}}
...@@ -106,3 +107,4 @@ provider ppp{{ppp.id}} ...@@ -106,3 +107,4 @@ provider ppp{{ppp.id}}
{% endfor %} {% endfor %}
# end PPPs # end PPPs
{% endif %}
...@@ -4,6 +4,7 @@ services: ...@@ -4,6 +4,7 @@ services:
restart: always restart: always
image: git-registry.mycard.moe/nanahira/docker-lldp image: git-registry.mycard.moe/nanahira/docker-lldp
network_mode: host network_mode: host
{% if services.ddns is defined and services.ddns %}
{% for instance in services.ddns %} {% for instance in services.ddns %}
ddns-{{instance.name}}: ddns-{{instance.name}}:
restart: always restart: always
...@@ -24,3 +25,4 @@ services: ...@@ -24,3 +25,4 @@ services:
RRTYPE: A RRTYPE: A
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %}
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
with_items: with_items:
- pap - pap
- chap - chap
when: pppoeUsers is defined and pppoeUsers and pppoeUsers | length > 0 when: pppoeUsers is defined and pppoeUsers
- name: pppoe post scripts - name: pppoe post scripts
become: true become: true
template: template:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment