Commit 590d2a9d authored by nanahira's avatar nanahira

rename

parent 4024ab2e
- hosts: switch
remote_user: root
tasks:
- name: load vars
include_vars:
file: '../result/{{item}}.yaml'
with_items:
- global-vars
- vars-{{inventory_hostname_short}}
- name: post scripts
template:
src: scripts/{{item}}.sh.j2
dest: '{{ansible_user_dir}}/nextgen-network/scripts/{{item}}.sh'
mode: a+x
with_items:
- postup
- predown
- global-postup
- utility
- switch-rules-up
- switch-rules-down
- ocserv-postup
- ocserv-predown
- name: migrate
become: true
shell: |
{% for interface in masqInterfaces %}
iptables -t mangle -A NEXTGEN_ORIGIN -i {{item.name}} ! -p ospf -m set ! --match-set mycard src -j CONNMARK --set-xmark {{interface.mark}}
iptables -t mangle -A NEXTGEN_ORIGIN -m connmark --mark {{item.mark}} -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff
iptables -t mangle -A OUTPUT -m connmark --mark {{item.mark}} -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff
# TODO: ip rule
# ip rule add pref 300 fwmark {{item.mark}} lookup {{item.mark}}
{% endfor %}
with_items: '{{masqInterfaces}}'
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