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.
(cherry picked from commit 6fab72d894
)
Related: rhbz#1628645
Related: rhbz#1628646
Related: rhbz#1628647
Related: rhbz#1628648
This commit is contained in:
parent
37051dbe2b
commit
6bcb2823d4
@ -31,6 +31,10 @@ services --enabled=sshd,chronyd,cloud-init
|
|||||||
# Remove random-seed
|
# Remove random-seed
|
||||||
rm /var/lib/systemd/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
|
# tell cloud-init to create the ec2-user account
|
||||||
sed -i 's/cloud-user/ec2-user/' /etc/cloud/cloud.cfg
|
sed -i 's/cloud-user/ec2-user/' /etc/cloud/cloud.cfg
|
||||||
%end
|
%end
|
||||||
|
@ -24,6 +24,10 @@ bootloader --location=none
|
|||||||
%post
|
%post
|
||||||
# Remove random-seed
|
# Remove random-seed
|
||||||
rm /var/lib/systemd/random-seed
|
rm /var/lib/systemd/random-seed
|
||||||
|
|
||||||
|
# Clear /etc/machine-id
|
||||||
|
rm /etc/machine-id
|
||||||
|
touch /etc/machine-id
|
||||||
%end
|
%end
|
||||||
|
|
||||||
# NOTE Do NOT add any other sections after %packages
|
# NOTE Do NOT add any other sections after %packages
|
||||||
|
@ -24,6 +24,10 @@ bootloader --location=mbr
|
|||||||
%post
|
%post
|
||||||
# Remove random-seed
|
# Remove random-seed
|
||||||
rm /var/lib/systemd/random-seed
|
rm /var/lib/systemd/random-seed
|
||||||
|
|
||||||
|
# Clear /etc/machine-id
|
||||||
|
rm /etc/machine-id
|
||||||
|
touch /etc/machine-id
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%packages
|
%packages
|
||||||
|
@ -24,6 +24,10 @@ bootloader --location=mbr
|
|||||||
%post
|
%post
|
||||||
# Remove random-seed
|
# Remove random-seed
|
||||||
rm /var/lib/systemd/random-seed
|
rm /var/lib/systemd/random-seed
|
||||||
|
|
||||||
|
# Clear /etc/machine-id
|
||||||
|
rm /etc/machine-id
|
||||||
|
touch /etc/machine-id
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%packages
|
%packages
|
||||||
|
@ -24,6 +24,10 @@ bootloader --location=none
|
|||||||
%post
|
%post
|
||||||
# Remove random-seed
|
# Remove random-seed
|
||||||
rm /var/lib/systemd/random-seed
|
rm /var/lib/systemd/random-seed
|
||||||
|
|
||||||
|
# Clear /etc/machine-id
|
||||||
|
rm /etc/machine-id
|
||||||
|
touch /etc/machine-id
|
||||||
%end
|
%end
|
||||||
|
|
||||||
# NOTE Do NOT add any other sections after %packages
|
# NOTE Do NOT add any other sections after %packages
|
||||||
|
@ -30,6 +30,10 @@ services --enabled=sshd,chronyd,waagent
|
|||||||
%post
|
%post
|
||||||
# Remove random-seed
|
# Remove random-seed
|
||||||
rm /var/lib/systemd/random-seed
|
rm /var/lib/systemd/random-seed
|
||||||
|
|
||||||
|
# Clear /etc/machine-id
|
||||||
|
rm /etc/machine-id
|
||||||
|
touch /etc/machine-id
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%packages
|
%packages
|
||||||
|
@ -27,6 +27,10 @@ services --enabled=sshd,chronyd,vmtoolsd
|
|||||||
%post
|
%post
|
||||||
# Remove random-seed
|
# Remove random-seed
|
||||||
rm /var/lib/systemd/random-seed
|
rm /var/lib/systemd/random-seed
|
||||||
|
|
||||||
|
# Clear /etc/machine-id
|
||||||
|
rm /etc/machine-id
|
||||||
|
touch /etc/machine-id
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%packages
|
%packages
|
||||||
|
Loading…
Reference in New Issue
Block a user