add more info
This commit is contained in:
parent
cb1dcdeb3d
commit
3a1c466d5a
19
README.md
19
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.
|
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
|
#### Clone repository
|
||||||
```
|
```
|
||||||
cd /tmp
|
cd /tmp
|
||||||
|
@ -46,7 +57,8 @@ git clone https://github.com/mhf-ir/ubuntu-overssh-reinstallation.git
|
||||||
cd ubuntu-overssh-reinstallation
|
cd ubuntu-overssh-reinstallation
|
||||||
```
|
```
|
||||||
#### Config
|
#### 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
|
cp config.sample config
|
||||||
vim 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
|
curl -o /dev/null --silent --head --write-out '%{http_code}\n' http://yourserver.tld/preseed.cfg
|
||||||
200
|
200
|
||||||
```
|
```
|
||||||
|
⚠ If your webserver not reachable you must reboot your server to get preseed file. so test it before reboot your server.
|
||||||
|
|
||||||
#### Reboot
|
#### Reboot
|
||||||
```
|
```
|
||||||
reboot
|
reboot
|
||||||
|
@ -87,6 +101,5 @@ Wait it until boot to iso complete and install require packages then
|
||||||
ssh installer@10.1.1.100
|
ssh installer@10.1.1.100
|
||||||
```
|
```
|
||||||
#### Continue installation of ubuntu
|
#### Continue installation of ubuntu
|
||||||
|
|
||||||
---
|
---
|
||||||
This script test on Ubuntu 16.04 Server.
|
✅ This script test on Ubuntu Server 16.04 and 18.04.
|
||||||
|
|
|
@ -18,7 +18,7 @@ PASSWORD="tHISiSpASSWORD"
|
||||||
|
|
||||||
# hostname and domain
|
# hostname and domain
|
||||||
HOSTNAME="${INTERFACE_IP//\./\-}"
|
HOSTNAME="${INTERFACE_IP//\./\-}"
|
||||||
DOMAIN="servers.domain.org"
|
DOMAIN="example.tld"
|
||||||
|
|
||||||
# lowercase of country code dont change it
|
# lowercase of country code dont change it
|
||||||
COUNTRY_LOWER="${COUNTRY,,}"
|
COUNTRY_LOWER="${COUNTRY,,}"
|
||||||
|
|
|
@ -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
|
cp $PROJECTPATH/preseed.cfg.template $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
|
||||||
|
|
||||||
# replace vairables
|
# replace vairables
|
||||||
sed -i 's/timeout 0/timeout 1/g' $PROJECTPATH/ubuntu-overssh-iso/prompt.cfg
|
sed -i 's/timeout 10/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/isolinux.cfg
|
||||||
|
|
||||||
sed -i "s/INTERFACE_DEV/$INTERFACE_DEV/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.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
|
sed -i "s/INTERFACE_IP/$INTERFACE_IP/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
|
||||||
|
|
|
@ -19,5 +19,5 @@ d-i hw-detect/load_firmware boolean true
|
||||||
d-i anna/choose_modules string network-console
|
d-i anna/choose_modules string network-console
|
||||||
d-i network-console/password password PASSWORD
|
d-i network-console/password password PASSWORD
|
||||||
d-i network-console/password-again 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
|
# d-i preseed/late_command string in-target post-install.sh
|
||||||
|
|
Loading…
Reference in New Issue
Block a user