Browse code

[DOCS] Backportapalooza 5 (#70999)

* misc typo fixes (#70736)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 8915f262b491055b95c3faf7ce911be95fd4514c)

* How to use rst :ref: for modules in collections (#70567)

(cherry picked from commit 748ba96610f7d1e05c117a084e2de1023fb09d0b)

* Update network_best_practices_2.5.rst (#70962)

Fix a small typo in the playbook tasks sample section

(cherry picked from commit 69e5c6c14a9a5d694b657cfb24c2cc71f3d8fbdb)

* 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 commit 37e9d2278aac698124eb8000cd332c09ba1393d9)

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>

Sandra McCann authored on 2020/08/01 05:51:54
Showing 6 changed files
... ...
@@ -171,13 +171,33 @@ The second example adds custom text for the link.
171 171
 Adding links to modules and plugins
172 172
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
173 173
 
174
-* Module links use the module name followed by ``_module`` for the anchor.
175
-* Plugin links use the plugin name followed by the plugin type. For example, :ref:`enable become plugin <enable_become>`).
174
+Ansible 2.10 and later require the extended Fully Qualified Collection Name (FQCN) as part of the links:
175
+
176
+.. code-block:: text
177
+
178
+  ansible_collections. + FQCN + _module
179
+
180
+For example:
181
+
182
+  .. code-block:: rst
183
+
184
+   :ref:`ansible.builtin.first_found lookup plugin <ansible_collections.ansible.builtin.first_found_lookup>`
185
+
186
+displays as :ref:`ansible.builtin.first_found lookup plugin <ansible_collections.ansible.builtin.first_found_lookup>`.
187
+
188
+Modules require different suffixes from other plugins:
189
+
190
+* Module links use this extended FQCN module name with ``_module`` for the anchor.
191
+* Plugin links use this extended FQCN plugin name with the plugin type (``_connection`` for example).
176 192
 
177 193
 .. code-block:: rst
178 194
 
179
-   :ref:`this module <this_module>``
180
-   :ref:`that connection plugin <that_connection>`
195
+   :ref:`arista.eos.eos_config <ansible_collections.arista.eos.eos_config_module>`
196
+   :ref:`community.kubernetes.kubectl connection plugin <ansible_collections.community.kubernetes.kubectl_connection>`
197
+
198
+.. note::
199
+
200
+	``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.
181 201
 
182 202
 .. _local_toc:
183 203
 
... ...
@@ -201,7 +201,7 @@ Next, create a playbook file called ``facts-demo.yml`` containing the following:
201 201
          eos_facts:
202 202
          when: ansible_network_os == 'eos'
203 203
 
204
-       - name: Gather facts (ops)
204
+       - name: Gather facts (ios)
205 205
          ios_facts:
206 206
          when: ansible_network_os == 'ios'
207 207
 
... ...
@@ -137,7 +137,7 @@ You can also use includes and imports in the :ref:`handlers` section of a playbo
137 137
    - name: restart mysql
138 138
      service:
139 139
        name: mysql
140
-       state:restarted
140
+       state: restarted
141 141
 
142 142
 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.
143 143
 
... ...
@@ -31,7 +31,7 @@
31 31
 # Ex 3: A collection of database servers in the 'dbservers' group:
32 32
 
33 33
 ## [dbservers]
34
-## 
34
+##
35 35
 ## db01.intranet.mydomain.net
36 36
 ## db02.intranet.mydomain.net
37 37
 ## 10.25.1.56
... ...
@@ -69,7 +69,7 @@
69 69
   # maintenance tasks, and other cases where you want to run the playbook
70 70
   # against just a few systems rather than a whole group.
71 71
   # Note that the variable cannot be set in inventory, since we need to know the hosts
72
-  # before we can use invenotry variables. So normally 'extra vars' are used, as you can
72
+  # before we can use inventory variables. So normally 'extra vars' are used, as you can
73 73
   # see below.
74 74
   #
75 75
   # If you set hosts as shown above, then you can specify which hosts to
... ...
@@ -102,7 +102,7 @@
102 102
   remote_user: login_user
103 103
   ###########
104 104
   # Play keyword:  user
105
-  # Default: depends on conneciton plugin, for ssh it is 'current user executing Ansible'
105
+  # Default: depends on connection plugin, for ssh it is 'current user executing Ansible'
106 106
   # Required: no
107 107
   # Description:
108 108
   #   Remote user to login on remote targets and 'normally' execute the tasks as
... ...
@@ -113,7 +113,7 @@
113 113
   # Default: False
114 114
   # Required: no
115 115
   # Description:
116
-  #   If True, always use privilege escalationj to run tasks from this play, just like passing the
116
+  #   If True, always use privilege escalation to run tasks from this play, just like passing the
117 117
   #   --become flag to ansible or ansible-playbook.
118 118
 
119 119
 
... ...
@@ -124,7 +124,7 @@
124 124
   # Required: no
125 125
   # Description:
126 126
   #   When using privilege escalation this is the user you 'become' after login with the remote_user
127
-  #   for examplle you login to the remote as 'login_user' then you 'become' root to execute the tasks
127
+  #   for example you login to the remote as 'login_user' then you 'become' root to execute the tasks
128 128
 
129 129
   become_method: sudo
130 130
   ###########
... ...
@@ -141,8 +141,8 @@
141 141
   # Default: ssh
142 142
   # Required: no
143 143
   # Description:
144
-  #   This sets which connection plugin Asnible will use to try to communicate with the target host.
145
-  #   notable options are paramiko (python implementation of ssh, mostly useful in corener cases in which the ssh cli
144
+  #   This sets which connection plugin Ansible will use to try to communicate with the target host.
145
+  #   notable options are paramiko (python implementation of ssh, mostly useful in corner cases in which the ssh cli
146 146
   #   does not work well with the target. Also 'local' which forces a 'local fork' to execute the task, but normally
147 147
   #   what you really want is `delegate_to: localhost` see examples below in 'Run things locally!' entry.
148 148
   #   use `ansible-doc -t connection -l` to list all the options.
... ...
@@ -898,9 +898,9 @@ class TaskExecutor:
898 898
         else:
899 899
             self._play_context.connection = self._task.connection
900 900
 
901
-        # TODO: play context has logic to update the conneciton for 'smart'
901
+        # TODO: play context has logic to update the connection for 'smart'
902 902
         # (default value, will chose between ssh and paramiko) and 'persistent'
903
-        # (really paramiko), evnentually this should move to task object itself.
903
+        # (really paramiko), eventually this should move to task object itself.
904 904
         connection_name = self._play_context.connection
905 905
 
906 906
         # load connection