Reference

Reference #

This section contains topics that are only interesting when referenced from elsewhere.

Topics #

Ansible's own extension terminology
Ansible’s own extension terminology # I saved this terminology for the appendix because this book is mostly about sample code and showing how you might solve specific problems, and a first-principles understanding of how to name what is not the first milestone to achieving that goal. However, it is useful to know the terms that the Ansible development team uses, and frankly the official documentation is not as clear on this point as it could be, so it’s worth describing it for reference in case you need it.
module_utils
module_utils # Directory: ./module_utils Documentation: https://docs.ansible.com/ansible/latest/dev_guide/developing_module_utilities.html When writing extensions in Python, you can write all of the code in the extension file itself. For instance, when writing a filter, you can put all of the code in a file in the filter_plugins/ directory. However, if you’re writing a large extension, or even want to split up your extension into several Python files, you can add files to module_utils and import them.