Skip to content

[PR #2382/7eb7a3a8 backport][stable-2.18] Update RST files to specify codeblock language attributes #2407

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
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 @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

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:: yaml+jinja

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:: text

include meta/*.yml
include *.txt *.md *.rst COPYING LICENSE
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 @@ -558,69 +558,66 @@ 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:
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

- 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: Overrides all device configuration with provided configurations (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 }}"
- 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 is not changed
- 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
Expand Down
Loading