You can use the ``--token`` argument with the ``ansible-galaxy`` command (in conjunction with the ``--server`` argument or :ref:`GALAXY_SERVER` setting in your :file:`ansible.cfg` file). You cannot use ``apt-key`` with any servers defined in your :ref:`Galaxy server list <galaxy_server_config>`.
You can use the ``--token`` argument with the ``ansible-galaxy`` command (in conjunction with the ``--server`` argument or :ref:`GALAXY_SERVER` setting in your :file:`ansible.cfg` file). You cannot use ``apt-key`` with any servers defined in your :ref:`Galaxy server list <galaxy_server_config>`.
If the task sets the state to absent, then the ``delete_config()`` method is all that is needed. This method does not take any arguments, and handles check mode.
If the task sets the state to absent, then the ``delete_config()`` method is all that is needed. This method does not take any arguments, and handles check mode.
..code-block::guess
..code-block::text
elif state == 'absent':
elif state == 'absent':
aci.delete_config()
aci.delete_config()
@ -305,7 +305,7 @@ Exiting the module
^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^
To have the module exit, call the ACIModule method ``exit_json()``. This method automatically takes care of returning the common return values for you.
To have the module exit, call the ACIModule method ``exit_json()``. This method automatically takes care of returning the common return values for you.
@ -211,7 +211,7 @@ If any of your custom modules use a custom module utility, once you migrate to a
When coding with ``module_utils`` in a collection, the Python import statement needs to take into account the :abbr:`FQCN (Fully Qualified Collection Name)` along with the ``ansible_collections`` convention. The resulting Python import looks similar to the following example:
When coding with ``module_utils`` in a collection, the Python import statement needs to take into account the :abbr:`FQCN (Fully Qualified Collection Name)` along with the ``ansible_collections`` convention. The resulting Python import looks similar to the following example:
..code-block::python
..code-block::text
from ansible_collections.{namespace}.{collectionname}.plugins.module_utils.{util} import {something}
from ansible_collections.{namespace}.{collectionname}.plugins.module_utils.{util} import {something}
@ -223,7 +223,7 @@ The following example code snippets show a Python and a PowerShell module using
In the Python example the ``module_utils`` is ``helper`` and the :abbr:`FQCN (Fully Qualified Collection Name)` is ``ansible_example.community.plugins.module_utils.helper``:
In the Python example the ``module_utils`` is ``helper`` and the :abbr:`FQCN (Fully Qualified Collection Name)` is ``ansible_example.community.plugins.module_utils.helper``:
..code-block::python
..code-block::text
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.basic import AnsibleModule