diff --git a/roles/simulator/tasks/install.yml b/roles/simulator/tasks/install.yml index b8d5a24..6e70883 100644 --- a/roles/simulator/tasks/install.yml +++ b/roles/simulator/tasks/install.yml @@ -52,9 +52,13 @@ mode: u+x when: inventory_hostname in groups['ueransim_nodes'] +- set_fact: + subnet: "{{ core.upf.access_subnet | regex_replace('[0-9]+/24', '0/24') }}" + when: inventory_hostname in groups['ueransim_nodes'] + - name: configure static route for upf traffic on ueransim node shell: | - ip route add {{ core.upf.ip_prefix }} via {{ core.amf.ip }} + ip route add {{ subnet }} via {{ core.amf.ip }} become: true when: (inventory_hostname in groups['ueransim_nodes']) and (inventory_hostname not in groups['master_nodes']) @@ -62,12 +66,12 @@ # - name: copy iperf server deployment files to aether host # template: -# src: "{{ ROOT_DIR }}/deps/ueransim/roles/simulator/template/iperf-server.yaml" +# src: "{{ ROOT_DIR }}/deps/ueransim/roles/simulator/templates/iperf-server.yaml" # dest: /tmp/iperf-server.yaml # become: true # when: inventory_hostname in groups['master_nodes'] -# - name: Create iperf-server pod in omec namespace +# - name: Create iperf-server pod in aether-5gc namespace # kubernetes.core.k8s: # kubeconfig: "{{ ansible_user_dir }}/.kube/config" # state: present diff --git a/roles/simulator/tasks/start.yml b/roles/simulator/tasks/start.yml index c9cd5f4..e6d7d60 100644 --- a/roles/simulator/tasks/start.yml +++ b/roles/simulator/tasks/start.yml @@ -71,7 +71,7 @@ # - name: Get information about the pod # kubernetes.core.k8s_info: # kind: Pod -# namespace: omec +# namespace: aether-5gc # name: iperf-server # when: inventory_hostname in groups['master_nodes'][0] # register: iperf_server_pod_info diff --git a/roles/simulator/tasks/uninstall.yml b/roles/simulator/tasks/uninstall.yml index 6ca6a63..1428f80 100644 --- a/roles/simulator/tasks/uninstall.yml +++ b/roles/simulator/tasks/uninstall.yml @@ -19,9 +19,13 @@ become: true when: inventory_hostname in groups['ueransim_nodes'] -- name: configure static route for upf traffic on ueransim node +- set_fact: + subnet: "{{ core.upf.access_subnet | regex_replace('[0-9]+/24', '0/24') }}" + when: inventory_hostname in groups['ueransim_nodes'] + +- name: remove static route for upf traffic on ueransim node shell: | - ip route del {{ core.upf.ip_prefix }} via {{ core.amf.ip }} + ip route del {{ subnet }} via {{ core.amf.ip }} when: (inventory_hostname in groups['ueransim_nodes']) and (inventory_hostname not in groups['master_nodes']) become: true ignore_errors: yes diff --git a/roles/simulator/template/iperf-server.yaml b/roles/simulator/templates/iperf-server.yaml similarity index 86% rename from roles/simulator/template/iperf-server.yaml rename to roles/simulator/templates/iperf-server.yaml index fb29663..a961bea 100644 --- a/roles/simulator/template/iperf-server.yaml +++ b/roles/simulator/templates/iperf-server.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Pod metadata: name: iperf-server - namespace: omec + namespace: aether-5gc labels: app: iperf-server spec: @@ -19,7 +19,7 @@ apiVersion: v1 kind: Service metadata: name: iperf-service - namespace: omec # Change this if your pod is in a different namespace + namespace: aether-5gc # Change if iperf is to run in a different namespace spec: selector: app: iperf-server # Ensure this matches the labels of the Pod