From 3a1c466d5aca9226ac58d806bc08106822d22a9a Mon Sep 17 00:00:00 2001 From: Muhammad Hussein Fattahizdeh Date: Sat, 24 Mar 2018 11:01:23 +0430 Subject: [PATCH] add more info --- README.md | 19 ++++++++++++++++--- config.sample | 2 +- create-iso.sh | 4 ++-- preseed.cfg.template | 2 +- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0cc45e2..4397a57 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,17 @@ Create your own netiso and reinstall it over ssh. You can partion yor server as ``` 4. Upload your `preseed.cfg` file to your own host. +#### Find Predictable Network Interface Names + +If your current installation of ubuntu not using **Predictable Network Interface Names** you can find out the name by using this command for example for `eth0`: + +``` +udevadm test /sys/class/net/eth0 2>/dev/null | grep ID_NET_NAME_ +ID_NET_NAME_MAC=enxd4bed95f24db +ID_NET_NAME_PATH=enp7s0 +``` +You can use `enp7s0` as predictable network interface name. + #### Clone repository ``` cd /tmp @@ -46,7 +57,8 @@ git clone https://github.com/mhf-ir/ubuntu-overssh-reinstallation.git cd ubuntu-overssh-reinstallation ``` #### Config -See `config.sample` and change it. Carefull about your network settings. It's can hold your server until get new kvm/ipmi/vnc to restore the ssh again. +See `config.sample` and change it. +⚠ Carefull about your network settings. It's can hold your server until get new kvm/ipmi/vnc to restore the ssh again. ``` cp config.sample config vim config @@ -77,6 +89,8 @@ You can test it. We must get 200 response as we expected curl -o /dev/null --silent --head --write-out '%{http_code}\n' http://yourserver.tld/preseed.cfg 200 ``` +⚠ If your webserver not reachable you must reboot your server to get preseed file. so test it before reboot your server. + #### Reboot ``` reboot @@ -87,6 +101,5 @@ Wait it until boot to iso complete and install require packages then ssh installer@10.1.1.100 ``` #### Continue installation of ubuntu - --- -This script test on Ubuntu 16.04 Server. +✅ This script test on Ubuntu Server 16.04 and 18.04. diff --git a/config.sample b/config.sample index a4c1cc9..7eb0db8 100644 --- a/config.sample +++ b/config.sample @@ -18,7 +18,7 @@ PASSWORD="tHISiSpASSWORD" # hostname and domain HOSTNAME="${INTERFACE_IP//\./\-}" -DOMAIN="servers.domain.org" +DOMAIN="example.tld" # lowercase of country code dont change it COUNTRY_LOWER="${COUNTRY,,}" diff --git a/create-iso.sh b/create-iso.sh index 929eae1..1bddc7a 100755 --- a/create-iso.sh +++ b/create-iso.sh @@ -61,8 +61,8 @@ cp -rT /mnt/ubuntu-overssh-iso $PROJECTPATH/ubuntu-overssh-iso cp $PROJECTPATH/preseed.cfg.template $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg # replace vairables -sed -i 's/timeout 0/timeout 1/g' $PROJECTPATH/ubuntu-overssh-iso/prompt.cfg -sed -i 's/timeout 0/timeout 1/g' $PROJECTPATH/ubuntu-overssh-iso/isolinux.cfg +sed -i 's/timeout 10/timeout 1/g' $PROJECTPATH/ubuntu-overssh-iso/prompt.cfg +sed -i 's/timeout 10/timeout 1/g' $PROJECTPATH/ubuntu-overssh-iso/isolinux.cfg sed -i "s/INTERFACE_DEV/$INTERFACE_DEV/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg sed -i "s/INTERFACE_IP/$INTERFACE_IP/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg diff --git a/preseed.cfg.template b/preseed.cfg.template index 101907e..9f85e81 100644 --- a/preseed.cfg.template +++ b/preseed.cfg.template @@ -19,5 +19,5 @@ d-i hw-detect/load_firmware boolean true d-i anna/choose_modules string network-console d-i network-console/password password PASSWORD d-i network-console/password-again password PASSWORD -# d-i pkgsel/include string ntp htop iotop curl +# d-i pkgsel/include string ntp htop iotop curl bash-completion wget hdparm # d-i preseed/late_command string in-target post-install.sh