Hi Darup, I think you were on the right track with the template approach,
but instead of using the shell command, you can use the built-in Ansible
fact '*ansible_hostname'*. So the bottom line of your template file would
be:
export HOST_NAME*={{ ansible_hostname }}*
You can read more about facts
at
http://docs.ansible.com/playbooks_variables.html#information-discovered-from-systems-facts.
Hope that helps.
Michael
On Saturday, August 30, 2014 9:39:00 AM UTC+8, Darup tek wrote:
>
> currently,I am solving this problem making it as a script and using
>>
>
> - script: script_change_bash_profile.sh
>
> Is there a better way than this.
>
--
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/f625ff64-c504-413d-acf0-eadfcfb8c724%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.