Skip to content
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

[WIP] Unpin rstcheck dependency and update to version 6.x #2344

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Using locally installed collections adjacent to playbooks has some benefits, suc

Here is an example of keeping a collection adjacent to the current playbook, under a ``collections/ansible_collections/`` directory structure.

.. code-block:: text
.. code-block:: console
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really console. Console is for snippets copied from terminal output, featuring a prompt followed by its command and then the output.


./
├── play.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Once installed, you can reference a collection content by its fully qualified co

This works for roles or any type of plugin distributed within the collection:

.. code-block:: yaml
.. code-block:: ini
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be yaml+jinja? This is definitely not an INI file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly.


- name: Reference collections contents using their FQCNs
hosts: all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ A collection skeleton is a directory that looks like a collection directory but

An example ``galaxy.yml.j2`` file that accepts an optional dictionary variable ``dependencies`` could look like this:

.. code-block:: yaml
.. code-block:: ini
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be jinja, since it is a Jinja template (that will end up as YAML, but right now is not YAML). INI is definitely wrong here.


namespace: {{ namespace }}
name: {{ collection_name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ For example, to exclude the :file:`sensitive` folder within the ``playbooks`` fo

By default, the ``MANIFEST.in`` style directives would exclude all files by default, but there are default directives in place. Those default directives are described below. To see the directives in use during build, pass ``-vvv`` with the ``ansible-galaxy collection build`` command.

.. code-block::
.. code-block:: manifest

include meta/*.yml
include *.txt *.md *.rst COPYING LICENSE
Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/inventory/implicit_localhost.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ When you try to reference a ``localhost`` and you don't have it defined in inven

In a case like this (or ``local_action``) when Ansible needs to contact a 'localhost' but you did not supply one, we create one for you. This host is defined with specific connection variables equivalent to this in an inventory:

.. code-block:: yaml
.. code-block:: ini

...

Expand Down
4 changes: 2 additions & 2 deletions docs/docsite/rst/inventory_guide/intro_patterns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Slicing at specific items

If *i* is negative, the index is relative to the end of sequence *s*: ``len(s) + i`` is substituted. However ``-0`` is ``0``.

.. code-block:: yaml
.. code-block:: python

webservers[0] # == cobweb
webservers[-1] # == weber
Expand All @@ -198,7 +198,7 @@ If *i* is greater than *j*, the slice is empty.
If *i* is equal to *j*, the *s[i]* is substituted.


.. code-block:: yaml
.. code-block:: python

webservers[0:2] # == webservers[0],webservers[1],webservers[2]
# == cobweb,webbing,weber
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ For any subsequent changes to the functionality, update the model first and use

For example, the resource model builder includes the ``myos_interfaces.yml`` sample in the :file:`models` directory, as seen below:

.. code-block:: yaml
.. code-block:: ini

---
GENERATOR_VERSION: '1.0'
Expand Down Expand Up @@ -359,7 +359,7 @@ Using the collection

This example shows how to use the generated collection in a playbook:

.. code-block:: yaml
.. code-block:: ini

----
- hosts: myos101
Expand Down Expand Up @@ -558,7 +558,7 @@ The following example walks through the integration tests for the ``vyos.vyos.vy

``test/integration/targets/vyos_l3_interfaces/tests/cli/overridden.yaml``

.. code-block:: yaml
.. code-block:: ini

---
- debug:
Expand Down
4 changes: 2 additions & 2 deletions docs/docsite/rst/network/getting_started/first_inventory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ and type in the vault password for ``my_user``.

The :option:`--vault-id <ansible-playbook --vault-id>` flag allows different vault passwords for different users or different levels of access. The output includes the username ``my_user`` from your ``ansible-vault`` command and uses the YAML syntax ``key: value``:

.. code-block:: yaml
.. code-block:: ini

ansible_password: !vault |
$ANSIBLE_VAULT;1.2;AES256;my_user
Expand All @@ -374,7 +374,7 @@ The :option:`--vault-id <ansible-playbook --vault-id>` flag allows different vau

This is an example using an extract from a YAML inventory, as the INI format does not support inline vaults:

.. code-block:: yaml
.. code-block:: ini

...

Expand Down
8 changes: 4 additions & 4 deletions docs/docsite/rst/network/user_guide/cli_parsing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Taking a deeper dive into this task:

Lastly in this task, the ``set_fact`` option sets the following ``interfaces`` fact for the device based on the now-structured data returned from ``cli_parse``:

.. code-block:: yaml
.. code-block:: ini

Ethernet1/1:
hardware: 100/1000/10000 Ethernet
Expand Down Expand Up @@ -258,7 +258,7 @@ This task assumes you previously gathered facts to determine the ``ansible_distr

Lastly in this task, the ``set_fact`` option sets the following ``interfaces`` fact for the host, based on the now-structured data returned from ``cli_parse``:

.. code-block:: yaml
.. code-block:: ini

lo:
broadcast: false
Expand Down Expand Up @@ -399,7 +399,7 @@ Taking a deeper dive into this task:

This task sets the following fact as the ``interfaces`` fact for the host:

.. code-block:: yaml
.. code-block:: ini

mgmt0:
admin_state: up
Expand Down Expand Up @@ -615,7 +615,7 @@ Although Ansible contains a number of plugins that can convert XML to Ansible na

This example task runs the ``show interface`` command and parses the output as XML:

.. code-block:: yaml
.. code-block:: ini

- name: "Run command and parse as xml"
ansible.utils.cli_parse:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The "Vault" feature of Ansible allows you to keep sensitive data such as passwor

Here's what it would look like if you specified your SSH passwords (encrypted with Ansible Vault) among your variables:

.. code-block:: yaml
.. code-block:: ini

ansible_connection: ansible.netcommon.network_cli
ansible_network_os: vyos.vyos.vyos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Be sure to fully understand the security implications of enabling this option. T

Before running ``ansible-playbook`` run the following commands to enable logging:

.. code-block:: text
.. code-block:: shell

# Specify the location for the log file
export ANSIBLE_LOG_PATH=~/ansible.log
Expand All @@ -140,7 +140,7 @@ To make this a global setting, add the following to your ``ansible.cfg`` file:

or enable the environment variable `ANSIBLE_PERSISTENT_LOG_MESSAGES`:

.. code-block:: text
.. code-block:: shell

# Enable device interaction logging
export ANSIBLE_PERSISTENT_LOG_MESSAGES=True
Expand Down Expand Up @@ -168,9 +168,9 @@ For Ansible this can be done by ensuring you are only running against one remote

`ad hoc` refers to running Ansible to perform some quick command using ``/usr/bin/ansible``, rather than the orchestration language, which is ``/usr/bin/ansible-playbook``. In this case we can ensure connectivity by attempting to execute a single command on the remote device:

.. code-block:: text
.. code-block:: shell

ansible -m arista.eos.eos_command -a 'commands=?' -i inventory switch1.example.net -e 'ansible_connection=ansible.netcommon.network_cli' -u admin -k
ansible -m arista.eos.eos_command -a 'commands=?' -i inventory switch1.example.net -e 'ansible_connection=ansible.netcommon.network_cli' -u admin -k

In the above example, we:

Expand All @@ -184,7 +184,7 @@ If you have SSH keys configured correctly, you don't need to specify the ``-k``

If the connection still fails you can combine it with the enable_network_logging parameter. For example:

.. code-block:: text
.. code-block:: shell

# Specify the location for the log file
export ANSIBLE_LOG_PATH=~/ansible.log
Expand All @@ -208,7 +208,7 @@ The ``Socket path does not exist or cannot be found`` and ``Unable to connect t

For example:

.. code-block:: none
.. code-block:: json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: json
.. code-block:: ansible-output


fatal: [spine02]: FAILED! => {
"changed": false,
Expand All @@ -221,7 +221,7 @@ For example:

or

.. code-block:: none
.. code-block:: json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: json
.. code-block:: ansible-output


fatal: [spine02]: FAILED! => {
"changed": false,
Expand All @@ -240,13 +240,13 @@ Suggestions to resolve:

If the identified error message from the log file is:

.. code-block:: yaml
.. code-block:: text

2017-04-04 12:19:05,670 p=18591 u=fred | command timeout triggered, timeout value is 30 secs

or

.. code-block:: yaml
.. code-block:: text

2017-04-04 12:19:05,670 p=18591 u=fred | persistent connection idle timeout triggered, timeout value is 30 secs

Expand All @@ -267,7 +267,7 @@ The ``unable to open shell`` message means that the ``ansible-connection`` daemo

For example:

.. code-block:: none
.. code-block:: console
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: console
.. code-block:: ansible-output


TASK [prepare_eos_tests : enable cli on remote device] **************************************************
fatal: [veos01]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell"}
Expand All @@ -276,7 +276,7 @@ For example:
or:


.. code-block:: none
.. code-block:: console
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: console
.. code-block:: ansible-output


TASK [ios_system : configure name_servers] *************************************************************
task path:
Expand All @@ -303,7 +303,7 @@ Indicates that the remote host you are trying to connect to can not be reached

For example:

.. code-block:: yaml
.. code-block:: text

2017-04-04 11:39:48,147 p=15299 u=fred | control socket path is /home/fred/.ansible/pc/ca5960d27a
2017-04-04 11:39:48,147 p=15299 u=fred | current working directory is /home/fred/git/ansible-inc/stable-2.3/test/integration
Expand Down Expand Up @@ -332,7 +332,7 @@ Occurs if the credentials (username, passwords, or ssh keys) passed to ``ansible

For example:

.. code-block:: yaml
.. code-block:: text

<ios01> ESTABLISH CONNECTION FOR USER: cisco on PORT 22 TO ios01
<ios01> Authentication failed.
Expand All @@ -342,7 +342,7 @@ Suggestions to resolve:

If you are specifying credentials through ``password:`` (either directly or through ``provider:``) or the environment variable `ANSIBLE_NET_PASSWORD` it is possible that ``paramiko`` (the Python SSH library that Ansible uses) is using ssh keys, and therefore the credentials you are specifying are being ignored. To find out if this is the case, disable "look for keys". This can be done like this:

.. code-block:: yaml
.. code-block:: shell

export ANSIBLE_PARAMIKO_LOOK_FOR_KEYS=False

Expand All @@ -363,7 +363,7 @@ When using persistent connections with Paramiko, the connection runs in a backgr

For example:

.. code-block:: yaml
.. code-block:: text

2017-04-04 12:06:03,486 p=17981 u=fred | using connection plugin network_cli
2017-04-04 12:06:04,680 p=17981 u=fred | connecting to host veos01 returned an error
Expand Down Expand Up @@ -412,7 +412,7 @@ Error: "No authentication methods available"

For example:

.. code-block:: yaml
.. code-block:: text

2017-04-04 12:19:05,670 p=18591 u=fred | creating new control socket for host veos01:None as user admin
2017-04-04 12:19:05,670 p=18591 u=fred | control socket path is /home/fred/.ansible/pc/ca5960d27a
Expand Down Expand Up @@ -451,15 +451,15 @@ Persistent connection idle timeout

By default, ``ANSIBLE_PERSISTENT_CONNECT_TIMEOUT`` is set to 30 (seconds). You may see the following error if this value is too low:

.. code-block:: yaml
.. code-block:: text

2017-04-04 12:19:05,670 p=18591 u=fred | persistent connection idle timeout triggered, timeout value is 30 secs

Suggestions to resolve:

Increase value of persistent connection idle timeout:

.. code-block:: sh
.. code-block:: shell

export ANSIBLE_PERSISTENT_CONNECT_TIMEOUT=60

Expand All @@ -477,7 +477,7 @@ By default, ``ANSIBLE_PERSISTENT_COMMAND_TIMEOUT`` is set to 30 (seconds). Prior
You may see the following error if this value is too low:


.. code-block:: yaml
.. code-block:: text

2017-04-04 12:19:05,670 p=18591 u=fred | command timeout triggered, timeout value is 30 secs

Expand All @@ -486,7 +486,7 @@ Suggestions to resolve:
* Option 1 (Global command timeout setting):
Increase value of command timeout in configuration file or by setting environment variable.

.. code-block:: yaml
.. code-block:: shell

export ANSIBLE_PERSISTENT_COMMAND_TIMEOUT=60

Expand All @@ -510,7 +510,7 @@ Suggestions to resolve:
Suggestions to resolve:

Some modules support a ``timeout`` option, which is different to the ``timeout`` keyword for tasks.

.. code-block:: yaml

- name: save running-config
Expand All @@ -521,7 +521,7 @@ Suggestions to resolve:


Suggestions to resolve:

If the module does not support the ``timeout`` option directly, most networking connection plugins can enable similar functionality with the ``ansible_command_timeout`` variable.

.. code-block:: yaml
Expand All @@ -543,7 +543,7 @@ Persistent connection retry timeout

By default, ``ANSIBLE_PERSISTENT_CONNECT_RETRY_TIMEOUT`` is set to 15 (seconds). You may see the following error if this value is too low:

.. code-block:: yaml
.. code-block:: text

2017-04-04 12:19:35,708 p=18591 u=fred | connect retry timeout expired, unable to connect to control socket
2017-04-04 12:19:35,709 p=18591 u=fred | persistent_connect_retry_timeout is 15 secs
Expand All @@ -555,7 +555,7 @@ Note: This value should be greater than the SSH timeout value (the timeout value
section in the configuration file) and less than the value of the persistent
connection idle timeout (connect_timeout).

.. code-block:: yaml
.. code-block:: shell

export ANSIBLE_PERSISTENT_CONNECT_RETRY_TIMEOUT=30

Expand Down Expand Up @@ -668,7 +668,7 @@ network device by first connecting to the host specified in

You can also set the proxy target for all hosts by using environment variables.

.. code-block:: sh
.. code-block:: shell

export ANSIBLE_SSH_ARGS='-o ProxyCommand="ssh -W %h:%p -q bastion01"'

Expand All @@ -693,7 +693,7 @@ from the given custom ssh file path
Example ssh config file (~/.ssh/config)
---------------------------------------

.. code-block:: ini
.. code-block:: shell

Host jumphost
HostName jumphost.domain.name.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The following table shows an example of how an initial resource configuration ch
+-----------------------------------------+------------------------------------+-----------------------------------------+
| Resource starting configuration | task-provided configuration (YAML) | Final resource configuration on device |
+=========================================+====================================+=========================================+
| .. code-block:: text | .. code-block:: yaml | *merged* |
| .. code-block:: text | .. code-block:: ini | *merged* |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid trailing whitespaces. Also, it's not ini, just like in many places Felix marked.

Suggested change
| .. code-block:: text | .. code-block:: ini | *merged* |
| .. code-block:: text | .. code-block:: yaml | *merged* |

| | | .. code-block:: text |
| interface loopback100 | config: | |
| ip address 10.10.1.100 255.255.255.0 | - ipv6: | interface loopback100 |
Expand Down Expand Up @@ -88,7 +88,7 @@ Network resource modules return the following details:
* The *after* state - the new resource configuration that exists on the network device after the task was executed.
* Commands - any commands configured on the device.

.. code-block:: yaml
.. code-block:: ini

ok: [nxos101] =>
result:
Expand Down
Loading
Loading