Developer Guide
Note
Making Open Source More Inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. We ask that you open an issue or pull request if you come upon a term that we have missed. For more details, see our CTO Chris Wright’s message.
Welcome to the Ansible Developer Guide!
Who should use this guide?
If you want to extend Ansible by using a custom module or plugin locally, creating a module or plugin, adding functionality to an existing module, or expanding test coverage, this guide is for you. We’ve included detailed information for developers on how to test and document modules, as well as the prerequisites for getting your module or plugin accepted into the main Ansible repository.
Find the task that best describes what you want to do:
I’m looking for a way to address a use case:
I want to add a custom plugin or module locally.
I want to figure out if developing a module is the right approach for my use case.
I want to understand what a successful collection creator path looks like.
I want to develop a collection.
I want to migrate a role to a collection.
I’ve read the info above, and I’m sure I want to develop a module:
What do I need to know before I start coding?
I want to set up my Python development environment.
I want to get started writing a module.
- I want to write a specific kind of module:
an Amazon module.
an oVirt/RHV module.
I want to write a series of related modules that integrate Ansible with a new product (for example, a database, cloud provider, network platform, and so on).
I want to refine my code:
I want to debug my module code.
I want to add tests.
I want to document my module.
I want to document my set of modules for a network platform.
I want to follow conventions and tips for clean, usable module code.
I want to work on other development projects:
I want to write a plugin.
I want to connect Ansible to a new source of inventory.
I want to deprecate an outdated module.
I want to contribute back to the Ansible project:
I want to understand how to contribute to Ansible.
I want to contribute my module or plugin.
I want to understand the DCO agreement for contributions to the Ansible Core and Ansible Documentation repositories.
If you prefer to read the entire guide, here’s a list of the pages in order.
- Adding modules and plugins locally
- Should you develop a module?
- Developing modules
- Contributing your module to an existing Ansible collection
- Conventions, tips, and pitfalls
- Ansible and Python 3
- Debugging modules
- Module format and documentation
- Adjacent YAML documentation files
- Windows module development walkthrough
- Windows environment setup
- Create a Windows server in a VM
- Create an Ansible inventory
- Provisioning the environment
- Windows new module development
- Windows module utilities
- Windows playbook module testing
- Windows debugging
- Windows unit testing
- Windows integration testing
- Windows communication and development support
- Creating a new collection
- Testing Ansible
- The lifecycle of an Ansible module or plugin
- Deprecating modules and plugins in the Ansible main repository
- Deprecating modules and plugins in a collection
- Changing a module or plugin name in the Ansible main repository
- Renaming a module or plugin in a collection, or redirecting a module or plugin to another collection
- Tombstoning a module or plugin in a collection
- Developing plugins
- Developing dynamic inventory
- Developing
ansible-core
- Ansible module architecture
- Python API
- Rebasing a pull request
- Using and developing module utilities
- Ansible collection creator path
- Examine currently available solutions
- Create your content
- Put your content in a collection
- Write good user collection documentation
- Publish your collection source code
- Follow a versioning convention
- Understand and implement testing and CI
- Provide good contributor & maintainer documentation
- Publish your collection on distribution servers
- Make your collection a part of Ansible community package
- Maintain
- Communicate
- Developing collections
- Creating collections
- Using shared resources in collections
- Testing collections
- Distributing collections
- Documenting collections
- Migrating Ansible content to a different collection
- Contributing to collections
- Generating changelogs and porting guide entries in a collection
- Collection structure
- Collection Galaxy metadata structure
- Migrating Roles to Roles in Collections on Galaxy
- Collection Galaxy metadata structure
- Ansible architecture