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

Backport hactoberfest 1 #79065

Merged
merged 16 commits into from Oct 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -132,7 +132,9 @@ After configuring one or more distribution servers, build a collection tarball.

collection_dir#> ansible-galaxy collection build

This command builds a tarball of the collection in the current directory, which you can upload to your selected distribution server::
This command builds a tarball of the collection in the current directory, which you can upload to your selected distribution server:

.. code-block:: shell

my_collection/
├── galaxy.yml
Expand Down
4 changes: 3 additions & 1 deletion docs/docsite/rst/dev_guide/developing_module_utilities.rst
Expand Up @@ -20,7 +20,9 @@ resolving those matching the namespace against a :ref:`search path <ansible_sear
active configuration.

To reduce the maintenance burden in a collection or in local modules, you can extract
duplicated code into one or more module utilities and import them into your modules. For example, if you have your own custom modules that import a ``my_shared_code`` library, you can place that into a ``./module_utils/my_shared_code.py`` file like this::
duplicated code into one or more module utilities and import them into your modules. For example, if you have your own custom modules that import a ``my_shared_code`` library, you can place that into a ``./module_utils/my_shared_code.py`` file like this:

.. code-block:: python

from ansible.module_utils.my_shared_code import MySharedCodeClient

Expand Down
Expand Up @@ -412,7 +412,9 @@ PowerShell utils, these are stored in a folder called ``module_utils`` and the f

The below example is a role structure that contains two PowerShell custom module_utils called
``Ansible.ModuleUtils.ModuleUtil1``, ``Ansible.ModuleUtils.ModuleUtil2``, and a C# util containing the namespace
``Ansible.CustomUtil``::
``Ansible.CustomUtil``:

.. code-block:: console

meta/
main.yml
Expand Down Expand Up @@ -561,7 +563,9 @@ You can test a module with an Ansible playbook. For example:
- Create a playbook in any directory ``touch testmodule.yml``.
- Create an inventory file in the same directory ``touch hosts``.
- Populate the inventory file with the variables required to connect to a Windows host(s).
- Add the following to the new playbook file::
- Add the following to the new playbook file:

.. code-block:: yaml

---
- name: test out windows module
Expand Down
6 changes: 3 additions & 3 deletions docs/docsite/rst/dev_guide/module_lifecycle.rst
Expand Up @@ -69,13 +69,13 @@ Changing a module or plugin name in the Ansible main repository
===============================================================

You can also rename a module and keep a deprecated alias to the old name by using a symlink that starts with _.
This example allows the ``stat`` module to be called with ``fileinfo``, making the following examples equivalent::
This example allows the ``stat`` module to be called with ``fileinfo``, making the following examples equivalent:

EXAMPLES = '''
.. code-block:: yaml

ln -s stat.py _fileinfo.py
ansible -m stat -a "path=/tmp" localhost
ansible -m fileinfo -a "path=/tmp" localhost
'''

Renaming a module or plugin in a collection, or redirecting a module or plugin to another collection
====================================================================================================
Expand Down
4 changes: 3 additions & 1 deletion docs/docsite/rst/dev_guide/style_guide/basic_rules.rst
Expand Up @@ -61,7 +61,9 @@ For menu procedures, bold the menu names, button names, and so on to help the us
3. In the **Open** dialog box, click **Save**.
4. On the toolbar, click the **Open File** icon.

For code or command snippets, use the RST `code-block directive <https://www.sphinx-doc.org/en/1.5/markup/code.html#directive-code-block>`_::
For code or command snippets, use the RST `code-block directive <https://www.sphinx-doc.org/en/1.5/markup/code.html#directive-code-block>`_:

.. code-block:: rst

.. code-block:: bash

Expand Down
4 changes: 3 additions & 1 deletion docs/docsite/rst/dev_guide/style_guide/index.rst
Expand Up @@ -192,7 +192,9 @@ Adding anchors

* Include at least one anchor on every page
* Place the main anchor above the main header
* If the file has a unique title, use that for the main page anchor::
* If the file has a unique title, use that for the main page anchor:

.. code-block:: text

.. _unique_page::

Expand Down
8 changes: 6 additions & 2 deletions docs/docsite/rst/dev_guide/testing.rst
Expand Up @@ -129,7 +129,9 @@ Create a fresh area to work:
git clone https://github.com/ansible/ansible.git ansible-pr-testing
cd ansible-pr-testing

Next, find the pull request you'd like to test and make note of its number. It will look something like this::
Next, find the pull request you'd like to test and make note of its number. It will look something like this:

.. code-block:: text

Use os.path.sep instead of hardcoding / #65381

Expand Down Expand Up @@ -204,7 +206,9 @@ More information: :ref:`testing_integration`

Any potential issues should be added as comments on the pull request (and it's acceptable to comment if the feature works as well), remembering to include the output of ``ansible --version``

Example::
Example:

.. code-block:: text

Works for me! Tested on `Ansible 2.3.0`. I verified this on CentOS 6.5 and also Ubuntu 14.04.

Expand Down
8 changes: 6 additions & 2 deletions docs/docsite/rst/dev_guide/testing/sanity/ignores.rst
Expand Up @@ -71,7 +71,9 @@ This will be the name of the sanity test.
If the sanity test is specific to a version of Python, the name will include a dash (``-``) and the relevant Python version.
If the named test uses error codes then the error code to ignore must be appended to the name of the test, separated by a colon (``:``).

Below are some example ignore entries for an Ansible collection::
Below are some example ignore entries for an Ansible collection:

.. code-block:: text

roles/my_role/files/my_script.sh shellcheck:SC2154 # ignore undefined variable
plugins/modules/my_module.py validate-modules:missing-gplv3-license # ignore license check
Expand All @@ -81,7 +83,9 @@ It is also possible to skip a sanity test for a specific file.
This is done by adding ``!skip`` after the sanity test name in the second column.
When this is done, no error code is included, even if the sanity test uses error codes.

Below are some example skip entries for an Ansible collection::
Below are some example skip entries for an Ansible collection:

.. code-block:: text

plugins/module_utils/my_util.py validate-modules!skip # waiting for bug fix in module validator
plugins/lookup/my_plugin.py compile-2.6!skip # Python 2.6 is not supported on the controller
Expand Down
4 changes: 3 additions & 1 deletion docs/docsite/rst/dev_guide/testing_documentation.rst
Expand Up @@ -31,6 +31,8 @@ To ensure that your module documentation matches your ``argument_spec``:

pip install --user -r test/lib/ansible_test/_data/requirements/sanity.txt

#. run the ``validate-modules`` test::
#. run the ``validate-modules`` test:

.. code-block:: bash

ansible-test sanity --test validate-modules mymodule
3 changes: 2 additions & 1 deletion docs/docsite/rst/dev_guide/testing_pep8.rst
Expand Up @@ -13,8 +13,9 @@ PEP 8
Running Locally
===============

The `PEP 8`_ check can be run locally with::
The `PEP 8`_ check can be run locally with:

.. code-block:: shell

ansible-test sanity --test pep8 [file-or-directory-path-to-check] ...

Expand Down
4 changes: 2 additions & 2 deletions docs/docsite/rst/os_guide/intro_bsd.rst
Expand Up @@ -129,7 +129,7 @@ For example, given the inventory
[test:vars]
ansible_connection=ssh
ansible_user=admin
ansible_become=yes
ansible_become=true
ansible_become_user=root
ansible_become_method=sudo
ansible_interpreter_python_fallback=['/usr/local/bin/python', '/usr/local/bin/python3', '/usr/local/bin/python3.8']
Expand Down Expand Up @@ -213,7 +213,7 @@ You can either ignore it or get rid of it by setting the variable ``ansible_pyth
[test:vars]
ansible_connection=ssh
ansible_user=admin
ansible_become=yes
ansible_become=true
ansible_become_user=root
ansible_become_method=sudo
ansible_interpreter_python_fallback=['/usr/local/bin/python', '/usr/local/bin/python3', '/usr/local/bin/python3.8']
Expand Down
22 changes: 11 additions & 11 deletions docs/docsite/rst/os_guide/windows_dsc.rst
Expand Up @@ -187,7 +187,7 @@ For example:
SourceCredential_username: AdminUser
SourceCredential_password: PasswordForAdminUser

.. Note:: On versions of Ansible older than 2.8, you should set ``no_log: yes``
.. Note:: On versions of Ansible older than 2.8, you should set ``no_log: true``
on the task definition in Ansible to ensure any credentials used are not
stored in any log file or console output.

Expand All @@ -205,10 +205,10 @@ For example, to define a ``[CimInstance]`` value in Ansible:

# [CimInstance]AuthenticationInfo == MSFT_xWebAuthenticationInformation
AuthenticationInfo:
Anonymous: no
Basic: yes
Digest: no
Windows: yes
Anonymous: false
Basic: true
Digest: false
Windows: true

In the above example, the CIM instance is a representation of the class
`MSFT_xWebAuthenticationInformation <https://github.com/dsccommunity/xWebAdministration/blob/master/source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.schema.mof>`_.
Expand Down Expand Up @@ -317,7 +317,7 @@ to access the ``HKEY_CURRENT_USER`` hive of the Ansible user:
ValueData: TestData
PsDscRunAsCredential_username: '{{ ansible_user }}'
PsDscRunAsCredential_password: '{{ ansible_password }}'
no_log: yes
no_log: true

Custom DSC Resources
````````````````````
Expand Down Expand Up @@ -435,7 +435,7 @@ Interact with Azure
ServiceName: ServiceName
StorageAccountName: StorageAccountName
InstanceSize: Medium
Windows: yes
Windows: true
Ensure: Present
Credential_username: '{{ ansible_user }}'
Credential_password: '{{ ansible_password }}'
Expand Down Expand Up @@ -489,10 +489,10 @@ Setup IIS Website
Port: 8080
IPAddress: '*'
AuthenticationInfo:
Anonymous: no
Basic: yes
Digest: no
Windows: yes
Anonymous: false
Basic: true
Digest: false
Windows: true

.. seealso::

Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/os_guide/windows_setup.rst
Expand Up @@ -495,7 +495,7 @@ Ansible, select one of these installation options:
# main.yml
- name: install Win32-OpenSSH service
hosts: windows
gather_facts: no
gather_facts: false
roles:
- role: jborean93.win_openssh
opt_openssh_setup_service: True
Expand Down
8 changes: 4 additions & 4 deletions docs/docsite/rst/os_guide/windows_usage.rst
Expand Up @@ -161,8 +161,8 @@ access a folder on the same host:
name: '{{ item.name }}'
password: '{{ item.password }}'
groups: LocalGroup
update_password: no
password_never_expires: yes
update_password: false
password_never_expires: true
loop:
- name: User1
password: Password1
Expand All @@ -185,7 +185,7 @@ access a folder on the same host:
- name: Remove parent inheritance of Development folder
win_acl_inheritance:
path: C:\Development
reorganize: yes
reorganize: true
state: absent

Domain
Expand All @@ -201,7 +201,7 @@ are created:
name: '{{ item.name }}'
upn: '{{ item.name }}@MY.DOMAIN.COM'
password: '{{ item.password }}'
password_never_expires: no
password_never_expires: false
groups:
- Test User
- Application
Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/porting_guides/porting_guide_2.0.rst
Expand Up @@ -92,7 +92,7 @@ uses key=value escaping which has not changed. The other option is to check for

* porting task includes
* More dynamic. Corner-case formats that were not supposed to work now do not, as expected.
* variables defined in the yaml dict format https://github.com/ansible/ansible/issues/13324
* variables defined in the yaml dict format see `issue 13324 <https://github.com/ansible/ansible/issues/13324>`_
* templating (variables in playbooks and template lookups) has improved with regard to keeping the original instead of turning everything into a string.
If you need the old behavior, quote the value to pass it around as a string.
* Empty variables and variables set to null in yaml are no longer converted to empty strings. They will retain the value of `None`.
Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/porting_guides/porting_guide_3.rst
Expand Up @@ -207,7 +207,7 @@ Breaking Changes
Ansible-base
~~~~~~~~~~~~

- ansible-galaxy login command has been removed (see https://github.com/ansible/ansible/issues/71560)
- ansible-galaxy login command has been removed ( see `issue 71560 <https://github.com/ansible/ansible/issues/71560>`_)

ansible.utils
~~~~~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions docs/docsite/rst/porting_guides/porting_guide_4.rst
Expand Up @@ -194,7 +194,7 @@ Breaking Changes
community.zabbix
~~~~~~~~~~~~~~~~

- all roles now reference other roles and modules via their fully qualified collection names, which makes Ansible 2.10 minimum supported version for roles (See https://github.com/ansible-collections/community.zabbix/pull/477).
- all roles now reference other roles and modules via their fully qualified collection names, which makes Ansible 2.10 minimum supported version for roles (see `issue 477 <https://github.com/ansible-collections/community.zabbix/pull/477>`_).

Deprecated Features
-------------------
Expand Down Expand Up @@ -522,7 +522,7 @@ Known Issues
Ansible-core
~~~~~~~~~~~~

- ansible-test - The ``pylint`` sanity test no longer correctly detects "bad" variable names for non-constants. See https://github.com/PyCQA/pylint/issues/3701 for additional details.
- ansible-test - The ``pylint`` sanity test no longer correctly detects "bad" variable names for non-constants. See `issue 3701 <https://github.com/PyCQA/pylint/issues/3701>`_ for additional details.

dellemc.openmanage
~~~~~~~~~~~~~~~~~~
Expand All @@ -547,7 +547,7 @@ Ansible-core
- NetBSD virtualization facts (specifically ``ansible_virtualization_type``) now returns a more accurate value by checking the value of the ``machdep.hypervisor`` ``sysctl`` key. This change is breaking because in some cases previously, we would erroneously report ``xen`` even when the target is not running on Xen. This prevents that behavior in most cases. (https://github.com/ansible/ansible/issues/69352)
- Replaced the in-tree dependency resolver with an external implementation that pip >= 20.3 uses now by default — ``resolvelib``. (https://github.com/ansible/ansible/issues/71784)
- The ``meta`` module now supports tags for user-defined tasks. Internal ``meta`` tasks continue to always run. (https://github.com/ansible/ansible/issues/64558)
- ansible-galaxy login command has been removed (see https://github.com/ansible/ansible/issues/71560)
- ansible-galaxy login command has been removed (see `issue 71560 <https://github.com/ansible/ansible/issues/71560>`_)

ansible.netcommon
~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions docs/docsite/rst/porting_guides/porting_guide_5.rst
Expand Up @@ -441,7 +441,7 @@ Known Issues
Ansible-core
~~~~~~~~~~~~

- ansible-test - Tab completion anywhere other than the end of the command with the new composite options will provide incorrect results. See https://github.com/kislyuk/argcomplete/issues/351 for additional details.
- ansible-test - Tab completion anywhere other than the end of the command with the new composite options will provide incorrect results. See `issue 351 <https://github.com/kislyuk/argcomplete/issues/351>`_ for additional details.

dellemc.openmanage
~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -572,7 +572,7 @@ community.routeros
community.zabbix
~~~~~~~~~~~~~~~~

- all roles now reference other roles and modules via their fully qualified collection names, which makes Ansible 2.10 minimum supported version for roles (See https://github.com/ansible-collections/community.zabbix/pull/477).
- all roles now reference other roles and modules via their fully qualified collection names, which makes Ansible 2.10 minimum supported version for roles (See `issue 477 <https://github.com/ansible-collections/community.zabbix/pull/477>`_).

kubernetes.core
~~~~~~~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions docs/docsite/rst/scenario_guides/guide_aci.rst
Expand Up @@ -111,14 +111,14 @@ For this very reason, the modules need to run on the local Ansible controller (o

Gathering facts
```````````````
Because we run the modules on the Ansible controller gathering facts will not work. That is why when using these ACI modules it is mandatory to disable facts gathering. You can do this globally in your ``ansible.cfg`` or by adding ``gather_facts: no`` to every play.
Because we run the modules on the Ansible controller gathering facts will not work. That is why when using these ACI modules it is mandatory to disable facts gathering. You can do this globally in your ``ansible.cfg`` or by adding ``gather_facts: false`` to every play.

.. code-block:: yaml
:emphasize-lines: 3

- name: Another play in my playbook
hosts: my-apic-1
gather_facts: no
gather_facts: false
tasks:
- name: Create a tenant
aci_tenant:
Expand Down Expand Up @@ -235,7 +235,7 @@ By default, if an environment variable ``<protocol>_proxy`` is set on the target

HTTP redirects can redirect from HTTP to HTTPS so ensure that the proxy environment for both protocols is correctly configured.

If proxy support is not needed, but the system may have it configured nevertheless, use the parameter ``use_proxy: no`` to avoid accidental system proxy usage.
If proxy support is not needed, but the system may have it configured nevertheless, use the parameter ``use_proxy: false`` to avoid accidental system proxy usage.

.. hint:: Selective proxy support using the ``no_proxy`` environment variable is also supported.

Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/scenario_guides/guide_azure.rst
Expand Up @@ -460,7 +460,7 @@ Here is a simple playbook to exercise the Azure inventory script:
- name: Test the inventory script
hosts: azure
connection: local
gather_facts: no
gather_facts: false
tasks:
- debug:
msg: "{{ inventory_hostname }} has powerstate {{ powerstate }}"
Expand Down
4 changes: 2 additions & 2 deletions docs/docsite/rst/scenario_guides/guide_gce.rst
Expand Up @@ -89,7 +89,7 @@ you can use the following configuration:

- name: Create IP address
hosts: localhost
gather_facts: no
gather_facts: false

vars:
service_account_file: /home/my_account.json
Expand Down Expand Up @@ -168,7 +168,7 @@ rest.

- name: Create an instance
hosts: localhost
gather_facts: no
gather_facts: false
vars:
gcp_project: my-project
gcp_cred_kind: serviceaccount
Expand Down