Commit 37cae6ea authored by nanahira's avatar nanahira

Merge branch 'systemd' into legacy

parents 69100ad9 e66e88c6
......@@ -35,6 +35,29 @@
shell: '{{ansible_user_dir}}/nextgen-network/scripts/global-postup.sh'
args:
creates: /tmp/mycard_global_postup_done
- name: global-postup systemd
become: true
copy:
content: |
[Unit]
Description=Railgun Router Global Setup
Before=network-online.target
After=network-pre.target
[Service]
Type=oneshot
ExecStart={{ansible_user_dir}}/nextgen-router/scripts/global-postup.sh
[Install]
WantedBy=mutli-user.target
dest: /etc/systemd/system/railgun-global-setup.service
register: global_systemd_result
- name: systemd
become: global-postup systemd enable
systemd:
name: railgun-global-setup
enabled: true
daemon_reload: '{{global_systemd_result.changed}}'
- name: mycard ipset create
become: true
shell: 'ipset create mycard hash:net maxelem 1000000 || true'
......
......@@ -18,10 +18,10 @@ def write_yaml_file(name, data):
universe = IPSet(['0.0.0.0/0'])
special = IPSet([line.strip() for line in open('special.txt')])
chnroutes = IPSet([line.strip() for line in open('chnroutes.txt') if not line.startswith('#')])
result = { 'chnroute_reverse': [] }
result = { 'chnrouter': [] }
chnroute_reverse = universe - special - chnroutes
for route in chnroute_reverse.iter_cidrs():
result['chnroute_reverse'].append(str(route))
chnrouter = universe - special - chnroutes
for route in chnrouter.iter_cidrs():
result['chnrouter'].append(str(route))
write_yaml_file("result.yaml", result)
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