Skip to content

Instantly share code, notes, and snippets.

@olbpetersson
Last active November 2, 2016 10:42
Show Gist options
  • Save olbpetersson/5bef417af32b6ec5f648fe27b70b89d2 to your computer and use it in GitHub Desktop.
Save olbpetersson/5bef417af32b6ec5f648fe27b70b89d2 to your computer and use it in GitHub Desktop.
vars.yml
---
env:
ANSIBLE_LIBRARY: "~/modules"
####
test.yml
- hosts: all
vars_files:
- vars.yml
environment: "{{env}}"
tasks:
- name: echo env
# THIS WORKS
command: echo $ANSIBLE_LIBRARY # {{ lookup('env, 'ANSIBLE_LIBRARY') }}
register: ekko
- debug: var=ekko
- name: My module
# BUT THIS FAILS CAUSE IT CANT FIND THE MODULE
my_module:
input: "this-is-a-test"
register: result
- debug: var=result
###
~/modules/my_module.py holds the external module which works if I set ANSIBLE_LIBRARY through bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment