12.1 Ansible Module Development - Basics
In this lab we are going to learn how Ansible uses modules and where to find information about developing a custom module.
Task 1
- In which language has a module to be written?
- Point your webbrowser to the official documentation about developing modules.
- Point your webbrowser to the official documentation about developing modules best practices.
- Point your webbrowser to the official documentation about developing collections.
- Point your webbrowser to the official documentation about debugging your module.
- Which environment variable lets you keep the remote module files after executing the module (instead of deleting it)?
Solution Task 1
- either Pyhon (Linux) or Powershell (Windows)
- https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html
- https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_best_practices.html#developing-modules-best-practices
- https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html#developing-collections
- https://docs.ansible.com/ansible/latest/dev_guide/debugging.html#debugging-modules
ANSIBLE_KEEP_REMOTE_FILES
Task 2
- for possible content of the
my_module.py
file, see the official documentation
Solution Task 2
|
|
All done?
- Ansible module development on YouTube
- Have a look at the Puzzle OPNsense Ansible Collection
Last modified April 8, 2025: Merge 5ac3616821fc04951877c07b5d9e3a9a4699c21d into 957ea21db2f5a662ad48089a48e94a8ebc5b4634 (8d1c2d3)