infra(ansible): Various changes 02/43902/2
authorPeter Mikus <[email protected]>
Fri, 17 Oct 2025 04:01:40 +0000 (06:01 +0200)
committerPeter Mikus <[email protected]>
Fri, 17 Oct 2025 04:04:18 +0000 (04:04 +0000)
Signed-off-by: Peter Mikus <[email protected]>
Change-Id: I48c04e8422f4ceb49fff9b795a8ea2242fe1e806

fdio.infra.ansible/roles/calico/defaults/main.yaml
fdio.infra.ansible/roles/calico/tasks/main.yaml
fdio.infra.ansible/roles/calico/templates/calico-vpp.yaml.j2
fdio.infra.terraform/terraform-nomad-gha-dispatcher/main.tf
fdio.infra.terraform/terraform-nomad-gha-dispatcher/variables.tf

index f05e105..270d928 100644 (file)
@@ -7,7 +7,18 @@ kubernetes_pod_network:
 kubernetes_calico_version: "3.30.3"
 
 kubernetes_calico_resources:
-  - https://raw.githubusercontent.com/projectcalico/calico/v{{ kubernetes_calico_version }}/manifests/tigera-operator.yaml
-  - https://raw.githubusercontent.com/projectcalico/calico/v{{ kubernetes_calico_version }}/manifests/operator-crds.yaml
+  tigera-operator.yaml: https://raw.githubusercontent.com/projectcalico/calico/v{{ kubernetes_calico_version }}/manifests/tigera-operator.yaml
+  operator-crds.yaml: https://raw.githubusercontent.com/projectcalico/calico/v{{ kubernetes_calico_version }}/manifests/operator-crds.yaml
 
-calico_vpp_state: "present"
\ No newline at end of file
+calico_vpp_state: "present"
+
+calico_corelist_workers: "2,3,4,5,98,99,100,101"
+calico_uplink_interfaces:
+  - interfaceName: "enp56s0np0"
+    vppDriver: "avf"
+    rx: 8
+    rxMode: "polling"
+  - interfaceName: "enp58s0np0"
+    vppDriver: "avf"
+    rx: 8
+    rxMode: "polling"
\ No newline at end of file
index 3ec5fb3..f2bc633 100644 (file)
@@ -3,35 +3,44 @@
 
 - name: download calico manifest to the cluster
   ansible.builtin.get_url:
-    url: "https://raw.githubusercontent.com/projectcalico/calico/v3.30.3/manifests/{{ item }}"
-    dest: /tmp/{{ item }}
-    mode: '0664'
-  loop:
-    - "operator-crds.yaml"
-    - "tigera-operator.yaml"
-  when: >
-    calico_sut is defined
+    url: "{{ item.value }}"
+    dest: "/tmp/{{ item.key }}"
+    mode: "0664"
+  loop: "{{ kubernetes_calico_resources | dict2items }}"
+  when:
+    - calico_sut is defined
   tags:
     - kubernetes-calico-install
 
 - name: apply calico manifest to the cluster
   kubernetes.core.k8s:
     state: present
-    src: "/tmp/{{ item }}"
+    src: "/tmp/{{ item.key }}"
+  loop: "{{ kubernetes_calico_resources | dict2items }}"
+  when:
+    - calico_sut is defined
+  tags:
+    - kubernetes-calico-install
+
+- name: upload calico vpp manifest to the cluster
+  ansible.builtin.template:
+    dest: "/tmp/{{ item }}"
+    src: "{{ item }}.j2"
   loop:
-    - "operator-crds.yaml"
-    - "tigera-operator.yaml"
-  when: >
-    calico_sut is defined
+    - "calico-vpp.yaml"
+  when:
+    - calico_sut is defined
   tags:
     - kubernetes-calico-install
 
 - name: apply calico vpp manifest to the cluster
   kubernetes.core.k8s:
     state: "{{ calico_vpp_state }}"
-    template: "calico-vpp.yaml.j2"
-  when: >
-    calico_sut is defined
+    src: "/tmp/{{ item }}"
+  loop:
+    - "calico-vpp.yaml"
+  when:
+    - calico_sut is defined
   tags:
     - kubernetes-calico-install
 
@@ -43,6 +52,7 @@
     label_selectors:
       - k8s-app=calico-vpp-node
   register: pod_list
+  when: calico_sut is defined
   tags:
     - kubernetes-info
 
@@ -51,6 +61,9 @@
     calico_pod_name: "{{ item[0]['metadata']['name'] }}"
   loop:
     - "{{ pod_list['resources'] }}"
+  when:
+    - calico_sut is defined
+    - pod_list['resources'] | length > 0
   tags:
     - kubernetes-info
 
     container: vpp
     command: vppctl sh version
   register: command_status
-  when: >
-    calico_pod_name is defined
+  when:
+    - calico_pod_name is defined
+    - calico_sut is defined
+    - calico_vpp_state == "present"
   tags:
     - kubernetes-info
 
-- name: Check last command status
-  debug:
-    msg: "{{ command_status.stdout }}"
\ No newline at end of file
+- name: check last command status
+  ansible.builtin.debug:
+    msg: "{{ command_status.stdout }}"
+  when:
+    - calico_pod_name is defined
+    - calico_sut is defined
+    - calico_vpp_state == "present"
+  tags:
+    - kubernetes-info
\ No newline at end of file
index c09a85f..a8c0ede 100644 (file)
@@ -147,7 +147,7 @@ data:
     api-trace { on }
     cpu {
         main-core 1
-        corelist-workers 2,3,4,5,98,99,100,101
+        corelist-workers {{ calico_corelist_workers }}
     }
     socksvr {
         socket-name /var/run/vpp/vpp-api.sock
@@ -178,20 +178,7 @@ data:
       "vppHostTapSpec": {
         "rx": 1, "tx":1, "rxqsz": 1024, "txqsz": 1024, "isl3": false
       },
-      "uplinkInterfaces": [
-        {
-          "interfaceName": "enp56s0np0",
-          "vppDriver": "avf",
-          "rx": 8,
-          "rxMode": "polling"
-        },
-        {
-          "interfaceName": "enp58s0np0",
-          "vppDriver": "avf",
-          "rx": 8,
-          "rxMode": "polling"
-        }
-      ]
+      "uplinkInterfaces": {{ calico_uplink_interfaces | to_nice_json(indent=2) }}
     }
   SERVICE_PREFIX: 10.96.0.0/12
 kind: ConfigMap
index 9395bde..5d0af62 100644 (file)
@@ -1,7 +1,7 @@
 locals {
   datacenters = join(",", var.datacenters)
   flat_dispatchers = {
-    for dispatcher in var.dispatchers : dispatcher.namespace => dispatcher
+    for dispatcher in var.dispatchers : dispatcher.repository => dispatcher
   }
 }
 
index dd4b6b6..986d74b 100644 (file)
@@ -54,11 +54,19 @@ variable "dispatchers" {
   default = [
     {
       namespace  = "sandbox"
-      repository = "fdio-csit"
+      repository = "pmikus-csit"
+    },
+    {
+      namespace  = "sandbox"
+      repository = "pmikus-vpp"
     },
     {
       namespace  = "prod"
       repository = "fdio-csit"
     },
+    {
+      namespace  = "prod"
+      repository = "fdio-vpp"
+    }
   ]
 }
\ No newline at end of file