Ansible is a great tool; however, sometimes, it doesn't offer all the functionality you might desire. Not every bit of functionality is appropriate to support the main project, nor is it possible to integrate with custom proprietary data sources. For these reasons, there are facilities within Ansible to extend its functionality. Creating and using custom modules is made easy by the shared module base code. Many different types of plugins can be created and used with Ansible to affect operations in a variety of ways. Inventory sources beyond what Ansible supports can still be used with relative ease and efficiency.
In this chapter, you learned about developing your own modules and including them in your playbooks. You then learned about extending Ansible through plugins, and we went into specific details about creating dynamic inventory plugins. Finally, you learned how to contribute code back to the Ansible project to enhance the code for everyone in the community. In summary, you learned that, in all cases, there are mechanisms to provide modules, plugins, and inventory sources alongside the playbooks and roles that depend on the enhanced functionality, making it seamless to distribute. This enables an almost infinite amount of expansion or customization of Ansible to your requirements, and the ability to easily contribute these back to the wider community if desired.
In Chapter 11, Infrastructure Provisioning, we will explore the use of Ansible in creating the infrastructure to be managed.