Replace /etc/machine-id with an empty file
Since these images can be used to create multiple machines, they should not have a unique machine-id attached to them. Replace /etc/machine-id with an empty file so that it will be regenerated at boot time.
This commit is contained in:
parent
9d73975c9f
commit
e401f36496
@ -31,6 +31,10 @@ services --enabled=sshd,chronyd,cloud-init
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
|
||||
# Clear /etc/machine-id
|
||||
rm /etc/machine-id
|
||||
touch /etc/machine-id
|
||||
|
||||
# tell cloud-init to create the ec2-user account
|
||||
sed -i 's/cloud-user/ec2-user/' /etc/cloud/cloud.cfg
|
||||
%end
|
||||
|
@ -24,6 +24,10 @@ bootloader --location=none
|
||||
%post
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
|
||||
# Clear /etc/machine-id
|
||||
rm /etc/machine-id
|
||||
touch /etc/machine-id
|
||||
%end
|
||||
|
||||
# NOTE Do NOT add any other sections after %packages
|
||||
|
@ -24,6 +24,10 @@ bootloader --location=mbr
|
||||
%post
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
|
||||
# Clear /etc/machine-id
|
||||
rm /etc/machine-id
|
||||
touch /etc/machine-id
|
||||
%end
|
||||
|
||||
%packages
|
||||
|
@ -24,6 +24,10 @@ bootloader --location=mbr
|
||||
%post
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
|
||||
# Clear /etc/machine-id
|
||||
rm /etc/machine-id
|
||||
touch /etc/machine-id
|
||||
%end
|
||||
|
||||
%packages
|
||||
|
@ -24,6 +24,10 @@ bootloader --location=none
|
||||
%post
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
|
||||
# Clear /etc/machine-id
|
||||
rm /etc/machine-id
|
||||
touch /etc/machine-id
|
||||
%end
|
||||
|
||||
# NOTE Do NOT add any other sections after %packages
|
||||
|
@ -30,6 +30,10 @@ services --enabled=sshd,chronyd,waagent
|
||||
%post
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
|
||||
# Clear /etc/machine-id
|
||||
rm /etc/machine-id
|
||||
touch /etc/machine-id
|
||||
%end
|
||||
|
||||
%packages
|
||||
|
@ -27,6 +27,10 @@ services --enabled=sshd,chronyd,vmtoolsd
|
||||
%post
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
|
||||
# Clear /etc/machine-id
|
||||
rm /etc/machine-id
|
||||
touch /etc/machine-id
|
||||
%end
|
||||
|
||||
%packages
|
||||
|
Loading…
Reference in New Issue
Block a user