I think this code is useful for you ,try it.
*- name: "create java.sh file with permissions." file: path:
"/etc/profile.d/java.sh" state: touch mode: 0755- name: "create
java.sh file with content" copy: dest: "/etc/profile.d/java.sh"
content: | export JRE_HOME={{ destination_folder }}java/jre
export PATH=$PATH:$JRE_HOME/bin export JAVA_HOME={{ destination_folder
}}java export JAVA_PATH=$JAVA_HOME export
PATH=$PATH:$JAVA_HOME/bin export JBOSS_HOME={{ destination_folder
}}adobe/adobe_experience_manager_Forms/jboss export
PATH=$PATH:$JBOSS_HOME/bin/init.d ignore_error: true- shell: "source
/etc/profile.d/java.sh" name: "Configure Java by java.sh"*
On Friday, October 12, 2018 at 12:57:47 PM UTC+5:30, pranay varankar wrote:
>
> Hi,
>
> I have added some export task in ~/.profile file & its added but not able
> to source ~/.profile in remote host.
>
> FYI
>
> - name: Set .profile
> lineinfile:
> path: /root/.profile
> line: export PROMPT_COMMAND='history -a >(logger -t
> "cmdlog[$USER:$PWD] $SSH_CLIENT")'
> tags:
> - PROMPT_CMD
>
> - name: source .profile
> shell: source /root/.profile
> args:
> executable: /bin/bash
> tags:
> - PROMPT_CMD
>
>
--
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/242dc58d-1dc6-44b7-a304-38ca30c5c91c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.