diff --git a/elements/remove-machine-id/README.md b/elements/remove-machine-id/README.md new file mode 100644 index 00000000..41d4e18e --- /dev/null +++ b/elements/remove-machine-id/README.md @@ -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. + diff --git a/elements/remove-machine-id/post-install.d/70-remove-machine-id b/elements/remove-machine-id/post-install.d/70-remove-machine-id new file mode 100755 index 00000000..463da18b --- /dev/null +++ b/elements/remove-machine-id/post-install.d/70-remove-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