Переглянути джерело

Create ip_metric.yml

Signed-off-by: Shubhangi-dell <shubhangi_srivastava@dell.com>
Shubhangi-dell 3 роки тому
батько
коміт
c05c680982

+ 48 - 0
control_plane/roles/control_plane_common/tasks/ip_metric.yml

@@ -0,0 +1,48 @@
+#  Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+---
+
+- name: Setting metric
+  command: nmcli connection modify {{ item.name }} ipv4.route-metric {{ item.value }}
+  with_items:
+    - { name: "{{ public_nic }}", value: "{{ public_metric }}" }
+    - { name: "{{ host_network_nic }}", value: "{{ host_metric }}" }
+  changed_when: false
+
+- name: Reactivate the nics
+  command: nmcli connection up {{ item.name }}
+  with_items:
+    - { name: "{{ public_nic }}" }
+    - { name: "{{ host_network_nic }}" }
+  changed_when: false
+
+- name: Set metric for device container
+  command: nmcli connection modify {{ mngmnt_network_nic }} ipv4.route-metric {{ mngmnt_metric }}
+  changed_when: false
+  when: device_config_support
+
+- name: Reactivate the device nic
+  command: nmcli connection up {{ mngmnt_network_nic }}
+  changed_when: false
+  when: device_config_support
+
+- name: Set metric for ib nic
+  command: nmcli connection modify {{ ib_network_nic }} ipv4.route-metric {{ ib_metric }}
+  changed_when: false
+  when: ib_switch_support
+
+- name: Reactivate the ib nic
+  command: nmcli connection up {{ ib_network_nic }}
+  changed_when: false
+  when: ib_switch_support