From fbb66f29c20ff39e17c41667403aa0680c450a2c Mon Sep 17 00:00:00 2001 From: Ganesh Hubale Date: Sat, 11 Jan 2025 22:51:32 +0530 Subject: [PATCH 01/17] Update RST files to specify codeblock language attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ganesh Hubale <25399590+ganeshhubale@users.noreply.github.com> Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) Co-authored-by: Felix Fontein --- .../collections_using_playbooks.rst | 6 +-- .../developing_collections_creating.rst | 2 +- .../developing_collections_distributing.rst | 2 +- .../rst/inventory_guide/intro_patterns.rst | 4 +- .../developing_resource_modules_network.rst | 4 +- .../network_debug_troubleshooting.rst | 52 +++++++++---------- docs/docsite/rst/os_guide/intro_bsd.rst | 2 +- docs/docsite/rst/os_guide/windows_ssh.rst | 2 +- .../rst/playbook_guide/playbooks_debugger.rst | 4 +- .../playbook_guide/playbooks_templating.rst | 8 +-- .../general_precedence.rst | 2 +- 11 files changed, 45 insertions(+), 43 deletions(-) diff --git a/docs/docsite/rst/collections_guide/collections_using_playbooks.rst b/docs/docsite/rst/collections_guide/collections_using_playbooks.rst index 22f17477ece..3a900a9698f 100644 --- a/docs/docsite/rst/collections_guide/collections_using_playbooks.rst +++ b/docs/docsite/rst/collections_guide/collections_using_playbooks.rst @@ -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:: yaml+jinja - name: Reference collections contents using their FQCNs hosts: all @@ -64,7 +64,7 @@ Using ``collections`` in playbooks In a playbook, you can control the collections Ansible searches for modules and action plugins to execute. However, any roles you call in your playbook define their own collections search order; they do not inherit the calling playbook's settings. This is true even if the role does not define its own ``collections`` keyword. -.. code-block:: yaml +.. code-block:: yaml+jinja - name: Run a play using the collections keyword hosts: all @@ -116,7 +116,7 @@ From inside a playbook: A few recommendations when creating such playbooks, ``hosts:`` should be generic or at least have a variable input. -.. code-block:: yaml +.. code-block:: yaml+jinja - hosts: all # Use --limit or customized inventory to restrict hosts targeted diff --git a/docs/docsite/rst/dev_guide/developing_collections_creating.rst b/docs/docsite/rst/dev_guide/developing_collections_creating.rst index af44d273696..3108a9e732b 100644 --- a/docs/docsite/rst/dev_guide/developing_collections_creating.rst +++ b/docs/docsite/rst/dev_guide/developing_collections_creating.rst @@ -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:: jinja namespace: {{ namespace }} name: {{ collection_name }} diff --git a/docs/docsite/rst/dev_guide/developing_collections_distributing.rst b/docs/docsite/rst/dev_guide/developing_collections_distributing.rst index 9f9a8d38164..d1c3663b2cb 100644 --- a/docs/docsite/rst/dev_guide/developing_collections_distributing.rst +++ b/docs/docsite/rst/dev_guide/developing_collections_distributing.rst @@ -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 diff --git a/docs/docsite/rst/inventory_guide/intro_patterns.rst b/docs/docsite/rst/inventory_guide/intro_patterns.rst index ac75090a33f..9aa59278d74 100644 --- a/docs/docsite/rst/inventory_guide/intro_patterns.rst +++ b/docs/docsite/rst/inventory_guide/intro_patterns.rst @@ -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 @@ -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 diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index 3df7870ac9f..b52438eb12b 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -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' @@ -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:: yaml+jinja --- - debug: diff --git a/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst b/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst index 30668dff309..b728d2eecc7 100644 --- a/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst +++ b/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst @@ -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 @@ -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 @@ -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: @@ -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 @@ -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:: ansible-output fatal: [spine02]: FAILED! => { "changed": false, @@ -221,7 +221,7 @@ For example: or -.. code-block:: none +.. code-block:: ansible-output fatal: [spine02]: FAILED! => { "changed": false, @@ -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 @@ -267,7 +267,7 @@ The ``unable to open shell`` message means that the ``ansible-connection`` daemo For example: -.. code-block:: none +.. 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"} @@ -276,7 +276,7 @@ For example: or: -.. code-block:: none +.. code-block:: ansible-output TASK [ios_system : configure name_servers] ************************************************************* task path: @@ -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 @@ -332,7 +332,7 @@ Occurs if the credentials (username, passwords, or ssh keys) passed to ``ansible For example: -.. code-block:: yaml +.. code-block:: text ESTABLISH CONNECTION FOR USER: cisco on PORT 22 TO ios01 Authentication failed. @@ -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 @@ -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 @@ -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 @@ -451,7 +451,7 @@ 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 @@ -459,7 +459,7 @@ Suggestions to resolve: Increase value of persistent connection idle timeout: -.. code-block:: sh +.. code-block:: shell export ANSIBLE_PERSISTENT_CONNECT_TIMEOUT=60 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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"' @@ -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 diff --git a/docs/docsite/rst/os_guide/intro_bsd.rst b/docs/docsite/rst/os_guide/intro_bsd.rst index bcbeba5a227..3219f87335d 100644 --- a/docs/docsite/rst/os_guide/intro_bsd.rst +++ b/docs/docsite/rst/os_guide/intro_bsd.rst @@ -157,7 +157,7 @@ The playbook below displays the details -.. code-block:: yaml +.. code-block:: ansible-output shell> ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook -i hosts playbook.yml diff --git a/docs/docsite/rst/os_guide/windows_ssh.rst b/docs/docsite/rst/os_guide/windows_ssh.rst index e55b9049b00..fcd9c338c2f 100644 --- a/docs/docsite/rst/os_guide/windows_ssh.rst +++ b/docs/docsite/rst/os_guide/windows_ssh.rst @@ -128,7 +128,7 @@ SSH key authentication on Windows works in the same way as SSH key authenticatio One difference is that the ``authorized_keys`` file for admin users is not located in the ``.ssh`` folder in the user's profile directory but in ``C:\ProgramData\ssh\administrators_authorized_keys``. It is possible to change the location of the ``authorized_keys`` file for admin users back to the user profile directory by removing, or commenting, the lines in ``C:\ProgramData\ssh\sshd_config`` and restarting the ``sshd`` service. -.. code-block:: +.. code-block:: text Match Group administrators AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys diff --git a/docs/docsite/rst/playbook_guide/playbooks_debugger.rst b/docs/docsite/rst/playbook_guide/playbooks_debugger.rst index 1c4fc845d8c..70cc3327ff2 100644 --- a/docs/docsite/rst/playbook_guide/playbooks_debugger.rst +++ b/docs/docsite/rst/playbook_guide/playbooks_debugger.rst @@ -116,7 +116,9 @@ If you are running legacy playbooks or roles, you may see the debugger enabled a - hosts: test strategy: debug tasks: - ... + - name: Example task + debug: + msg: "This is a debug message" Or in ansible.cfg: diff --git a/docs/docsite/rst/playbook_guide/playbooks_templating.rst b/docs/docsite/rst/playbook_guide/playbooks_templating.rst index 506a17dab3e..5f828c8d9fb 100644 --- a/docs/docsite/rst/playbook_guide/playbooks_templating.rst +++ b/docs/docsite/rst/playbook_guide/playbooks_templating.rst @@ -19,15 +19,15 @@ Ansible parses templates on the control node and passes only the information nee .. note:: Files and data used by the :ref:`template module ` must be utf-8 encoded. - + Jinja2 Example ================== In this example, we want to write the server hostname to its /tmp/hostname. Our directory looks like this: - -.. code-block:: + +.. code-block:: console ├── hostname.yml ├── templates @@ -51,7 +51,7 @@ Our test.j2: .. code-block:: yaml My name is {{ ansible_facts['hostname'] }} - + .. seealso:: diff --git a/docs/docsite/rst/reference_appendices/general_precedence.rst b/docs/docsite/rst/reference_appendices/general_precedence.rst index 7beb76b1c73..2441b7c2a96 100644 --- a/docs/docsite/rst/reference_appendices/general_precedence.rst +++ b/docs/docsite/rst/reference_appendices/general_precedence.rst @@ -167,7 +167,7 @@ This category only applies to things that take direct options, generally modules Outside of task actions, the most recognizable 'direct assignments' are with lookup, filter and test plugins: -.. code:: +.. code:: text lookup('plugin', direct1='value', direct2='value2') From 12e53bd24766ffb6085c7d809e4d16cfa71141ee Mon Sep 17 00:00:00 2001 From: Don Naro Date: Tue, 28 Jan 2025 20:31:18 +0000 Subject: [PATCH 02/17] change lexer names to fix ci --- .../rst/dev_guide/developing_collections_distributing.rst | 2 +- docs/docsite/rst/os_guide/intro_bsd.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docsite/rst/dev_guide/developing_collections_distributing.rst b/docs/docsite/rst/dev_guide/developing_collections_distributing.rst index d1c3663b2cb..7c9380921e2 100644 --- a/docs/docsite/rst/dev_guide/developing_collections_distributing.rst +++ b/docs/docsite/rst/dev_guide/developing_collections_distributing.rst @@ -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:: manifest +.. code-block:: text include meta/*.yml include *.txt *.md *.rst COPYING LICENSE diff --git a/docs/docsite/rst/os_guide/intro_bsd.rst b/docs/docsite/rst/os_guide/intro_bsd.rst index 3219f87335d..c2fa0709878 100644 --- a/docs/docsite/rst/os_guide/intro_bsd.rst +++ b/docs/docsite/rst/os_guide/intro_bsd.rst @@ -157,7 +157,7 @@ The playbook below displays the details -.. code-block:: ansible-output +.. code-block:: text shell> ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook -i hosts playbook.yml From 5b86194536781498e714a329a0203d344abab2f6 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Tue, 28 Jan 2025 20:36:11 +0000 Subject: [PATCH 03/17] yaml is yaml not ini --- .../network/dev_guide/developing_resource_modules_network.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index b52438eb12b..5622f60c345 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -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:: ini +.. code-block:: yaml --- GENERATOR_VERSION: '1.0' From 5fe993175a5d144afe635c2fbd2d90a735e18bd7 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 29 Jan 2025 10:05:59 +0000 Subject: [PATCH 04/17] Update docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst Co-authored-by: Felix Fontein --- .../rst/network/user_guide/network_debug_troubleshooting.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst b/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst index b728d2eecc7..dc218d2f4f6 100644 --- a/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst +++ b/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst @@ -511,7 +511,7 @@ Suggestions to resolve: Some modules support a ``timeout`` option, which is different to the ``timeout`` keyword for tasks. - .. code-block:: yaml + .. code-block:: yaml+jinja - name: save running-config cisco.ios.ios_command: From 2fd4bbf73c5c013b644b52427418b8fc17664f3f Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 29 Jan 2025 10:29:13 +0000 Subject: [PATCH 05/17] yamllint codeblock --- .../developing_resource_modules_network.rst | 86 +++++++++---------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index 5622f60c345..ecc8c83705c 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -561,66 +561,66 @@ The following example walks through the integration tests for the ``vyos.vyos.vy .. code-block:: yaml+jinja --- - - debug: - msg: START vyos_l3_interfaces merged integration tests on connection={{ ansible_connection - }} + - debug: null + msg: START vyos_l3_interfaces merged integration tests on connection={{ + ansible_connection }} - import_tasks: _remove_config.yaml - block: - - import_tasks: _populate.yaml + - import_tasks: _populate.yaml - - name: Overrides all device configuration with provided configuration - register: result - vyos.vyos.vyos_l3_interfaces: &id001 - config: + - name: Overrides all device configuration with provided configuration + register: result + vyos.vyos.vyos_l3_interfaces: &id001 + config: - - name: eth0 - ipv4: + - name: eth0 + ipv4: - - address: dhcp + - address: dhcp - - name: eth1 - ipv4: + - name: eth1 + ipv4: - - address: 192.0.2.15/24 - state: overridden + - address: 192.0.2.15/24 + state: overridden - - name: Assert that before dicts were correctly generated - assert: - that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + - name: Assert that before dicts were correctly generated + assert: + that: + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - name: Assert that correct commands were generated - assert: - that: - - "{{ overridden['commands'] | symmetric_difference(result['commands'])\ - \ |length == 0 }}" + - name: Assert that correct commands were generated + assert: + that: + - "{{ overridden['commands'] | symmetric_difference(result['commands'])\ + \ |length == 0 }}" - - name: Assert that after dicts were correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['after']) |length\ - \ == 0 }}" + - name: Assert that after dicts were correctly generated + assert: + that: + - "{{ overridden['after'] | symmetric_difference(result['after']) |length\ + \ == 0 }}" - - name: Overrides all device configuration with provided configurations (IDEMPOTENT) - register: result - vyos.vyos.vyos_l3_interfaces: *id001 + - name: Override device configuration with provided configuration (IDEMPOTENT) + register: result + vyos.vyos.vyos_l3_interfaces: *id001 - - name: Assert that the previous task was idempotent - assert: - that: - - result['changed'] == false + - name: Assert that the previous task was idempotent + assert: + that: + - result['changed'] == false - - name: Assert that before dicts were correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['before']) |length\ - \ == 0 }}" - always: + - name: Assert that before dicts were correctly generated + assert: + that: + - "{{ overridden['after'] | symmetric_difference(result['before'])\ + \ |length == 0 }}" + always: - - import_tasks: _remove_config.yaml + - import_tasks: _remove_config.yaml Detecting test resources at runtime From fa14bb78939253f2d695500f6c4c18f497c651f5 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 29 Jan 2025 19:59:10 +0000 Subject: [PATCH 06/17] Update docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst Co-authored-by: Felix Fontein --- .../network/dev_guide/developing_resource_modules_network.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index ecc8c83705c..4c4ea499882 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -562,8 +562,7 @@ The following example walks through the integration tests for the ``vyos.vyos.vy --- - debug: null - msg: START vyos_l3_interfaces merged integration tests on connection={{ - ansible_connection }} + msg: START vyos_l3_interfaces merged integration tests on connection={{ ansible_connection }} - import_tasks: _remove_config.yaml From ad748950c194a8c53479839b25d3e57ba228132f Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 29 Jan 2025 20:06:48 +0000 Subject: [PATCH 07/17] yamlgit add . --- .../developing_resource_modules_network.rst | 102 +++++++++--------- 1 file changed, 49 insertions(+), 53 deletions(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index 4c4ea499882..67ef528cd4e 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -567,59 +567,55 @@ The following example walks through the integration tests for the ``vyos.vyos.vy - import_tasks: _remove_config.yaml - block: - - - import_tasks: _populate.yaml - - - name: Overrides all device configuration with provided configuration - register: result - vyos.vyos.vyos_l3_interfaces: &id001 - config: - - - name: eth0 - ipv4: - - - address: dhcp - - - name: eth1 - ipv4: - - - address: 192.0.2.15/24 - state: overridden - - - name: Assert that before dicts were correctly generated - assert: - that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - - name: Assert that correct commands were generated - assert: - that: - - "{{ overridden['commands'] | symmetric_difference(result['commands'])\ - \ |length == 0 }}" - - - name: Assert that after dicts were correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['after']) |length\ - \ == 0 }}" - - - name: Override device configuration with provided configuration (IDEMPOTENT) - register: result - vyos.vyos.vyos_l3_interfaces: *id001 - - - name: Assert that the previous task was idempotent - assert: - that: - - result['changed'] == false - - - name: Assert that before dicts were correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['before'])\ - \ |length == 0 }}" - always: - - - import_tasks: _remove_config.yaml + - import_tasks: _populate.yaml + - name: Overrides all device configuration with provided configuration + register: result + vyos.vyos.vyos_l3_interfaces: + config: + - name: eth0 + ipv4: + - address: dhcp + - name: eth1 + ipv4: + - address: 192.0.2.15/24 + state: overridden + - name: Assert that before dicts were correctly generated + assert: + that: + - "{{ populate | symmetric_difference(result['before']) |length == 0 + }}" + - name: Assert that correct commands were generated + assert: + that: + - "{{ overridden['commands'] | + symmetric_difference(result['commands']) |length == 0 }}" + - name: Assert that after dicts were correctly generated + assert: + that: + - "{{ overridden['after'] | symmetric_difference(result['after']) + |length == 0 }}" + - name: Override device configuration with provided configuration (IDEMPOTENT) + register: result + vyos.vyos.vyos_l3_interfaces: + config: + - name: eth0 + ipv4: + - address: dhcp + - name: eth1 + ipv4: + - address: 192.0.2.15/24 + state: overridden + - name: Assert that the previous task was idempotent + assert: + that: + - result['changed'] == false + - name: Assert that before dicts were correctly generated + assert: + that: + - "{{ overridden['after'] | symmetric_difference(result['before']) + |length == 0 }}" + always: + - import_tasks: _remove_config.yaml Detecting test resources at runtime From d0a67d496fb5758eb5325a2cbc4f6b3808437b45 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 29 Jan 2025 20:12:27 +0000 Subject: [PATCH 08/17] Update docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst Co-authored-by: Felix Fontein --- .../network/dev_guide/developing_resource_modules_network.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index 67ef528cd4e..4d2b7bae4e6 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -582,8 +582,7 @@ The following example walks through the integration tests for the ``vyos.vyos.vy - name: Assert that before dicts were correctly generated assert: that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 - }}" + - "{{ populate | symmetric_difference(result['before']) | length == 0 }}" - name: Assert that correct commands were generated assert: that: From 77ff7e3c3644771ac876fdfbb092a659ebb809ef Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 29 Jan 2025 20:12:41 +0000 Subject: [PATCH 09/17] Update docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst Co-authored-by: Felix Fontein --- .../network/dev_guide/developing_resource_modules_network.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index 4d2b7bae4e6..0a4b873cc38 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -587,7 +587,7 @@ The following example walks through the integration tests for the ``vyos.vyos.vy assert: that: - "{{ overridden['commands'] | - symmetric_difference(result['commands']) |length == 0 }}" + symmetric_difference(result['commands']) | length == 0 }}" - name: Assert that after dicts were correctly generated assert: that: From cff72ef6e27117460553b98541d68535f3bdb78a Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 29 Jan 2025 20:12:56 +0000 Subject: [PATCH 10/17] Update docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst Co-authored-by: Felix Fontein --- .../network/dev_guide/developing_resource_modules_network.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index 0a4b873cc38..6201bf8a9b8 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -592,7 +592,7 @@ The following example walks through the integration tests for the ``vyos.vyos.vy assert: that: - "{{ overridden['after'] | symmetric_difference(result['after']) - |length == 0 }}" + | length == 0 }}" - name: Override device configuration with provided configuration (IDEMPOTENT) register: result vyos.vyos.vyos_l3_interfaces: From 3adf3bb6e98807921337c26f47d8d3029cfda705 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 29 Jan 2025 20:13:06 +0000 Subject: [PATCH 11/17] Update docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst Co-authored-by: Felix Fontein --- .../network/dev_guide/developing_resource_modules_network.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index 6201bf8a9b8..41f5bfb59ad 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -612,7 +612,7 @@ The following example walks through the integration tests for the ``vyos.vyos.vy assert: that: - "{{ overridden['after'] | symmetric_difference(result['before']) - |length == 0 }}" + | length == 0 }}" always: - import_tasks: _remove_config.yaml From 8efd590b725cc91784501a52b3b0eb9979a69a1a Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 29 Jan 2025 20:13:18 +0000 Subject: [PATCH 12/17] Update docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst Co-authored-by: Felix Fontein --- .../network/dev_guide/developing_resource_modules_network.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index 41f5bfb59ad..dffdae85c3a 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -607,7 +607,7 @@ The following example walks through the integration tests for the ``vyos.vyos.vy - name: Assert that the previous task was idempotent assert: that: - - result['changed'] == false + - result is not changed - name: Assert that before dicts were correctly generated assert: that: From 13c1e91c5a41bce4715677b9e0a281318dee834a Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 12 Feb 2025 17:30:37 +0000 Subject: [PATCH 13/17] Update docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- .../rst/network/user_guide/network_debug_troubleshooting.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst b/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst index dc218d2f4f6..a50c7c0c25e 100644 --- a/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst +++ b/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst @@ -693,7 +693,7 @@ from the given custom ssh file path Example ssh config file (~/.ssh/config) --------------------------------------- -.. code-block:: shell +.. code-block:: text Host jumphost HostName jumphost.domain.name.com From 2327700cdd5a605ec4621ed42dd0b131c56e287b Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 12 Feb 2025 17:31:26 +0000 Subject: [PATCH 14/17] Update docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- .../dev_guide/developing_resource_modules_network.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst index dffdae85c3a..63a2e2e8f5d 100644 --- a/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst +++ b/docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst @@ -586,8 +586,11 @@ The following example walks through the integration tests for the ``vyos.vyos.vy - name: Assert that correct commands were generated assert: that: - - "{{ overridden['commands'] | - symmetric_difference(result['commands']) | length == 0 }}" + - >- + overridden['commands'] + | symmetric_difference(result['commands']) + | length + == 0 - name: Assert that after dicts were correctly generated assert: that: From e3a99b1e147690495cfccc94816ec5ccfc0a2f56 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 12 Feb 2025 17:32:32 +0000 Subject: [PATCH 15/17] Update docs/docsite/rst/dev_guide/developing_collections_creating.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- docs/docsite/rst/dev_guide/developing_collections_creating.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/dev_guide/developing_collections_creating.rst b/docs/docsite/rst/dev_guide/developing_collections_creating.rst index 3108a9e732b..8e3260e3e71 100644 --- a/docs/docsite/rst/dev_guide/developing_collections_creating.rst +++ b/docs/docsite/rst/dev_guide/developing_collections_creating.rst @@ -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:: jinja +.. code-block:: yaml+jinja namespace: {{ namespace }} name: {{ collection_name }} From b5379b27cac0d0ccb4ceaf7abe7a626b2a960020 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 12 Feb 2025 17:33:26 +0000 Subject: [PATCH 16/17] Update docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- .../rst/network/user_guide/network_debug_troubleshooting.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst b/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst index a50c7c0c25e..a47dc9a0557 100644 --- a/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst +++ b/docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst @@ -303,7 +303,7 @@ Indicates that the remote host you are trying to connect to can not be reached For example: -.. code-block:: text +.. code-block:: console 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 From 27054f4b4e8fe820cf413fd0625a1890fa69def5 Mon Sep 17 00:00:00 2001 From: Don Naro Date: Wed, 12 Feb 2025 17:33:43 +0000 Subject: [PATCH 17/17] Update docs/docsite/rst/os_guide/intro_bsd.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- docs/docsite/rst/os_guide/intro_bsd.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/os_guide/intro_bsd.rst b/docs/docsite/rst/os_guide/intro_bsd.rst index c2fa0709878..7657b4ec81d 100644 --- a/docs/docsite/rst/os_guide/intro_bsd.rst +++ b/docs/docsite/rst/os_guide/intro_bsd.rst @@ -157,7 +157,7 @@ The playbook below displays the details -.. code-block:: text +.. code-block:: console shell> ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook -i hosts playbook.yml