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.

 




-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9b48b197-ae19-4a02-8177-7c16c9198acb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to