mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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:
parent
f53921093f
commit
19b49a9224
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue