source is a bash function not a command. This is why it cannot find such
file, because there is no such file "source". Try to use shell module
instead of command.
Edgars
pirmdiena, 2016. gada 19. septembris 10:25:30 UTC+2, Charles Moga rakstīja:
>
> 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/0eaee339-bcd3-426f-9bf1-f9365ef20cc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.