Merge pull request #17248 from abadger/facts-module-dev-docs

Couple things to watch out for when reviewing facts modules
pull/17290/head^2
John R Barker 8 years ago committed by GitHub
commit 35a3653dfc

@ -721,7 +721,14 @@ The following checklist items are important guidelines for people who want to c
fields of a dictionary and return the dictionary. fields of a dictionary and return the dictionary.
* When fetching URLs, please use either fetch_url or open_url from ansible.module_utils.urls * When fetching URLs, please use either fetch_url or open_url from ansible.module_utils.urls
rather than urllib2; urllib2 does not natively verify TLS certificates and so is insecure for https. rather than urllib2; urllib2 does not natively verify TLS certificates and so is insecure for https.
* facts modules must return facts in the ansible_facts field of the result
dictionary. :ref:`module_provided_facts`
* modules that are purely about fact gathering need to implement check_mode.
they should not cause any changes anyway so it should be as simple as adding
check_mode=True when instantiating AnsibleModule. (The reason is that
playbooks which conditionalize based on fact information will only
conditionalize correctly in check_mode if the facts are returned in
check_mode).
Windows modules checklist Windows modules checklist
````````````````````````` `````````````````````````

Loading…
Cancel
Save