osbuildexecutor/aws.ec2: set hostname of executor via cloud-init
This way much more of the journal will be captured under the new hostname.
This commit is contained in:
parent
14052e25db
commit
2a621521a8
7 changed files with 29 additions and 15 deletions
|
|
@ -6,6 +6,7 @@ After=cloud-final.service
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/libexec/worker-initialization-scripts/set_executor_hostname.sh
|
||||
ExecStart=/usr/local/libexec/worker-initialization-scripts/worker_executor.sh
|
||||
|
||||
[Install]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
source /tmp/cloud_init_vars
|
||||
|
||||
if [[ -z "$OSBUILD_EXECUTOR_HOSTNAME" ]]; then
|
||||
echo "OSBUILD_EXECUTOR_HOSTNAME not set, skipping."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Setting system hostname to $OSBUILD_EXECUTOR_HOSTNAME."
|
||||
hostnamectl set-hostname "$OSBUILD_EXECUTOR_HOSTNAME"
|
||||
Loading…
Add table
Add a link
Reference in a new issue