From 1a2af5670e4e075708b43e033ad2cedddd511a8c Mon Sep 17 00:00:00 2001 From: Brielle Bruns Date: Sun, 13 May 2018 21:18:43 -0600 Subject: [PATCH] no message --- config | 2 ++ network/network-config-dhcp-v1 | 2 -- network/network-config-v1 | 10 +++++----- virt-install-cloud.sh | 5 +++++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/config b/config index f7770f2..0e50995 100644 --- a/config +++ b/config @@ -23,3 +23,5 @@ FORMAT=raw # convert image format : yes or no CONVERT=yes +# Addresses to use by default for name servers +nameservers="8.8.8.8, 1.1.1.1" \ No newline at end of file diff --git a/network/network-config-dhcp-v1 b/network/network-config-dhcp-v1 index 874496b..6df1c09 100644 --- a/network/network-config-dhcp-v1 +++ b/network/network-config-dhcp-v1 @@ -6,5 +6,3 @@ config: name: eth0 subnets: - type: dhcp -- type: nameserver - search: [%DOMAIN%] \ No newline at end of file diff --git a/network/network-config-v1 b/network/network-config-v1 index 2c650c9..e39a7f7 100644 --- a/network/network-config-v1 +++ b/network/network-config-v1 @@ -6,12 +6,12 @@ config: name: eth0 subnets: - type: static - address: %%IP_ADDRESS%% - netmask: %%NETMASK%% + address: %IP_ADDRESS% + netmask: %NETMASK% routes: - network: 0.0.0.0 netmask: 0.0.0.0 - gateway: %%GATEWAY%% + gateway: %GATEWAY% - type: nameserver - address: [%%NAME_SERVER%%] - search: [%%DOMAIN%%] \ No newline at end of file + address: [%NAME_SERVER%] + search: [%DOMAIN%] \ No newline at end of file diff --git a/virt-install-cloud.sh b/virt-install-cloud.sh index f131839..5a8b6a7 100755 --- a/virt-install-cloud.sh +++ b/virt-install-cloud.sh @@ -134,6 +134,11 @@ elif [[ $virt_netinfo_type == "1" ]]; then if [[ ${virt_netinfo_address} == "dhcp" ]]; then sed -e "s/%DOMAIN%/${domain}/" ${WORKING_DIR}/network/network-config-dhcp-v1 > ${WORKING_DIR}/output/network-config extra_iso_files=" -map $WORKING_DIR/output/network-config network-config" + else + sed -e "s/%DOMAIN%/${domain}/" -e "s/%IP_ADDRESS%/${virt_netinfo_address}/" -e "s/%NETMASK%/${virt_netinfo_netmask}/" \ + -e "s/%GATEWAY%/${virt_netinfo_gateway}/" -e "s/%NAME_SERVER%/${nameservers}/" \ + ${WORKING_DIR}/network/network-config-v1 > ${WORKING_DIR}/output/network-config + extra_iso_files=" -map $WORKING_DIR/output/network-config network-config" fi elif [[ $virt_netinfo_type == "2" ]]; then echo "Not implemented yet!"