Finished packer scripts for Ubuntu 24.04
This commit is contained in:
36
packer/linux/ubuntu-24.04-x64/data/prep-script.sh
Normal file
36
packer/linux/ubuntu-24.04-x64/data/prep-script.sh
Normal file
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Resize root partition..."
|
||||
sudo parted /dev/sda resizepart 2 100% > /dev/null 2>&1
|
||||
sudo pvresize /dev/sda2 > /dev/null 2>&1
|
||||
sudo lvextend -y -f -l +100%FREE /dev/vg01/root > /dev/null 2>&1
|
||||
sudo resize2fs /dev/vg01/root > /dev/null 2>&1
|
||||
|
||||
echo "Delete password for root and ansb-srv-it"
|
||||
sudo usermod -p '*' root
|
||||
sudo usermod -p '*' ansb-srv-it
|
||||
|
||||
echo "Change perm for /home/ansb-srv-it"
|
||||
sudo chmod 700 /home/ansb-srv-it
|
||||
|
||||
echo "Create rc.local file..."
|
||||
sudo echo "#!/bin/sh -e
|
||||
#
|
||||
# rc.local
|
||||
#
|
||||
# This script is executed at the end of each multiuser runlevel.
|
||||
# Make sure that the script will exit 0 on success or any other
|
||||
# value on error.
|
||||
#
|
||||
# In order to enable or disable this script just change the execution
|
||||
# bits.
|
||||
#
|
||||
# By default this script does nothing.
|
||||
|
||||
|
||||
exit 0
|
||||
" > /etc/rc.local
|
||||
sudo chown root:root /etc/rc.local
|
||||
sudo chmod 755 /etc/rc.local
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user