- name: workstation has ip6 delegate_to: localhost run_once: true become: true shell: executable: /bin/bash cmd: | set -e if [[ {{ansible_check_mode}} = True ]]; then ifconfig kvmbr0 | grep inet6 | grep -v fe80 || echo WILL ADD IP6 DURING PLAY else ifconfig kvmbr0 | grep inet6 | grep -v fe80 || ip addr add baaf::baaf:1/112 dev kvmbr0 && echo done fi changed_when: false check_mode: false register: output #- debug: var=output.stdout # assuming kvmbr0 bridge name not default virbr0 # we need to make sure the routes are not using dummybr0 (internal bridge) - name: workstation reaches ip6 network within delegate_to: localhost run_once: true become: true shell: executable: /bin/bash cmd: | set -e if [[ {{ansible_check_mode}} = True ]]; then netstat -6rn | grep ^beef::beef | grep kvmbr0 || echo WILL ADD beef::beef ROUTE DURING PLAY netstat -6rn | grep ^beef::/64 | grep kvmbr0 || echo WILL ADD beef:: ROUTE DURING PLAY else netstat -6rn | grep ^beef::beef | grep kvmbr0 || ip route add beef::beef:0/122 via baaf::baaf:21 && echo done netstat -6rn | grep ^beef::/64 | grep kvmbr0 || ip route add beef::/64 via baaf::baaf:21 && echo done fi changed_when: false check_mode: false register: output when: type.startswith('nat4400') #- debug: var=output.stdout # run_once: true # when: type.startswith('nat4400') - name: no ip6 routes on dummy bridges delegate_to: localhost run_once: true become: true shell: executable: /bin/bash cmd: | set -e netstat -6rn | grep dummybr || true changed_when: false check_mode: false register: output when: type.startswith('nat4400') #- debug: var=output.stdout # run_once: true # when: type.startswith('nat4400')