[DOCS] Backportapalooza 5 (#70999)
* misc typo fixes (#70736) Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit8915f262b4
) * How to use rst :ref: for modules in collections (#70567) (cherry picked from commit748ba96610
) * Update network_best_practices_2.5.rst (#70962) Fix a small typo in the playbook tasks sample section (cherry picked from commit69e5c6c14a
) * Fix a typo in "restart mysql" example (#70950) Fix a typo in "restart mysql" example task. It's missing a space between "state:" and "restarted". (cherry picked from commit37e9d2278a
) Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com> Co-authored-by: PJ Waskiewicz <pjwaskiewicz@gmail.com> Co-authored-by: Emilien Macchi <EmilienM@users.noreply.github.com>
This commit is contained in:
parent
b8eb35ef76
commit
224a0b4809
6 changed files with 35 additions and 15 deletions
|
@ -171,13 +171,33 @@ The second example adds custom text for the link.
|
||||||
Adding links to modules and plugins
|
Adding links to modules and plugins
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
* Module links use the module name followed by ``_module`` for the anchor.
|
Ansible 2.10 and later require the extended Fully Qualified Collection Name (FQCN) as part of the links:
|
||||||
* Plugin links use the plugin name followed by the plugin type. For example, :ref:`enable become plugin <enable_become>`).
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
ansible_collections. + FQCN + _module
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
.. code-block:: rst
|
||||||
|
|
||||||
|
:ref:`ansible.builtin.first_found lookup plugin <ansible_collections.ansible.builtin.first_found_lookup>`
|
||||||
|
|
||||||
|
displays as :ref:`ansible.builtin.first_found lookup plugin <ansible_collections.ansible.builtin.first_found_lookup>`.
|
||||||
|
|
||||||
|
Modules require different suffixes from other plugins:
|
||||||
|
|
||||||
|
* Module links use this extended FQCN module name with ``_module`` for the anchor.
|
||||||
|
* Plugin links use this extended FQCN plugin name with the plugin type (``_connection`` for example).
|
||||||
|
|
||||||
.. code-block:: rst
|
.. code-block:: rst
|
||||||
|
|
||||||
:ref:`this module <this_module>``
|
:ref:`arista.eos.eos_config <ansible_collections.arista.eos.eos_config_module>`
|
||||||
:ref:`that connection plugin <that_connection>`
|
:ref:`community.kubernetes.kubectl connection plugin <ansible_collections.community.kubernetes.kubectl_connection>`
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
``ansible.builtin`` is the FQCN for modules included in ``ansible.base``. Documentation links are the only place you prepend ``ansible_collections`` to the FQCN. This is used by the documentation build scripts to correctly fetch documentation from collections on Ansible Galaxy.
|
||||||
|
|
||||||
.. _local_toc:
|
.. _local_toc:
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ Next, create a playbook file called ``facts-demo.yml`` containing the following:
|
||||||
eos_facts:
|
eos_facts:
|
||||||
when: ansible_network_os == 'eos'
|
when: ansible_network_os == 'eos'
|
||||||
|
|
||||||
- name: Gather facts (ops)
|
- name: Gather facts (ios)
|
||||||
ios_facts:
|
ios_facts:
|
||||||
when: ansible_network_os == 'ios'
|
when: ansible_network_os == 'ios'
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ You can also use includes and imports in the :ref:`handlers` section of a playbo
|
||||||
- name: restart mysql
|
- name: restart mysql
|
||||||
service:
|
service:
|
||||||
name: mysql
|
name: mysql
|
||||||
state:restarted
|
state: restarted
|
||||||
|
|
||||||
You can trigger handlers from either an import or an include, but the procedure is different for each method of re-use. If you include the file, you must notify the include itself, which triggers all the tasks in ``restarts.yml``. If you import the file, you must notify the individual task(s) within ``restarts.yml``. You can mix direct tasks and handlers with included or imported tasks and handlers.
|
You can trigger handlers from either an import or an include, but the procedure is different for each method of re-use. If you include the file, you must notify the include itself, which triggers all the tasks in ``restarts.yml``. If you import the file, you must notify the individual task(s) within ``restarts.yml``. You can mix direct tasks and handlers with included or imported tasks and handlers.
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
# Ex 3: A collection of database servers in the 'dbservers' group:
|
# Ex 3: A collection of database servers in the 'dbservers' group:
|
||||||
|
|
||||||
## [dbservers]
|
## [dbservers]
|
||||||
##
|
##
|
||||||
## db01.intranet.mydomain.net
|
## db01.intranet.mydomain.net
|
||||||
## db02.intranet.mydomain.net
|
## db02.intranet.mydomain.net
|
||||||
## 10.25.1.56
|
## 10.25.1.56
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
# maintenance tasks, and other cases where you want to run the playbook
|
# maintenance tasks, and other cases where you want to run the playbook
|
||||||
# against just a few systems rather than a whole group.
|
# against just a few systems rather than a whole group.
|
||||||
# Note that the variable cannot be set in inventory, since we need to know the hosts
|
# Note that the variable cannot be set in inventory, since we need to know the hosts
|
||||||
# before we can use invenotry variables. So normally 'extra vars' are used, as you can
|
# before we can use inventory variables. So normally 'extra vars' are used, as you can
|
||||||
# see below.
|
# see below.
|
||||||
#
|
#
|
||||||
# If you set hosts as shown above, then you can specify which hosts to
|
# If you set hosts as shown above, then you can specify which hosts to
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
remote_user: login_user
|
remote_user: login_user
|
||||||
###########
|
###########
|
||||||
# Play keyword: user
|
# Play keyword: user
|
||||||
# Default: depends on conneciton plugin, for ssh it is 'current user executing Ansible'
|
# Default: depends on connection plugin, for ssh it is 'current user executing Ansible'
|
||||||
# Required: no
|
# Required: no
|
||||||
# Description:
|
# Description:
|
||||||
# Remote user to login on remote targets and 'normally' execute the tasks as
|
# Remote user to login on remote targets and 'normally' execute the tasks as
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
# Default: False
|
# Default: False
|
||||||
# Required: no
|
# Required: no
|
||||||
# Description:
|
# Description:
|
||||||
# If True, always use privilege escalationj to run tasks from this play, just like passing the
|
# If True, always use privilege escalation to run tasks from this play, just like passing the
|
||||||
# --become flag to ansible or ansible-playbook.
|
# --become flag to ansible or ansible-playbook.
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
# Required: no
|
# Required: no
|
||||||
# Description:
|
# Description:
|
||||||
# When using privilege escalation this is the user you 'become' after login with the remote_user
|
# When using privilege escalation this is the user you 'become' after login with the remote_user
|
||||||
# for examplle you login to the remote as 'login_user' then you 'become' root to execute the tasks
|
# for example you login to the remote as 'login_user' then you 'become' root to execute the tasks
|
||||||
|
|
||||||
become_method: sudo
|
become_method: sudo
|
||||||
###########
|
###########
|
||||||
|
@ -141,8 +141,8 @@
|
||||||
# Default: ssh
|
# Default: ssh
|
||||||
# Required: no
|
# Required: no
|
||||||
# Description:
|
# Description:
|
||||||
# This sets which connection plugin Asnible will use to try to communicate with the target host.
|
# This sets which connection plugin Ansible will use to try to communicate with the target host.
|
||||||
# notable options are paramiko (python implementation of ssh, mostly useful in corener cases in which the ssh cli
|
# notable options are paramiko (python implementation of ssh, mostly useful in corner cases in which the ssh cli
|
||||||
# does not work well with the target. Also 'local' which forces a 'local fork' to execute the task, but normally
|
# does not work well with the target. Also 'local' which forces a 'local fork' to execute the task, but normally
|
||||||
# what you really want is `delegate_to: localhost` see examples below in 'Run things locally!' entry.
|
# what you really want is `delegate_to: localhost` see examples below in 'Run things locally!' entry.
|
||||||
# use `ansible-doc -t connection -l` to list all the options.
|
# use `ansible-doc -t connection -l` to list all the options.
|
||||||
|
|
|
@ -898,9 +898,9 @@ class TaskExecutor:
|
||||||
else:
|
else:
|
||||||
self._play_context.connection = self._task.connection
|
self._play_context.connection = self._task.connection
|
||||||
|
|
||||||
# TODO: play context has logic to update the conneciton for 'smart'
|
# TODO: play context has logic to update the connection for 'smart'
|
||||||
# (default value, will chose between ssh and paramiko) and 'persistent'
|
# (default value, will chose between ssh and paramiko) and 'persistent'
|
||||||
# (really paramiko), evnentually this should move to task object itself.
|
# (really paramiko), eventually this should move to task object itself.
|
||||||
connection_name = self._play_context.connection
|
connection_name = self._play_context.connection
|
||||||
|
|
||||||
# load connection
|
# load connection
|
||||||
|
|
Loading…
Reference in a new issue