1
0
Fork 0
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:
Jean-Philippe Evrard 2017-03-03 18:33:41 +00:00 committed by Ryan Brown
parent f53921093f
commit 19b49a9224

View file

@ -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