Thanks for Brian,
I have tried all these suggestions but with no luck.

- name: Sourcing commands from helpers file
      command: source helpers.sh chdir="{{workspace }}"
      become: true
      become_user: <user>

TASK [Debug] 
*******************************************************************
ok: [127.0.0.1] => {
    "msg": "Workspace is /home/<user>/projects/<confidential>"
}

TASK [Sourcing commands for database management from helpers file] 
*************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "source 
helpers.sh", "failed": true, "msg": "[Errno 2] No such file or directory", 
"rc": 2}

I file is definitely there and the path is right. I must be missing 
something fundamental, possibly simple.

Regards
Charles

On Friday, 16 September 2016 19:38:12 UTC+1, Brian Coca wrote:
>
> This is how that would be sourced with su (just not sure that is useful 
> either):
>
> - command: source mycommand.sh chdir="{{ command_directory }}"
> ​  become: True
>
> ^ the issue is that 'sudo su -' is not supported, you either need full 
> sudo or be able to run 'su'​ directly.
>
>
> ----------
> Brian Coca
>

-- 
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/433baf77-a15b-4e35-9d9a-25f7a12fb934%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to