I am little clueless on how to solve this issue.
There are couple of hosts I need to remotely change the .bash_profile.
Locally I run the command this way.
echo “”# .bash_profile
Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
User specific environment and startup programs
export JAVA_HOME=/xxx/xxx/xxx/jdk1.7.0_21
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export HOST_NAME**=hostname -s
** " > .bash_profile
How do I solve this problem from playbook. I need the task to copy the .bash_profile reflecting the hostname of the server.
It has to execute the hostname -s
.
I can template and copy, but cannot I need it to do the command substitution.
Thanks,
Darup.