Clear /etc/machine-id to avoid duplicate machine-ids
Deploying many nodes with the generated image shouldn't have the same /etc/machine-id so clearing it and letting systemd generate a new id upon first boot seems to be the best way to achieve this. Change-Id: I73d0577d31464521b3989312fd9d982a1312a268 Closes-bug: 1707526 Closes-bug: 1672461
This commit is contained in:
parent
ced9b51f6e
commit
6c2b1465cc
@ -1,2 +1,3 @@
|
|||||||
debian-minimal
|
debian-minimal
|
||||||
openssh-server
|
openssh-server
|
||||||
|
sysprep
|
||||||
|
@ -1 +1,2 @@
|
|||||||
|
sysprep
|
||||||
zypper-minimal
|
zypper-minimal
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
cache-url
|
cache-url
|
||||||
package-installs
|
package-installs
|
||||||
|
sysprep
|
||||||
zypper
|
zypper
|
||||||
|
@ -1 +1,2 @@
|
|||||||
package-installs
|
package-installs
|
||||||
|
sysprep
|
||||||
|
5
diskimage_builder/elements/sysprep/README.rst
Normal file
5
diskimage_builder/elements/sysprep/README.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
sysprep
|
||||||
|
=======
|
||||||
|
|
||||||
|
This element holds configuration and scripts that are common for all
|
||||||
|
distributions.
|
11
diskimage_builder/elements/sysprep/finalise.d/01-clear-machine-id
Executable file
11
diskimage_builder/elements/sysprep/finalise.d/01-clear-machine-id
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
set -eu
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
if [ -e /etc/machine-id ]; then
|
||||||
|
> /etc/machine-id
|
||||||
|
fi
|
1
diskimage_builder/elements/ubuntu-common/element-deps
Normal file
1
diskimage_builder/elements/ubuntu-common/element-deps
Normal file
@ -0,0 +1 @@
|
|||||||
|
sysprep
|
9
releasenotes/notes/sysprep-f3fd036bc1d2c405.yaml
Normal file
9
releasenotes/notes/sysprep-f3fd036bc1d2c405.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Adds sysprep element included by all systemd distros
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Adds default sysprep element clearing /etc/machine-id which
|
||||||
|
prevents duplicated /etc/machine-id by forcing systemd to
|
||||||
|
generate a new id for each booted system.
|
Loading…
Reference in New Issue
Block a user