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:
David Shea 2018-10-05 14:27:28 -04:00
parent 37051dbe2b
commit 6bcb2823d4
7 changed files with 28 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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