3 ms·
You can move your scripts to Python and have them implement the Ansible module interface. Example: [1] Now all that’s left in your YAML is the declarative part
by Hackbraten 4y ago
You can move your scripts to Python and have them implement the Ansible module interface. Example: [1]
Now all that’s left in your YAML is the declarative part. No more YAML-as-a-scripting language.
[1]: https://github.com/ansible/ansible/blob/devel/examples/scripts/my_test.py https://github.com/ansible/ansible/blob/devel/examples/scrip...
- mdaniel 4y agoFun fact, playbook library actions don't have to be in python, they can be in golang or shell or whatever, so long as they accept JSON on the input and emit JSON on the output I believe that's true of all the plugins, I just have personally tried it using actions and haven't for the other pluggable ones
- bcocaTM 4y agoNo, all other plugins require to be written in Python (they are imported into the engine), modules are executed externally on the remote and can be in ANY language, scripting or compiled.
- champtar 4y agoAnd this means that you can use Ansible to manage hosts without python if you reimplement everything you need