Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
Collection requirements: mention idepmotency explicitly (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersson007 authored Jan 4, 2023
1 parent 4d5ab32 commit 0cbb6a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions collection_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Note for reviewers: If you don't know how to check any of the points below, plea
- [ ] follows [licensing rules](https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#licensing)
- [ ] follows the [Ansible documentation standards](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html) and the [style guide](https://docs.ansible.com/ansible/devel/dev_guide/style_guide/index.html#style-guide)
- [ ] follows [development conventions](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html); as well as these other requirements:
- [ ] modules satisfy the concept of [idempotency](https://docs.ansible.com/ansible/latest/reference_appendices/glossary.html#term-Idempotency>)
- [ ] modules that only gather information are named `<something>_info`
- [ ] modules that return `ansible_facts` are named `<something>_facts` and do not return non-facts
- [ ] other modules must not allow querying information using specific `state` option values, or similar mechanisms (like `state=get` or `state=query`). These features should be moved to `<something>_info` or `<something>_fact` modules.
Expand Down
5 changes: 3 additions & 2 deletions collection_requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,10 @@ Development conventions

Besides all the requirements listed in the `Development conventions <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html>`_, be sure:

* Your modules satisfy the concept of `idempotency <https://docs.ansible.com/ansible/latest/reference_appendices/glossary.html#term-Idempotency>`_: if a module repeatedly runs with the same set of inputs, it will not make any changes on the system.
* Your modules do not query information using special ``state`` option values like ``get``, ``list``, ``query``, or ``info`` -
create new ``_info`` or ``_facts`` modules instead (for more information, refer to the `Developing modules guidelines <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html#creating-an-info-or-a-facts-module>`_)
* ``check_mode`` is supported in all ``*_info`` and ``*_facts`` modules (for more information, refer to the `Development conventions <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html#following-ansible-conventions>`_)
create new ``_info`` or ``_facts`` modules instead (for more information, refer to the `Developing modules guidelines <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html#creating-an-info-or-a-facts-module>`_).
* ``check_mode`` is supported in all ``*_info`` and ``*_facts`` modules (for more information, refer to the `Development conventions <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html#following-ansible-conventions>`_).

.. _collection_dependencies:

Expand Down

0 comments on commit 0cbb6a6

Please sign in to comment.