Commit 6ded7cc6 authored by nanahira's avatar nanahira

async and migrate image

parent 5999d343
......@@ -32,8 +32,8 @@
name: '{{item}}'
source: pull
with_items:
- git-registry.mycard.moe/nanahira/docker-smartdns
- git-registry.mycard.moe/nanahira/dnsmasq:original
- git-registry.moenext.com/nanahira/docker-smartdns
- git-registry.moenext.com/nanahira/dnsmasq:original
- name: clean some rubbish packages
become: true
apt:
......
......@@ -76,7 +76,9 @@ handle_gateway() {
ip rule add pref 100 fwmark "$GATEWAY_NEXT_HOP_MARK" lookup "$GATEWAY_NEXT_HOP_MARK"
ip rule add pref 400 fwmark "$GATEWAY_SELECTION_MARK" lookup "$GATEWAY_NEXT_HOP_MARK"
{% if not br.noOrigin | default(false) %}
eth_origin -I "$BRIDGE_NAME" "$GATEWAY_ID" "$GATEWAY_ADDRESS" "$GATEWAY_MAC"
{% endif %}
}
{% if br.gateways is defined and br.gateways %}
......
......@@ -25,7 +25,9 @@ handle_gateway() {
ip rule del pref 100 fwmark "$GATEWAY_NEXT_HOP_MARK" lookup "$GATEWAY_NEXT_HOP_MARK"
ip rule del pref 400 fwmark "$GATEWAY_SELECTION_MARK" lookup "$GATEWAY_NEXT_HOP_MARK"
{% if not br.noOrigin | default(false) %}
eth_origin -D "$BRIDGE_NAME" "$GATEWAY_ID" "$GATEWAY_ADDRESS" "$GATEWAY_MAC"
{% endif %}
}
{% if br.gateways is defined and br.gateways %}
......
......@@ -11,8 +11,10 @@ export BRIDGE_NAME={{br.name}}
{% for link in br.links %}
# link {{link}}
{% if not (br.noWaitUp | default(false)) %}
## Ensure link is up
_wait_for_interface_online "{{link}}"
{% endif %}
{% if br.macvlan is defined and br.macvlan %}
## macvlan {{br.name}}{{link | regex_replace('\.', '')}} of {{link}}
......
......@@ -6,7 +6,7 @@ services:
{% if br.dhcpv6Receive is defined and br.dhcpv6Receive %}
dhcpv6-{{srcbr.name}}-{{br.name}}:
restart: always
image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client
image: git-registry.moenext.com/nanahira/docker-dhcpv6-client
network_mode: host
cap_add:
- NET_ADMIN
......@@ -23,7 +23,7 @@ services:
{% for br in bridges %}
{% if br.dhcpv6Receive is defined and br.dhcpv6Receive %}
dhcpv6-ppp{{ppp.id}}-{{br.name}}:
image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client
image: git-registry.moenext.com/nanahira/docker-dhcpv6-client
network_mode: host
cap_add:
- NET_ADMIN
......
......@@ -3,7 +3,7 @@ services:
{% if not (smartdns.external is defined and smartdns.external) %}
smartdns:
restart: always
image: git-registry.mycard.moe/nanahira/docker-smartdns
image: git-registry.moenext.com/nanahira/docker-smartdns
network_mode: host
command: -f -x -c /etc/smartdns/smartdns.conf
volumes:
......@@ -12,7 +12,7 @@ services:
{% endif %}
dnsmasq:
restart: always
image: git-registry.mycard.moe/nanahira/dnsmasq:original
image: git-registry.moenext.com/nanahira/dnsmasq:original
network_mode: host
cap_add:
- NET_ADMIN
......
......@@ -88,8 +88,12 @@ iface {{vlan.link}}.{{vlan.tag}} inet6 manual
{% for br in bridges %}
## {{br.name}}
{% if br.async | default(false) %}
auto {{br.name}} &
{% else %}
auto {{br.name}}
allow-hotplug {{br.name}}
{% endif %}
iface {{br.name}} inet {{br.type}}
{% if not (br.direct is defined and br.direct) %}
{% if br.links is defined and br.links and br.links | length > 0 %}
......@@ -140,8 +144,12 @@ mtu {{br.mtu}}
{% if ppps is defined and ppps %}
{% for ppp in ppps %}
## ppp{{ppp.id}}
{% if br.async | default(false) %}
auto ppp{{ppp.id}} &
{% else %}
auto ppp{{ppp.id}}
allow-hotplug ppp{{ppp.id}}
{% endif %}
iface ppp{{ppp.id}} inet ppp
pre-up {{ansible_user_dir}}/nextgen-router/scripts/ppp{{ppp.id}}/pre-up.sh
post-down {{ansible_user_dir}}/nextgen-router/scripts/ppp{{ppp.id}}/post-down.sh
......
......@@ -2,12 +2,12 @@ version: '2.4'
services:
lldpd:
restart: always
image: git-registry.mycard.moe/nanahira/docker-lldp
image: git-registry.moenext.com/nanahira/docker-lldp
network_mode: host
{% if gdut is defined and gdut %}
drcom:
restart: always
image: git-registry.mycard.moe/nanahira/gdut-drcom
image: git-registry.moenext.com/nanahira/gdut-drcom
network_mode: host
command: --remote-ip {{gdut.remote}} --keep-alive1-flag {{gdut.flag}} --enable-crypt 1
{% endif %}
......@@ -24,7 +24,7 @@ services:
{% if dnsmasq.aptCacher is defined and (dnsmasq.aptCacher == "localhost" or (dnsmasq.aptCacher.localhost is defined and dnsmasq.aptCacher.localhost)) %}
apt-cacher-ng:
restart: always
image: git-registry.mycard.moe/nanahira/apt-cacher-ng-docker:latest
image: git-registry.moenext.com/nanahira/apt-cacher-ng-docker:latest
environment:
UPSTREAM_MIRROR: {{ dnsmasq.aptCacher.upstream | default('http://mirrors.tuna.tsinghua.edu.cn') }}
ports:
......@@ -50,7 +50,7 @@ services:
- ./pxe/menus:/data
pxe-nginx:
restart: always
image: git-registry.mycard.moe/nanahira/docker-nginx-plus
image: git-registry.moenext.com/nanahira/docker-nginx-plus
ports:
- '{{services.address}}:16980:16980'
volumes:
......
......@@ -51,15 +51,15 @@
name: '{{item}}'
source: pull
with_items:
- git-registry.mycard.moe/nanahira/docker-smartdns
- git-registry.mycard.moe/nanahira/dnsmasq:original
- git-registry.mycard.moe/nanahira/docker-dhcpv6-client
- git-registry.mycard.moe/nanahira/docker-lldp
- git-registry.mycard.moe/nanahira/gdut-drcom
- git-registry.moenext.com/nanahira/docker-smartdns
- git-registry.moenext.com/nanahira/dnsmasq:original
- git-registry.moenext.com/nanahira/docker-dhcpv6-client
- git-registry.moenext.com/nanahira/docker-lldp
- git-registry.moenext.com/nanahira/gdut-drcom
- teddysun/kms
- git-registry.mycard.moe/nanahira/apt-cacher-ng-docker:latest
- git-registry.moenext.com/nanahira/apt-cacher-ng-docker:latest
- wastrachan/tftpd
- git-registry.mycard.moe/nanahira/docker-nginx-plus
- git-registry.moenext.com/nanahira/docker-nginx-plus
- oznu/cloudflare-ddns
- cturra/ntp
handlers:
......
- name: pull images
docker_image:
name: '{{item}}'
source: pull
with_items:
- git-registry.mycard.moe/railgun/gateways-monitor
- git-registry.mycard.moe/railgun/babeld
- git-registry.mycard.moe/railgun/ocserv
- git-registry.mycard.moe/railgun/openconnect
- git-registry.mycard.moe/nanahira/gost
- git-registry.mycard.moe/railgun/tun:new
#- git-registry.mycard.moe/railgun/railgun-routing-client
- name: image for arp
- name: Define Docker images array
set_fact:
mcnetwork_docker_images:
- git-registry.moenext.com/railgun/gateways-monitor
- git-registry.moenext.com/railgun/babeld
- git-registry.moenext.com/railgun/ocserv
- git-registry.moenext.com/railgun/openconnect
- git-registry.moenext.com/nanahira/gost
- git-registry.moenext.com/railgun/tun:new
# - git-registry.moenext.com/railgun/railgun-routing-client
- name: Add warp-proxy image to mcnetwork_docker_images if architecture is x86_64
set_fact:
mcnetwork_docker_images: "{{ mcnetwork_docker_images + ['git-registry.moenext.com/nanahira/warp-proxy'] }}"
when: ansible_architecture == 'x86_64'
- name: Pull Docker images
docker_image:
name: git-registry.mycard.moe/nanahira/warp-proxy
name: '{{ item }}'
source: pull
when: ansible_architecture == 'x86_64'
with_items: "{{ mcnetwork_docker_images }}"
- name: Tag Docker images
shell: |
{% for image in mcnetwork_docker_images %}
docker tag {{ image }} {{ image | regex_replace('git-registry.moenext.com', 'git-registry.mycard.moe') }}
{% endfor %}
changed_when: false
- name: debian packages
become: true
apt:
......
......@@ -47,6 +47,9 @@ vars:
file: somefile.txt
address: 10.0.0.4
interfaces_custom: '' # 自定义条目
noWaitUp: false # 不等待链路有效
noOrigin: false # 不设置源进源出规则
async: false # 异步启动,不等待系统开机
- name: brwan
links:
- bond0.2
......
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