mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-06 10:43:14 +00:00
[cloud][lxc] Prevent hostname to be set (#22246)
If the host .bashrc holds a var named HOSTNAME, the container where the lxc_container module will attach to will inherit from this var, potentially breaking some applications (like rabbitmqctl) due to an incorrect $HOSTNAME reported in the container.
This commit is contained in:
committed by
Ryan Brown
parent
f53921093f
commit
19b49a9224
@@ -541,6 +541,7 @@ ATTACH_TEMPLATE = """#!/usr/bin/env bash
|
||||
pushd "$(getent passwd $(whoami)|cut -f6 -d':')"
|
||||
if [[ -f ".bashrc" ]];then
|
||||
source .bashrc
|
||||
unset HOSTNAME
|
||||
fi
|
||||
popd
|
||||
|
||||
|
||||
Reference in New Issue
Block a user