Put example.py to your local directory. ( e.g ./ansible_module/example.py
)
Or you can git clone from this gist and get example.py.
git clone https://gist.github.com/YumaInaura/829b06cbf1c2ad5fa0a823ba24f8afbf/ ansible_module
In this case we use python script but actually modules can be written by any language.
$ ansible localhost -m 'example' --module-path=./ansible_module
localhost | SUCCESS => {
"changed": false,
"some_key": "some value"
}
It works!
- ansible 2.6.1 ( installed by homebrew )