Add remove-machine-id element
Leaving /etc/machine-id on the image means that all nodes booted from this image will have the same machine-id, which is wrong. A new machine-id will be generated during the first boot. This element can be used to purge the machine-id from the image. Change-Id: Idd848cd307c179afa557618f44db34b2fb57d937 Related-Bug: #1672461 Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
This commit is contained in:
parent
85f4604298
commit
c7c1da513e
9
elements/remove-machine-id/README.md
Normal file
9
elements/remove-machine-id/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
=================
|
||||
remove-machine-id
|
||||
=================
|
||||
|
||||
Removes the hardcoded ``/etc/machine-id`` from the resulting image, so that it
|
||||
is regenerated during the next boot.
|
||||
|
||||
Leaving the file means that e.g. all instances will have the same machine-id.
|
||||
|
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
# In order to make sure not all nodes have the same machine id, we need to
|
||||
# remove it from the image and it should be generated on boot. LP#1672461
|
||||
rm -f /etc/machine-id
|
Loading…
x
Reference in New Issue
Block a user