Hi all,
I’m working to automate some Tomcat deployments and I have a problem with the enconding. When I start the Tomcat, Ansible use its default LANG=C and LC_TYPE=C variables and the application is not deployed properly, some characters doesn’t appear right.
Following you can see the PID info and notice that it’s putting the default variables instead of using the user variables (root as I’m using sudo):
cat /proc/18107/environ
TOMCAT_HOME=/opt/tomcatTERM=linuxSHELL=/bin/bashCATALINA_HOME=/opt/tomcat TOMCAT_START=/opt/tomcat/bin/startup.shUSER=tomcatJAVA_OPTS=-server -Xms1024m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager JRE_HOME=/op /java/latestSUDO_USER=atlasSUDO_UID=50000USERNAME=rootMAIL=/var/mail/at PATH=/sbin:/usr/sbin:/bin:/usr/binPWD=/opt/tomcat/webapps/simyoJAVA_HOME=/opt/jav /latest LANG=CHOME=/home/tomcatSUDO_COMMAND=/bin/sh -c echo SUDO-SUCCESS-bdoirfizidenadwclaoujhbewakdemoh; LANG=C LC_CTYPE=C /usr/bin/python /home/at //.ansible/tmp/ansible-tmp-1434028812.49-238808986274644/command; rm -rf /home/atlas//.ansible/tmp/ansible-tmp-1434028812.49-238808986274644/ >/dev/null 2>&1SHLVL=5TOMCAT_STOP=/opt/tomcat/bin/shutdown.shLOGNAME=tomcat LC_CTYPE=CSUDO_GID=50000_=/opt/java/latest/bin/javaLD_LIBRARY_PATH=/opt/java/jdk1.6.0_2 /jre/lib/i386/server: /opt/java/jdk1.6.0_24/jre/lib/i386:/opt/java/jdk1.6.0_24/jre/…/lib/i386
Do you know if there’s any way to use the user variables instead of the “ansible_env” vars? If not, there’s any way to unset this vars at playbook level?
I’ve seen this docu but there’s nothing about unset vars → https://docs.ansible.com/playbooks_environment.html
Cheers,
Ivan G.