From 26824ca6bb4c562f87f1645629a0586554b7044c Mon Sep 17 00:00:00 2001 From: Sandwich Date: Wed, 30 Oct 2024 18:04:46 +0100 Subject: [PATCH] Improve Ip set on VMware hypervisors --- roles/environment/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/environment/tasks/main.yml b/roles/environment/tasks/main.yml index 3b6958f..aea2e6d 100644 --- a/roles/environment/tasks/main.yml +++ b/roles/environment/tasks/main.yml @@ -28,13 +28,13 @@ - name: Set IP-Address when: hypervisor == "vmware" - ansible.builtin.command: ip addr replace {{ ansible_host }}/24 dev {{ interface_name.stdout }} + ansible.builtin.command: "ip addr replace {{ ansible_host }}/{{ vm_nms | default(24) }} dev {{ interface_name.stdout }}" changed_when: result.rc == 0 register: result - name: Set Default Gateway when: hypervisor == "vmware" - ansible.builtin.command: ip route replace default via {{ vm_gw }} + ansible.builtin.command: "ip route replace default via {{ vm_gw }}" changed_when: result.rc == 0 register: result