1 changed files with 56 additions and 0 deletions
@ -0,0 +1,56 @@ |
|||||
|
# Accept the VMware License agreement |
||||
|
accepteula |
||||
|
|
||||
|
# Clear all partitions in first detected disk and overwrite any VMFS partition |
||||
|
clearpart --firstdisk --overwritevmfs |
||||
|
|
||||
|
# New installation on first disk and overwrite an existing VMFS datastore |
||||
|
install --firstdisk --overwritevmfs |
||||
|
|
||||
|
# French keyboard |
||||
|
keyboard French |
||||
|
|
||||
|
# Root password. Generated using "openssl passwd -1" |
||||
|
rootpw --iscrypted $1$7McSxAUG$3mAxHfGio8pRT1qHyKQTG. # P@ssw0rd! |
||||
|
|
||||
|
# Use DHCP for the first NIC |
||||
|
network --bootproto=dhcp --device=vmnic0 |
||||
|
|
||||
|
# Reboot after installation |
||||
|
reboot --noeject |
||||
|
|
||||
|
# Register vCenter License |
||||
|
#serialnum --esx=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX |
||||
|
|
||||
|
# Specifies script to run after ESXi is installed and before reboot |
||||
|
%post --interpreter=busybox --ignorefailure=true |
||||
|
|
||||
|
# Enable HV (Hardware Virtualization to run nested 64bit Guests + Hyper-V VM |
||||
|
grep -i "vhv.enable" /etc/vmware/config || echo "vhv.enable = \"TRUE\"" >> /etc/vmware/config |
||||
|
|
||||
|
# Enable TSM & SSH |
||||
|
vim-cmd hostsvc/enable_ssh |
||||
|
vim-cmd hostsvc/start_ssh |
||||
|
vim-cmd hostsvc/enable_esx_shell |
||||
|
vim-cmd hostsvc/start_esx_shell |
||||
|
|
||||
|
# Suppress Shell Warning in Host |
||||
|
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1 |
||||
|
|
||||
|
# inject SSH authorized keys |
||||
|
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPR1tt58X0+vbvsCR12gMAqr+g7vjt1Fx/qqz9EiboIs nicolas.masse@itix.fr" >> /etc/ssh/keys-root/authorized_keys |
||||
|
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFW62WJXI1ZCMfNA4w0dMpL0fsldhbEfULNGIUB0nQui nmasse@redhat.com" >> /etc/ssh/keys-root/authorized_keys |
||||
|
|
||||
|
# enable firewall |
||||
|
esxcli network firewall set --default-action false --enabled yes |
||||
|
|
||||
|
# Services Firewall to enable by default |
||||
|
for svc in syslog sshClient ntpClient updateManager httpClient netdump |
||||
|
do |
||||
|
esxcli network firewall ruleset set --ruleset-id ${svc} --enabled yes |
||||
|
done |
||||
|
|
||||
|
# backup ESXi configuration to persist changes |
||||
|
/sbin/auto-backup.sh |
||||
|
|
||||
|
esxcli system shutdown reboot -d 60 -r "rebooting after host configurations" |
||||
Loading…
Reference in new issue