summaryrefslogtreecommitdiffstats
path: root/docs/docsite/rst/module_plugin_guide
diff options
context:
space:
mode:
Diffstat (limited to 'docs/docsite/rst/module_plugin_guide')
-rw-r--r--docs/docsite/rst/module_plugin_guide/index.rst30
-rw-r--r--docs/docsite/rst/module_plugin_guide/modules_intro.rst62
-rw-r--r--docs/docsite/rst/module_plugin_guide/modules_plugins_index.rst6
-rw-r--r--docs/docsite/rst/module_plugin_guide/modules_support.rst70
-rw-r--r--docs/docsite/rst/module_plugin_guide/plugin_filtering_config.rst26
5 files changed, 194 insertions, 0 deletions
diff --git a/docs/docsite/rst/module_plugin_guide/index.rst b/docs/docsite/rst/module_plugin_guide/index.rst
new file mode 100644
index 0000000..6f914d0
--- /dev/null
+++ b/docs/docsite/rst/module_plugin_guide/index.rst
@@ -0,0 +1,30 @@
+.. _modules_plugins_index:
+
+#################################
+Using Ansible modules and plugins
+#################################
+
+.. 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 <https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language>`_.
+
+Welcome to the Ansible guide for working with modules, plugins, and collections.
+
+Ansible modules are units of code that can control system resources or execute system commands.
+Ansible provides a module library that you can execute directly on remote hosts or through playbooks.
+You can also write custom modules.
+
+Similar to modules are plugins, which are pieces of code that extend core Ansible functionality.
+Ansible uses a plugin architecture to enable a rich, flexible, and expandable feature set.
+Ansible ships with several plugins and lets you easily use your own plugins.
+
+.. toctree::
+ :maxdepth: 2
+
+ modules_intro
+ modules_support
+ plugin_filtering_config
+ ../plugins/plugins
+ modules_plugins_index \ No newline at end of file
diff --git a/docs/docsite/rst/module_plugin_guide/modules_intro.rst b/docs/docsite/rst/module_plugin_guide/modules_intro.rst
new file mode 100644
index 0000000..d6f67c7
--- /dev/null
+++ b/docs/docsite/rst/module_plugin_guide/modules_intro.rst
@@ -0,0 +1,62 @@
+.. _intro_modules:
+
+Introduction to modules
+=======================
+
+Modules (also referred to as "task plugins" or "library plugins") are discrete units of code that can be used from the command line or in a playbook task. Ansible executes each module, usually on the remote managed node, and collects return values. In Ansible 2.10 and later, most modules are hosted in collections.
+
+You can execute modules from the command line.
+
+.. code-block:: shell-session
+
+ ansible webservers -m service -a "name=httpd state=started"
+ ansible webservers -m ping
+ ansible webservers -m command -a "/sbin/reboot -t now"
+
+Each module supports taking arguments. Nearly all modules take ``key=value`` arguments, space delimited. Some modules take no arguments, and the command/shell modules simply take the string of the command you want to run.
+
+From playbooks, Ansible modules are executed in a very similar way.
+
+.. code-block:: yaml
+
+ - name: reboot the servers
+ command: /sbin/reboot -t now
+
+Another way to pass arguments to a module is using YAML syntax, also called 'complex args'.
+
+.. code-block:: yaml
+
+ - name: restart webserver
+ service:
+ name: httpd
+ state: restarted
+
+All modules return JSON format data. This means modules can be written in any programming language. Modules should be idempotent, and should avoid making any changes if they detect that the current state matches the desired final state. When used in an Ansible playbook, modules can trigger 'change events' in the form of notifying :ref:`handlers <handlers>` to run additional tasks.
+
+You can access the documentation for each module from the command line with the ansible-doc tool.
+
+.. code-block:: shell-session
+
+ ansible-doc yum
+
+For a list of all available modules, see the :ref:`Collection docs <list_of_collections>`, or run the following at a command prompt.
+
+.. code-block:: shell-session
+
+ ansible-doc -l
+
+
+.. seealso::
+
+ :ref:`intro_adhoc`
+ Examples of using modules in /usr/bin/ansible
+ :ref:`working_with_playbooks`
+ Examples of using modules with /usr/bin/ansible-playbook
+ :ref:`developing_modules`
+ How to write your own modules
+ :ref:`developing_api`
+ Examples of using modules with the Python API
+ `Mailing List <https://groups.google.com/group/ansible-project>`_
+ Questions? Help? Ideas? Stop by the list on Google Groups
+ :ref:`communication_irc`
+ How to join Ansible chat channels
diff --git a/docs/docsite/rst/module_plugin_guide/modules_plugins_index.rst b/docs/docsite/rst/module_plugin_guide/modules_plugins_index.rst
new file mode 100644
index 0000000..4b7f550
--- /dev/null
+++ b/docs/docsite/rst/module_plugin_guide/modules_plugins_index.rst
@@ -0,0 +1,6 @@
+.. _index_modules_plugins:
+
+Modules and plugins index
+=========================
+
+You can find an index of modules and plugins at :ref:`all_modules_and_plugins`. \ No newline at end of file
diff --git a/docs/docsite/rst/module_plugin_guide/modules_support.rst b/docs/docsite/rst/module_plugin_guide/modules_support.rst
new file mode 100644
index 0000000..566ae43
--- /dev/null
+++ b/docs/docsite/rst/module_plugin_guide/modules_support.rst
@@ -0,0 +1,70 @@
+.. _modules_support:
+
+******************************
+Module maintenance and support
+******************************
+
+If you are using a module and you discover a bug, you may want to know where to report that bug, who is responsible for fixing it, and how you can track changes to the module. If you are a Red Hat subscriber, you may want to know whether you can get support for the issue you are facing.
+
+Starting in Ansible 2.10, most modules live in collections. The distribution method for each collection reflects the maintenance and support for the modules in that collection.
+
+.. contents::
+ :local:
+
+Maintenance
+===========
+
+.. table::
+ :class: documentation-table
+
+ ============================= ========================================== ==========================
+ Collection Code location Maintained by
+ ============================= ========================================== ==========================
+ ansible.builtin `ansible/ansible repo`_ on GitHub core team
+
+ distributed on Galaxy various; follow ``repo`` link community or partners
+
+ distributed on Automation Hub various; follow ``repo`` link content team or partners
+ ============================= ========================================== ==========================
+
+.. _ansible/ansible repo: https://github.com/ansible/ansible/tree/devel/lib/ansible/modules
+
+Issue Reporting
+===============
+
+If you find a bug that affects a plugin in the main Ansible repo, also known as ``ansible-core``:
+
+ #. Confirm that you are running the latest stable version of Ansible or the devel branch.
+ #. Look at the `issue tracker in the Ansible repo <https://github.com/ansible/ansible/issues>`_ to see if an issue has already been filed.
+ #. Create an issue if one does not already exist. Include as much detail as you can about the behavior you discovered.
+
+If you find a bug that affects a plugin in a Galaxy collection:
+
+ #. Find the collection on Galaxy.
+ #. Find the issue tracker for the collection.
+ #. Look there to see if an issue has already been filed.
+ #. Create an issue if one does not already exist. Include as much detail as you can about the behavior you discovered.
+
+Some partner collections may be hosted in private repositories.
+
+If you are not sure whether the behavior you see is a bug, if you have questions, if you want to discuss development-oriented topics, or if you just want to get in touch, use one of our Google mailing lists or chat channels (using Matrix at ansible.im or using IRC at `irc.libera.chat <https://libera.chat/>`_) to :ref:`communicate with Ansiblers <communication>`.
+
+If you find a bug that affects a module in an Automation Hub collection:
+
+ #. If the collection offers an Issue Tracker link on Automation Hub, click there and open an issue on the collection repository. If it does not, follow the standard process for reporting issues on the `Red Hat Customer Portal <https://access.redhat.com/>`_. You must have a subscription to the Red Hat Ansible Automation Platform to create an issue on the portal.
+
+Support
+=======
+
+All plugins that remain in ``ansible-core`` and all collections hosted in Automation Hub are supported by Red Hat. No other plugins or collections are supported by Red Hat. If you have a subscription to the Red Hat Ansible Automation Platform, you can find more information and resources on the `Red Hat Customer Portal. <https://access.redhat.com/>`_
+
+.. seealso::
+
+ :ref:`intro_adhoc`
+ Examples of using modules in /usr/bin/ansible
+ :ref:`working_with_playbooks`
+ Examples of using modules with /usr/bin/ansible-playbook
+ `Mailing List <https://groups.google.com/group/ansible-project>`_
+ Questions? Help? Ideas? Stop by the list on Google Groups
+ :ref:`communication_irc`
+ How to join Ansible chat channels
diff --git a/docs/docsite/rst/module_plugin_guide/plugin_filtering_config.rst b/docs/docsite/rst/module_plugin_guide/plugin_filtering_config.rst
new file mode 100644
index 0000000..28f7d48
--- /dev/null
+++ b/docs/docsite/rst/module_plugin_guide/plugin_filtering_config.rst
@@ -0,0 +1,26 @@
+.. _plugin_filtering_config:
+
+Rejecting modules
+=================
+
+If you want to avoid using certain modules, you can add them to a reject list to prevent Ansible from loading them. To reject plugins, create a yaml configuration file. The default location for this file is :file:`/etc/ansible/plugin_filters.yml`. You can select a different path for the reject list using the :ref:`PLUGIN_FILTERS_CFG` setting in the ``defaults`` section of your ansible.cfg. Here is an example reject list:
+
+.. code-block:: YAML
+
+ ---
+ filter_version: '1.0'
+ module_rejectlist:
+ # Deprecated
+ - docker
+ # We only allow pip, not easy_install
+ - easy_install
+
+The file contains two fields:
+
+ * A file version so that you can update the format while keeping backwards compatibility in the future. The present version should be the string, ``"1.0"``
+
+ * A list of modules to reject. Ansible will not load any module in this list when it searches for a module to invoke for a task.
+
+.. note::
+
+ The ``stat`` module is required for Ansible to run. Do not add this module to your reject list.