File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ function update_install_packages {
5858 apt-get upgrade -y
5959
6060 # Install OpenSSH and other packages
61- sudo add-apt-repository universe -y
61+ sudo add-apt-repository universe
6262 apt-get update
6363 apt-get install -y --no-install-recommends \
6464 openssh-server \
@@ -157,12 +157,10 @@ function disable_fsck {
157157
158158# Don't request hostname during boot but set hostname
159159function setup_hostname {
160+ sed -i ' s/gethostname()/ubuntu /g' /etc/dhcp/dhclient.conf
161+ sed -i ' s/host-name,//g' /etc/dhcp/dhclient.conf
160162 echo " ubuntu" > /etc/hostname
161163 chmod 644 /etc/hostname
162- # Set the hostname
163-
164- # Prevent cloud-init from changing the hostname
165- sed -i ' s/^preserve_hostname: false/preserve_hostname: true/' /etc/cloud/cloud.cfg
166164}
167165
168166# Set options for the default interface
You can’t perform that action at this time.
0 commit comments