c12s-kubespray/roles/network_plugin/calico/tasks/reset.yml
Etienne Champetier de1d9df787
Only use stat get_checksum: yes when needed (#7270)
By default Ansible stat module compute checksum, list extended attributes and find mime type
To find all stat invocations that really use one of those:
git grep -F stat. | grep -vE 'stat.(islnk|exists|lnk_source|writeable)'

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
2021-02-10 05:36:59 -08:00

23 lines
625 B
YAML

---
- name: reset | check dummy0 network device
stat:
path: /sys/class/net/dummy0
get_attributes: no
get_checksum: no
get_mime: no
register: dummy0
- name: reset | remove the network device created by calico
command: ip link del dummy0
when: dummy0.stat.exists
- name: reset | get remaining routes set by bird
command: ip route show proto bird
changed_when: false
register: bird_routes
- name: reset | remove remaining routes set by bird # noqa 301
command: "ip route del {{ bird_route }} proto bird"
with_items: "{{ bird_routes.stdout_lines }}"
loop_control:
loop_var: bird_route