---
# file: tasks/main.yaml
+- name: pre-setup network interface
+ ansible.builtin.shell: |
+ ip l set dev {{ item.interfaceName }} up
+ ip a add {{ item.ip_addr }} dev {{ item.interfaceName }}
+ loop: "{{ calico_uplink_interfaces }}"
+ ignore_errors: True
+ when:
+ - calico_sut is defined
+ - calico_vpp_state == "present"
+ tags:
+ - kubernetes-reset
+
- name: download calico manifest to the cluster
ansible.builtin.get_url:
url: "{{ item.value }}"
when:
- calico_sut is defined
tags:
- - kubernetes-calico-install
+ - kubernetes-calico
- name: apply calico manifest to the cluster
kubernetes.core.k8s:
when:
- calico_sut is defined
tags:
- - kubernetes-calico-install
+ - kubernetes-calico
- name: upload calico vpp manifest to the cluster
ansible.builtin.template:
when:
- calico_sut is defined
tags:
- - kubernetes-calico-install
+ - kubernetes-calico
- name: apply calico vpp manifest to the cluster
kubernetes.core.k8s:
when:
- calico_sut is defined
tags:
- - kubernetes-calico-install
+ - kubernetes-calico
- name: get a list of all pods from any namespace
kubernetes.core.k8s_info:
- calico_sut is defined
- calico_vpp_state == "present"
tags:
- - kubernetes-info
\ No newline at end of file
+ - kubernetes-info
+
+- name: reset network interface
+ ansible.builtin.shell: |
+ python3 /opt/dpdk/usertools/dpdk-devbind.py -b none {{ item.pci }} --force
+ python3 /opt/dpdk/usertools/dpdk-devbind.py -b ice {{ item.pci }}
+ loop: "{{ calico_uplink_interfaces }}"
+ when:
+ - calico_sut is defined
+ - calico_vpp_state == "absent"
+ tags:
+ - kubernetes-reset
\ No newline at end of file
"vppHostTapSpec": {
"rx": 1, "tx":1, "rxqsz": 1024, "txqsz": 1024, "isl3": false
},
- "uplinkInterfaces": {{ calico_uplink_interfaces | to_nice_json(indent=2) }}
+ "uplinkInterfaces": [
+{% for interface in calico_uplink_interfaces %}
+ {
+ "interfaceName": "{{ interface.interfaceName }}",
+ "vppDriver": "{{ interface.vppDriver }}",
+ "rx": {{ interface.rx }},
+ "rxMode": "{{ interface.rxMode }}"
+ }{{ "," if not loop.last }}
+{% endfor %}
+ ]
}
SERVICE_PREFIX: 10.96.0.0/12
kind: ConfigMap