8000 add platform docs to network dev guide by samccann · Pull Request #57960 · ansible/ansible · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add platform docs to network dev guide #57960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docsite/rst/dev_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Find the task that best describes what you want to do:
* I want to :ref:`debug my module code <debugging>`.
* I want to :ref:`add tests <developing_testing>`.
* I want to :ref:`document my module <module_documenting>`.
* I want to :ref:`document my set of modules for a network platform <documenting_modules_network>`.
* I want to follow :ref:`conventions and tips for clean, usable module code <developing_modules_best_practices>`.
* I want to :ref:`make sure my code runs on Python 2 and Python 3 <developing_python_3>`.

Expand Down
52 changes: 52 additions & 0 deletions docs/docsite/rst/network/dev_guide/documenting_modules_network.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

.. _documenting_modules_network:

*********************************
Documenting new network platforms
*********************************

.. contents::
:local:

When you create network modules for a new platform, or modify the connections provided by an existing network platform(such as ``network_cli`` and ``httpapi``), you also need to update the :ref:`settings_by_platform` table and add or modify the Platform Options file for your platform.

You should already have documented each module as described in :ref:`developing_modules_documenting`.

Modifying the platform options table
====================================

The :ref:`settings_by_platform` table is a convenient summary of the connections options provided by each network platform that has modules in Ansible. Add a row for your platform to this table, in alphabetical order. For example:

.. code-block:: text

+-------------------+-------------------------+-------------+---------+---------+----------+
| My OS | ``myos`` | ✓ | ✓ | | ✓ |

Ensure that the table stays formatted correctly. That is:

* Each row is inserted in alphabetical order.
* The cell division ``|`` markers line up with the ``+`` markers.
* The check marks appear only for the connection types provided by the network modules.



Adding a platform-specific options section
==========================================

The platform- specific sections are individual ``.rst`` files that provide more detailed information for the users of your network platform modules. Name your new file ``platform_<name>.rst`` (for example, ``platform_myos.rst``). The platform name should match the module prefix. See `platform_eos.rst <https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/network/user_guide/platform_eos.rst>`_ and :ref:`eos_platform_options` for an example of the details you should provide in your platform-specific options section.

Your platform-specific section should include the following:

* **Connections available table** - a deeper dive into each connection type, including details on credentials, indirect access, connections settings, and enable mode.
* **How to use each connection type** - with working examples of each connection type.

If your network platform supports SSH connections, also include the following at the bottom of your ``.rst`` file:

.. code-block:: text

.. include:: shared_snippets/SSH_warning.txt

Adding your new file to the table of contents
8000 =============================================

As a final step, add your new file in alphabetical order in the ``platform_index.rst`` file. You should then build the documentation to verify your additions. See :ref:`community_documentation_contributions` for more details.
4 changes: 4 additions & 0 deletions docs/docsite/rst/network/dev_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ If you want to extend Ansible for Network Automation by creating a module or plu
Find the network developer task that best describes what you want to do:

* I want to :ref:`develop a network connection plugin <developing_plugins_network>`.
* I want to :ref:`document my set of modules for a network platform <documenting_modules_network>`.

If you prefer to read the entire guide, here's a list of the pages in order.

.. toctree::
:maxdepth: 1

developing_plugins_network
documenting_modules_network
0