What I'm hoping to find it something like this;

$ cat play.yml
- hosts: localhost
  tasks:
    - name: Test that my module works
      MY_CUSTOM_MODULE:
      register: result
  environment:
    script: ${WL_HOME}/server/bin/setWLSEnv.sh

    - debug: var=result
$

but script doesn't work, so not sure what it should be. It might be 
environment lacks this ability.

On Wednesday, 11 January 2017 12:54:22 UTC, John Patrick wrote:
>
> I'm working on a custom module but having issues with the environment 
> setup on the remote server.
>
> How should the remote environment variables be correctly setup. I've been 
> looking here 
> http://docs.ansible.com/ansible/dev_guide/developing_modules.html but not 
> found anything yet or I might have simply missed it.
>
> At the moment I'm doing a shell task, along the lines of ". PATH/env.sh && 
> myscript.py", also doing sudo: yes, sudo_user: "{{ remote_user }}"
>
> Ideally I'ld like to know how I can specify PATH as a field for my module, 
> then before the module executes on the target server the env.sh is executes 
> before the actual task.
>
> Or if people know another module which does similar I don't mine reviewing 
> that and working it out for myself. I just can't figure out how to source 
> the shell script beforehand.
>
> Cheers,
> John
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to