From 049858de99c9d63e736d04339391d3e115d0b8cf Mon Sep 17 00:00:00 2001 From: DogeyStamp Date: Sun, 6 Mar 2022 19:36:53 -0500 Subject: [PATCH] Add gateway setting to nmcli --- group_vars/all/vars.yml | 3 +++ roles/networking/connection/tasks/main.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index df2fe04..98c60f5 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -73,6 +73,9 @@ subnet_prefix: /24 # in connection.yml local_ip: 192.168.0.3 +# Gateway address (this is your router's IP) +gateway: 192.168.0.1 + # Connection interface for static IP interface: eth0 diff --git a/roles/networking/connection/tasks/main.yml b/roles/networking/connection/tasks/main.yml index 355edab..d3f4690 100644 --- a/roles/networking/connection/tasks/main.yml +++ b/roles/networking/connection/tasks/main.yml @@ -43,6 +43,7 @@ dns4: "{{ dns_forward }}" dns4_ignore_auto: yes ip4: "{{ local_ip }}{{ subnet_prefix }}" + gw4: "{{ gateway }}" method4: manual state: present conn_name: wired