From 7eca3fb0d07231c00de62a146edec051a1bb8e99 Mon Sep 17 00:00:00 2001 From: Neill Cox Date: Mon, 25 Sep 2023 18:23:26 +1000 Subject: [PATCH] Another network config attempt --- src/virt-install/user-data.tpl | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/virt-install/user-data.tpl b/src/virt-install/user-data.tpl index 0b24be6..4df6ea1 100644 --- a/src/virt-install/user-data.tpl +++ b/src/virt-install/user-data.tpl @@ -7,11 +7,11 @@ chpasswd: {{expire: False}} ssh_pwauth: True ssh_authorized_keys: - {data.public_key} -bootcmd: - - "nmcli conn delete 'System eth0'" - - "nmcli conn delete 'Wired connection 1'" - - "nmcli con add con-name eth0 ifname eth0 type ethernet ip4 {data.cidr_1} gw4 {data.gateway} ipv4.dns {data.dns}" - - "nmcli con add con-name eth1 ifname eth1 type ethernet ip4 {data.cidr_2} gw4 {data.gateway} ipv4.dns {data.dns}" +# bootcmd: +# - "nmcli conn delete 'System eth0'" +# - "nmcli conn delete 'Wired connection 1'" +# - "nmcli con add con-name eth0 ifname eth0 type ethernet ip4 {data.cidr_1} gw4 {data.gateway} ipv4.dns {data.dns}" +# - "nmcli con add con-name eth1 ifname eth1 type ethernet ip4 {data.cidr_2} gw4 {data.gateway} ipv4.dns {data.dns}" runcmd: - "subscription-manager register --username {data.rhn_user} --password '{data.rhn_password}'" - "subscription-manager release --set=8.4" @@ -29,3 +29,21 @@ runcmd: - "echo *** ***" - "echo ***************************************************************************" - "reboot" +network: + version: 1 + config: + - type: physical + name: eth0 + subnets: + - type: static + address: {data.cidr_1} + gateway: {data.gateway} + dns: {data.dns} + - type: physical + name: eth1 + subnets: + - type: static + address: {data.cidr_2} + gateway: {data.gateway} + dns: {data.dns} +