From 8eaf39fbd7b2c6b3b3228d6be7fe22628c94fe25 Mon Sep 17 00:00:00 2001 From: DogeyStamp Date: Fri, 4 Mar 2022 07:30:09 -0500 Subject: [PATCH] Use proper subnet in nmcli --- group_vars/all/vars.yml | 3 +++ roles/networking/connection/tasks/main.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index 2bc1d7f..df2fe04 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -64,6 +64,9 @@ dns_forward: 1.1.1.1 # Local IP address subnet local_subnet: 192.168.0.0/24 + +# CIDR prefix +subnet_prefix: /24 # Static address of the server (locally) # Preferably have another one to SSH into with Ansible, as we change the IP midway diff --git a/roles/networking/connection/tasks/main.yml b/roles/networking/connection/tasks/main.yml index 80ba822..b10a320 100644 --- a/roles/networking/connection/tasks/main.yml +++ b/roles/networking/connection/tasks/main.yml @@ -42,7 +42,7 @@ community.general.nmcli: dns4: "{{ dns_forward }}" dns4_ignore_auto: yes - ip4: "{{ local_ip }}" + ip4: "{{ local_ip }}{{ subnet_prefix }}" method4: manual state: present conn_name: wired