ip_metric.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Setting metric
  16. command: nmcli connection modify {{ item.name }} ipv4.route-metric {{ item.value }}
  17. with_items:
  18. - { name: "{{ public_nic }}", value: "{{ public_metric }}" }
  19. - { name: "{{ host_network_nic }}", value: "{{ host_metric }}" }
  20. changed_when: false
  21. - name: Reactivate the nics
  22. command: nmcli connection up {{ item.name }}
  23. with_items:
  24. - { name: "{{ public_nic }}" }
  25. - { name: "{{ host_network_nic }}" }
  26. changed_when: false
  27. - name: Set metric for device container
  28. command: nmcli connection modify {{ mngmnt_network_nic }} ipv4.route-metric {{ mngmnt_metric }}
  29. changed_when: false
  30. when: device_config_support
  31. - name: Reactivate the device nic
  32. command: nmcli connection up {{ mngmnt_network_nic }}
  33. changed_when: false
  34. when: device_config_support
  35. - name: Set metric for ib nic
  36. command: nmcli connection modify {{ ib_network_nic }} ipv4.route-metric {{ ib_metric }}
  37. changed_when: false
  38. when: ib_switch_support
  39. - name: Reactivate the ib nic
  40. command: nmcli connection up {{ ib_network_nic }}
  41. changed_when: false
  42. when: ib_switch_support