Giter VIP home page Giter VIP logo

ansible-documentation's Introduction

ansible-documentation

This repository holds the ReStructuredText (RST) source, and other files, for user documentation related to the Ansible package and Ansible Core.

Documentation for modules and plugins that are officially supported by the Ansible Core engineering team is available in the ansible/ansible repository.

Verifying your pull request

We welcome all contributions to Ansible community documentation. If you plan to submit a pull request with changes, you should verify your PR to ensure it conforms with style guidelines and can build successfully.

Setting up nox

This project includes a nox configuration to automate tests, checks, and other functions. You can use these automated tests to help you verify changes before you submit a PR. You can manually set up your environment if you prefer, but nox is more straightforward and create an isolated environment for you.

  • Install nox using python3 -m pip install nox or your distribution's package manager.

  • Execute nox from the repository root with no arguments to run all docs checkers, Python code checkers, and a minimal HTML docs build.

  • Alternatively, you can run only certain tasks as outlined in the following sections. Run nox --list to view available sessions.

Building docs

The different Makefile targets used to build the documentation are outlined in Building the documentation locally. The nox configuration has a make session that creates a build environment and uses the Makefile to generate HTML.

  • Clone required parts of the ansible/ansible repository.

    nox -s clone-core

    See Periodically cloning Ansible core for more information.

  • Build minimal Ansible Core docs.

    nox -s make
  • Run a specific Makefile target:

    nox -s make -- clean htmlsingle rst=community/documentation_contributions.rst

Running automated tests

The nox configuration also contains session to run automated docs checkers.

  • Ensure there are no syntax errors in the reStructuredText source files.

    nox -s "checkers(rstcheck)"

    See Running the final tests for more information.

  • Verify the docs build.

    nox -s "checkers(docs-build)"

    This session cleans the generated docs after it runs. If you want to view the generated HTML in your browser, you should build the documentation locally. See Building the documentation locally for more information.

  • Lint, type check, and format Python scripts in this repository.

    nox -s lint

Checking spelling

Use codespell to check for common spelling mistakes in the documentation source.

  • Check spelling.

    nox -s spelling
  • Correct any detected spelling errors.

    nox -s spelling -- -w
  • Select an option when codespell suggests more than one word as a correction.

    nox -s spelling -- -w -i 3

Dependency files

nox sessions use dependencies from requirements files in the tests/ directory. Each session has a tests/{name}.in file with direct dependencies and a lock file in tests/{name}.txt that pins exact versions for both direct and transitive dependencies. The lock files contain tested dependencies that are automatically updated on a weekly basis.

If you'd like to use untested dependencies, set PINNED=false as in the following example:

PINNED=false nox -s "checkers(docs-build)"

For more details about using unpinned and tested dependencies for doc builds, see Setting up your environment to build documentation locally.

Updating dependencies

Use the following nox session to update the dependency lock files in tests/.

nox -s pip-compile

To synchronize dependency lock files with base requirements files without changing transitive dependencies, use the --no-upgrade flag:

nox -s pip-compile -- --no-upgrade

This session requires Python 3.10.

If you do not have Python 3.10 installed, you can use root-less podman with a Python 3.10 image as follows:

podman run --rm --tty --volume "$(pwd):/mnt:z" --workdir /mnt docker.io/library/python:3.10 bash -c 'pip install nox ; nox -s pip-compile'

Creating release tags

When a tag is created in the ansible/ansible repository for a release or release candidate, a corresponding tag should be created in this ansible-documentation repository.

First, ensure that you have the ansible/ansible and ansible/ansible-documentation repositories checked out. The tool assumes that both checkouts have the same parent directory. You can set different paths to your checkouts with the --docs and --core options if you have them set up another way.

Next, run the tag nox session.

This will determine any missing ansible-core tags and create them in ansible-documentation if needed, exiting normally otherwise:

# The tagger scripts assumes "origin" as the upstream remote.
nox -s tag

# If you use a different upstream remote, specify the name.
nox -s tag -- --remote <name> tag 

# If your core repo is not in the same filesystem location, specify the path.
nox -s tag -- --core <path> tag

See nox -s tag -- --help for extended options.

ansible-documentation's People

Contributors

abadger avatar akasurde avatar alikins avatar andersson007 avatar bcoca avatar caphrim007 avatar dagwieers avatar dhozac avatar felixfontein avatar ganeshrn avatar gundalow avatar jborean93 avatar jctanner avatar jimi-c avatar mattclay avatar migumun avatar mkrizek avatar mpdehaan avatar mscherer avatar nitzmahone avatar privateip avatar qalthos avatar rcarrillocruz avatar resmo avatar s-hertel avatar samccann avatar samdoran avatar sivel avatar trishnaguha avatar willthames avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-documentation's Issues

Pdf/Epub/Offline documentation is missing

it is still a big problem not having the possibility to download an offline version of the manual. you are in a datacenter, no mobile internet available, all lan sockets are mac locked and require a certificate. you have to quickly lookup something for ansible. no way. this is very bad DX.

We do not produce documentation in pdf format at this time mainly because ansible is changing and updating all the time and we don't want to be passing obsolete documentation around to users.

this argument, which i found in an old issue, is simply wrong as exactly this has happend/is happening: people build a pdf version of the manual one time and put it out in the wild. those old builds ARE outdated. so denying us an official pdf which is build and updated on deploy of the doc webpage only leads to outdated pdfs.

please reconsider the wont-fix. don't lock the issues down, shutting down feedback does not solve the problem.

ansible/ansible#9945
ansible/ansible#4265

Add documentation for defaults/main and vars/main may being a directory

Summary

With the ansible/ansible#36357 you have created the possibility that var/main and defaults/main can be one directory. But this useful feature is not documented anywhere. Please extend the documentation accordingly.

Issue Type

Documentation Report

Component Name

all e.g. playbook_guide/playbooks_reuse_roles.rst

Ansible Version

n/a

Configuration

n/a

OS / Environment

n/a

Additional Information

n/a

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Move collections decisions into official docs

SUMMARY

We've been using https://github.com/ansible-collections/overview to host the rapidly updated decisions etc for developing collections. Since 2.10.0 is official - we need to go through that document:

Any differences between 2.10.x development/checklist and 2.11.x should be covered in this one document as collection owners will want to be aware of differences as they have collections in both versions, for example

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

docs.ansible.com

ANSIBLE VERSION

CONFIGURATION

OS / ENVIRONMENT
ADDITIONAL INFORMATION

Add ansible-test sanity reports

Summary

I'm currently writing a custom ansible modules in a collection.

To do so, I'm using the ansible-test module.

Now, I've arrived at a point where I'm running sanity tests. During these sanity tests, I have some issues. I'd like these issues to be exportable in a format that could be imported in some other tools (in my context sonarqube for example).

I open this request because I didn't see any feature like that in the documentation or in the CLI help.

Issue Type

Documentation Report

Component Name

ansible-test

Additional Information

I think that we'd want some CLI options like :

ansible-test sanity --reports sonarqube ## For sonarqube reports
ansible-test sanity --reports json ## For JSON reports
ansible-test sanity --reports console ## Just for console reports. Would be the default value for backward compatibilty. 

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Antsibull warnings related to changelogs and README.rst

Docs build contains the following warns:

WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: /tmp/build-env-ixwpz4p8/lib64/python3.11/site-packages/setuptools/config/expand.py:132: SetuptoolsWarning: File '/home/dnaro/git/ansible-documentation/README.rst' cannot be found
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: return '\n'.join(
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: no files found matching 'changelogs/CHANGELOG*.rst'
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: no files found matching 'changelogs/changelog.yaml'
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: /tmp/build-env-ixwpz4p8/lib64/python3.11/site-packages/setuptools/config/expand.py:132: SetuptoolsWarning: File '/tmp/.tmp-ansible-pep517-sayg8faj/src/README.rst' cannot be found
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: return '\n'.join(
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: no files found matching 'changelogs/CHANGELOG*.rst'
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: no files found matching 'changelogs/changelog.yaml'
WARNING:antsibull:mod=antsibull_core.subprocess_util|stderr: warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md

These warns occur because the changelogs folder and the README.rst file are not present after running bin/clone-core.py to clone relevant bits from Ansible core.

A new link to allow users report on docs

Hello,

  1. Currently we have the Edit on GitHub button as a way to fix docs. We don't have it everywhere as in get_started_inventory, for example. How about having it everywhere?

  2. What if a person doesn't want to edit but wants to report or discuss doc improvement? I think it'd be also good to have an additional button/link near Edit on GitHub like Report doc issue or Discuss this page, or something. There's a lot of space. It could look like Edit on GitHub | Discuss this page

UPDATE: we discussed this issue in the docs matrix channel and think now that it's worth using the forum.

Ideas?

Review process for technical stewardship

To avoid any degradation of quality within the Ansible community documentation, it is imperative to have a defined and agreed upon review process for technical accuracy and completeness.

Technical reviewer process

  1. Identify PR as "technical review needed" during triage and add the label.
  2. Require approval from at least one member of the core team or a community docs maintainer group before merge.

Tasks

Reducing contributor overhead

Long-time contributors to the Ansible documentation have raised valid concerns about the increased overhead that a separate docs repo creates. To address this, the community team will take specific actions in the ansible/ansible repository.

  • Direct contributors to ansible/ansible-documentation, offer to help, answer questions, and do the heavy lifting where needed. Reinforce messaging that the new documentation repo is an initiative to strengthen the Ansible community.
  • Capture details in ansible/ansible-documentation issues when there is a relevant PR or issue in ansible/ansible. First check if a docs issue exists, then suggest that the contributor create one and/or volunteer to create on their behalf.
  • In some cases, the community team can handle a PR on behalf of a contributor or convert relevant details captured in doc issues into user documentation.

Labelling and tracking

Triage PRs and issues in the ansible/ansible repository to identify changes that impact or require user documentation and apply labels.

The community team will use these labels to highlight contributor opportunities for docs, discuss active work items in the DaWGs meeting, and partner with the Ansible core engineering team on the docs.

Updating doc build requirements

This issue follows up on #30 and relates to #54

The goal is to provide a script or playbook that can update constraints in tests/requirements.txt in a way that is easy to reproduce. For more detail see the discussion here: #60 (comment)

Update environment variables page to also include plugins

Summary

The current env vars page does not include plugins... We should update this autogenerated page to bring that detail in

https://docs.ansible.com/ansible/latest/reference_appendices/config.html#environment-variables

Issue Type

Documentation Report

Component Name

none

Ansible Version

$ ansible --version
none

Configuration

$ ansible-config dump --only-changed
none

OS / Environment

none

Additional Information

none

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Sidebar doesn't have links updated to versions other than latest when selecting another version

Summary

Older Ansible versions doc is a pain to go through with the sidebar not updated at all to match older versions documentation, the result is that many links in the sidebar go back to latest version, and if the user try to again select an older version, then it'll pretty often end up on a non-existing page because doc's structure changed in-between.
For example it can lead to https://docs.ansible.com/ansible/2.9/collections/all_plugins.html

Issue Type

Documentation Report

Component Name

sidebar

Ansible Version

Older versions

Configuration

Unrelated for doc

OS / Environment

Unrelated for doc

Additional Information

This would make the doc much more usable for older versions of Ansible than the latest one.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Update collection requirements links

Summary

ansible/ansible#80234 moved the collection requirements docs from a separate repo. Since this new file is only for the Ansible package, not for core, we need to do the following:

Issue Type

Documentation Report

Component Name

docs/docsite/rst/community/communication.rst

Ansible Version

$ ansible --version
2.14

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
none

OS / Environment

none

Additional Information

none

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

timeout and retry do not work together

Summary

Using the timeout and retry keywords together do not work as expected.

A typical use case for this would be downloading large files over a flaky connection. We want to retry failed downloads but we don't want hung downloads to hang the whole playbook, so we want to be able to time them out.

Issue Type

Bug Report

Component Name

core

Ansible Version

$ ansible --version
ansible [core 2.13.4]
  config file = /home/eric/work/TradeSystem/target/ansible.cfg
  configured module search path = ['/home/eric/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/eric/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/eric/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/eric/.local/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto
LOCALHOST_WARNING(/etc/ansible/ansible.cfg) = False

OS / Environment

Ubuntu 20.04

Steps to Reproduce

The first test is to see if a timeout of 15 seconds will fail a retry loop of 3 times 10 seconds

- hosts: localhost
  connection: local
  gather_facts: no
  tasks:
    - shell:
        cmd: sleep 10; false
      register: res
      timeout: 15
      retries: 2
      until: res is not failed

The second test is to see if a timeout of 5 seconds would fail the individual tries

- hosts: localhost
  connection: local
  gather_facts: no
  tasks:
    - shell:
        cmd: sleep 10; false
      register: res
      timeout: 5
      retries: 2
      until: res is not failed

Expected Results

I would expect either

  • The timeout would fail the whole task if, during the retry loop, the timeout was exceeded

Or

  • The timeout would fail an individual "try" of the retry loop

Actual Results

In the first test I would expect that the timeout would fail the task at 15 seconds, but the retry loop continues for 30 seconds:

PLAY [localhost] *************************************************************************************************************************************************

TASK [shell] *****************************************************************************************************************************************************
FAILED - RETRYING: [localhost]: shell (2 retries left).
FAILED - RETRYING: [localhost]: shell (1 retries left).
fatal: [localhost]: FAILED! => {"attempts": 2, "changed": true, "cmd": "sleep 10; false", "delta": "0:00:10.011513", "end": "2022-09-18 12:50:19.531123", "msg": "non-zero return code", "rc": 1, "start": "2022-09-18 12:50:09.519610", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

PLAY RECAP *******************************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

If the timeout doesn't work to fail the overall task while it is retrying then I would expect that it would fail an individual try. Instead it fails the whole task.

PLAY [localhost] *************************************************************************************************************************************************

TASK [shell] *****************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "The shell action failed to execute in the expected time frame (5) and was terminated"}

PLAY RECAP *******************************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

The workaround for this is, instead of using retries, we have to run the task multiple times, like:

  tasks:
    - include_tasks: download_installer.yml

    - include_tasks: download_installer.yml
      when: win_get_result is failed

    - include_tasks: download_installer.yml
      when: win_get_result is failed

    - fail:
        msg: "Download failed after 3 attempts"
      when: win_get_result is failed

This is ok for 2 retries but any more would get ridiculous :) Also when there are hundreds of hosts it translates in to a ton of skipping which can be distracting.

There's no way to do "loop until condition" in Ansible without using retries unfortunately.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Add documentation for how to use or add attributes

Summary

How to use them, how to add them to existing or new plugins etc.

Issue Type

Documentation Report

Component Name

docs/docsite/rst/dev_guide/index.rst

Ansible Version

$ ansible --version
2.15

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
none

OS / Environment

none

Additional Information

none

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Freeze requirements in tests/requirements.txt

This file is used for all non-devel builds and we want to ensure the builds remain stable.
Review the current requirements installed by this file and pin to those versions after testing/verifying the build

build documentation for python API in lib/

SUMMARY

Please let sphinx build documentation for the python API.


Apparently docs.ansible.com and everything in the ansible-doc (RPM) package is rendered from the docs/ directory in this repo. This includes e.g. in dev_guide/developing_plugins some code like

from ansible.errors import AnsibleError, AnsibleParserError
from ansible.plugins.lookup import LookupBase
from ansible.utils.display import Display

display = Display()

But if one wants to discover the API of these classes, it's necessary to dig into the source at lib/ansible/ (or use an IDE).

Probably a first step would be to add the lib/ansible/ directory to SOURCEDIR = in docs/docsite/Makefile.sphinx, and reference the output in the dev_guide.

Maybe sphinx even supports linking these API classes from the code samples in the rst files -- as a later step.

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

developing_plugins.rst

developing_inventory.rst

ANSIBLE VERSION
ansible 2.9.14
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.8.6 (default, Sep 25 2020, 00:00:00) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)]
CONFIGURATION

OS / ENVIRONMENT

any

ADDITIONAL INFORMATION

Document AnsibleModule argument_spec

SUMMARY

Every Ansible module takes in an argument_spec to the AnsibleModule.

I can't find documentation anywhere about what is supposed to go here.

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

AnsibleModule

ANSIBLE VERSION

N/A

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

ADDITIONAL INFORMATION

This is the context.
I want to modify a module to allow a certain argument to be either a dictionary or a list.
It should be as easy as modifying this line.

payload=dict(default={}, type='dict')

What do I change dict to?

This documentation page for AnsibleModule does not tell me what the options are. Neither does this page.

I looked through the code itself, and found this object:

DEFAULT_TYPE_VALIDATORS = {
    'str': check_type_str,
    'list': check_type_list,
    'dict': check_type_dict,
    'bool': check_type_bool,
    'int': check_type_int,
    'float': check_type_float,
    'path': check_type_path,
    'raw': check_type_raw,
    'jsonarg': check_type_jsonarg,
    'json': check_type_jsonarg,
    'bytes': check_type_bytes,
    'bits': check_type_bits,
}

What are these things? e.g. I'm not sure whether to use json or raw. It would be great if there was some documentation telling me what to use.

e.g. if I use raw, will I only ever get a jsonable value? (list, dict, int, float etc) i.e. I can assume there's nothing funny like a decimal.Decimal or a dt.datetime?

This comment suggests that I can pass in a function instead of a string. It would be great if that is documented too.

I can do a PR to update the docs. I just need someone to confirm:

  • Which pages should I update? I believe the two pages above are the right ones.
  • What's the difference between json and raw? Is json just a json.dumps() of raw?
  • Can raw return anything exotic?
  • If I pass in a callable, what argument is used to invoke the callable? e.g. is the yaml converted to a dict/list and that is used as the argument?

Module/plugin lifecycle needs to be adjusted to reality (and properly defined in the current reality)

Summary

As multiple reviewers mentioned in ansible/ansible#74413, the four stages of an Ansible module / plugin mentioned in docs/docsite/rst/dev_guide/module_lifecycle.rst are no longer correct, since ANSIBLE_METADATA no longer exists. (#73707 is a possible replacement.)

To be able to replace that section, it first needs to be decided what the lifecycle should be (#73707 is used, the lifecycle is simplified, ...), and then the documentation needs to be updated accordingly.

Issue Type

Documentation Report

Component Name

docs/docsite/rst/dev_guide/module_lifecycle.rst

Ansible Version

devel

Configuration

n/a

OS / Environment

n/a

Additional Information

n/a

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Add "Introduction to Ansible" content to getting started

Copied from ansible/ansible#78459 in ansible/ansible.

Summary

Some comments on the new getting started section here: https://www.reddit.com/r/sysadmin/comments/w1uwm5/my_org_will_soon_be_using_ansible_because_of_me/ign34mu/?utm_source=share&utm_medium=ios_app&utm_name=iossmf&context=3

"The first link provided https://docs.ansible.com/ansible/latest/getting_started/index.html already assumes I know about ansible and what it's capable of. This is exactly why I posted in the first place. This is a horrible way to introduce someone to your software.

Give me an overview of what Ansible is, what it does, and why I should choose it over any other solution."

To address this we should add more high-level introduction to Ansible content before the getting started section.

Documentation Checklist: -ansible-core 2.15 release

Summary

Documentation checklist to prepare for and deliver the ansible-core 2.15 release. See follow-on comment for the full checklist.

Issue Type

Documentation Report

Component Name

docs/docsite/sphinx_conf/ansible_conf.py

Ansible Version

$ ansible --version
2.15

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
none

OS / Environment

none

Additional Information

none

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Set labelling strategy

In ansible/ansible, we had some built-in labels and a bot that did helpful things.

Let's use this issue to discuss what we want here in this docs repo that might be similar.
What comes to mind:
needs_info - I added this label but in ansible/ansible, anything with needs_info would auto-send a reminder I think maybe once a month for two or three months? and if there was no response, would auto-close.
triage - new issues automatically got labeled triage so we can see it, determine it's scope, add it to the project board etc.

There's likely more but those two come immediately to mind this morning :-)

pip install instructions don't work on Debian 12.0 and Ubuntu 23.04

The current installation instructions don't work on Debian 12.0 or Ubuntu 23.04.

Steps to reproduce

Let's follow the official instructions to install Ansible: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html

Actual behaviour:

$ python3 -m pip install --user ansible
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Let's try pipx like the message suggests:

$ pipx install ansible
  installed package ansible 8.1.0, installed using Python 3.11.2
  These apps are now globally available
    - ansible-community
done! ✨ 🌟 ✨
$ ansible-playbook
bash: /home/user/.local/bin/ansible-playbook: No such file or directory

So only a small, not-very-helpful subset of Ansible is installed.

What you really want is this:

$ pipx install --include-deps ansible
   installed package ansible 8.1.0, installed using Python 3.11.2
  These apps are now globally available
    - ansible
    - ansible-community
    - ansible-config
    - ansible-connection
    - ansible-console
    - ansible-doc
    - ansible-galaxy
    - ansible-inventory
    - ansible-playbook
    - ansible-pull
    - ansible-test
    - ansible-vault
done! ✨ 🌟 ✨

Expected behaviour

The Ansible docs should tell me how to install Ansible successfully.

There are various solutions discussed in the pipx repo.
In any case, the install instructions in the Ansible docs should be updated to a new recommended installation method. One that I can get to work without having to google.

Info

  • Ubuntu 23.04
  • Debian 12.0
  • Python 3.11.2 (both)

Rewrite Getting Started to focus on Ansible projects

Copied from #80941 in ansible/ansible.

This issue affects the Getting Started with Ansible content available at: https://docs.ansible.com/ansible/latest/getting_started/index.html

Problem overview

The Getting Started content recommends editing /etc/ansible/hosts and takes a more Linux system approach. At the end of the Getting Started, users will have created files that scattered in different directories instead of a self-contained project that you can easily commit to a GitHub repository and treat as ephemeral.
Desired outcome

Rewrite the Getting Started content to create a new folder in the home directory, add the inventory to the directory, put playbooks adjacent to the inventory, create a collections directory within it, then add collections to a requirements file. The end result will be a single directory structure that works well with AWX and Navigator. For example, with Navigator you can just mount the project inside an ee.

The Getting Started rewrite should also include VSCode and Lint. That could be done as part of this issue or as a follow up.

Create autoresponder for docs PRs

ansibot posted a comment for every docs PR opened. Would be great if we could incorporate that here as well:

Thanks for your Ansible docs contribution! We talk about Ansible documentation on matrix at #docs:ansible.im and on libera IRC at #ansible-docs if you ever want to join us and chat about the docs! We meet there on Tuesdays (see the Ansible calendar) and welcome additions to our ansible/community#678 - scroll down to find the upcoming agenda and add a comment to put something new on that agenda.

Reducing contributor overhead

The Ansible community team acknowledges that sourcing user documentation in a separate repository to the code base increases overhead. In many cases contributors need to send two PRs, one for code and another for docs.

The community team will work to mitigate the overhead to docs contributors by actively monitoring PRs and issues in the ansible/ansible repository. The community team will:

  • Continually review PRs and issues in the ansible/ansible repository to identify changes that impact or require user documentation.
  • Direct contributors to the ansible/ansible-documentation repository, address concerns, and answer questions about the separate repo.
  • Ask contributors about user documentation and capture relevant details in an ansible/ansible-documentation issue before an active PR is merged or work begins on an issue in ansible/ansible.
  • In some cases, the community team can handle a PR on behalf of a contributor or convert relevant details captured in doc issues into user documentation.

Proposal

To provide an easy and unobtrusive way for the community team to query and track PRs and issues that are relevant to user documentation, create the following labels in ansible/ansible:

  • "user documentation" indicates user documentation is required for a contributor PR or issue.
  • "core docs" indicates a PR or issue from a member of the Ansible core engineering team adds a new feature or changes functionality.

The community team will also use these labels to highlight contributor opportunities for docs, discuss active work items in the DaWGs meeting, and work with the Ansible core engineering team to update and maintain user docs.

Tasks

Unit testing documentation is out of date

Summary

Speaking to @mattclay, using the pytest framework for unit tests is preferred over unittest framework.

Both https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/dev_guide/testing_units.rst and https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/dev_guide/testing_units_modules.rst have a mix of both frameworks in the examples, the unittest examples should probably be migrated over to using pytest.

Issue Type

Documentation Report

Component Name

docs/docsite/rst/dev_guide/testing_units.rst

Ansible Version

n/a

Configuration

n/a

OS / Environment

n/a

Additional Information

If we want folks to prefer pytest over unittest, we need to update the docs to reflect this.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

TRANSFORM_INVALID_GROUP_CHARS doesn't document valid group patterns

SUMMARY

With the addition of the TRANSFORM_INVALID_GROUP_CHARS. Other than reading the source, it was not clear which characters must be avoided going forward, only that the warning (with -vvvv) points out which characters you currently use that are invalid.

Please clarify that you are pushing the names to be valid python vars. This is missing from the documentation for the cfg option, warning and online documentation

(ansible/ansible@d241794#diff-b77962b6b54a830ec373de0602918318R122)

There appears to be no mention of this on https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html either.

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

group

ANSIBLE VERSION
ansible 2.8.0
  config file = /home/awoodward/ansible-skynet/ansible.cfg
  configured module search path = [u'/home/awoodward/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.5 (default, Apr  9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
CONFIGURATION

n/a

OS / ENVIRONMENT

n/a

ADDITIONAL INFORMATION

n/a

strings separated by comma become a list with jinja2_native enabled

Summary

If two strings that are separated by a comma have templating applied to them then with jinja2_native=true the result incorrectly becomes a list consisting of 2 string elements, one for each of the strings.

With jinja2 native disabled, with the strings separated to different lines using a YAML block scalar, or with no templating applied to the strings then the result stays a string as is expected.

Issue Type

Documentation Report

Component Name

core

Ansible Version

$ ansible --version
ansible [core 2.15.0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ansible/lib64/python3.9/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ansible/bin/ansible
  python version = 3.9.14 (main, Jan  9 2023, 00:00:00) [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)] (/home/ansible/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
CACHE_PLUGIN(/etc/ansible/ansible.cfg) = community.general.yaml
CACHE_PLUGIN_CONNECTION(/etc/ansible/ansible.cfg) = /tmp/.ansible-fact.$USER
CACHE_PLUGIN_TIMEOUT(/etc/ansible/ansible.cfg) = 5184000
CALLBACKS_ENABLED(/etc/ansible/ansible.cfg) = ['ansible.posix.timer']
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 10
DEFAULT_JINJA2_NATIVE(/etc/ansible/ansible.cfg) = True
DEFAULT_LOCAL_TMP(/etc/ansible/ansible.cfg) = /tmp/.ansible.user/ansible-local-268537xzh471wi
DEFAULT_LOG_PATH(/etc/ansible/ansible.cfg) = /var/log/ansible.log
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = community.general.yaml
DEFAULT_STRATEGY(/etc/ansible/ansible.cfg) = ansible.builtin.free
DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 50
DEFAULT_VAULT_IDENTITY_LIST(env: ANSIBLE_VAULT_IDENTITY_LIST) = ['...', '...', '...']
DEFAULT_VAULT_ID_MATCH(/etc/ansible/ansible.cfg) = True
INJECT_FACTS_AS_VARS(/etc/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto_silent
RETRY_FILES_SAVE_PATH(/etc/ansible/ansible.cfg) = /tmp/.ansible-retry.user

CACHE:
=====

jsonfile:
________
_timeout(/etc/ansible/ansible.cfg) = 5184000
_uri(/etc/ansible/ansible.cfg) = /tmp/.ansible-fact.user

CONNECTION:
==========

paramiko_ssh:
____________
ssh_args(/etc/ansible/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=300s -o ServerAliveInterval=10
timeout(/etc/ansible/ansible.cfg) = 50

ssh:
___
control_path_dir(/etc/ansible/ansible.cfg) = /tmp/.ansible-ssh.$USER
pipelining(/etc/ansible/ansible.cfg) = True
ssh_args(/etc/ansible/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=300s -o ServerAliveInterval=10
timeout(/etc/ansible/ansible.cfg) = 50
use_tty(/etc/ansible/ansible.cfg) = False

SHELL:
=====

sh:
__
remote_tmp(/etc/ansible/ansible.cfg) = /tmp/ansible.$USER

OS / Environment

EL9, pip install

Steps to Reproduce

---
- name: Test case for a string changing to a list with jinja2 native
  hosts:
    - all
  gather_facts: false
  tasks:
    - name: Demonstrate a string becoming a list
      ansible.builtin.debug:
        msg: |
          'string{{ "1" }}', 'string{{ "2" }}'

Note that it does not matter if the msg is a block scalar or not, the issue still happens. A block scalar is just used to easily demonstrate this workaround that makes it work as expected (output stays a string):

---
- name: Test case for a string changing to a list with jinja2 native (workaround)
  hosts:
    - all
  gather_facts: false
  tasks:
    - name: Workaround with separating the strings to 2 lines makes the output work right and stay a string
      ansible.builtin.debug:
        msg: |
          'string{{ "1" }}',
          'string{{ "2" }}'

Expected Results

The output should stay a string such as:

'string1', 'string2'

Actual Results

ok: [host] =>
  msg:
  - string1
  - string2

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Capture details on combining variables

Summary

A community user mentioned via social media an excellent and helpful blog post from Jakub Pieńkowski: https://jakski.github.io/pages/combining-variables-in-ansible.html

The outcome for this issue is to work with Jakski and incorporate details from the post into the Ansible community source content.

Issue Type

Documentation Report

Component Name

docs/docsite/rst/dev_guide

Ansible Version

$ ansible --version
ansible [core 2.14.0]

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all

OS / Environment

Fedora 36

Additional Information

When the changes are merged the details on creating merged variables is available in the Ansible community docs.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Create a 'getting started' guide for developers

SUMMARY

This came up as a possible ansibleFest topic, so thought it would be worth having a specific getting started guide for developers so they can quickly learn how to:

  • get ansible from source and set up your basic development environment
  • Open a PR for a bugfix or new option to a module
  • how to find the module source code in the collections world
  • PR requirements like changelogs, unit tests, etc
  • keeping your PR current for newer versions of the upstream repo

(git remote add ; git fetch ; git merge --ff-only to devel ; git checkout feature-branch ; git rebase devel )

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

docs.ansible.com

ANSIBLE VERSION

CONFIGURATION

OS / ENVIRONMENT
ADDITIONAL INFORMATION

Docs: answer playbook questions about versioning

SUMMARY

As a playbook author or maintainer, I need more information about how versions of Ansible (on PyPI), ansible-base, and collections work together.

Related to ansible/ansible#69334.

  • How do I know which version of ansible-base I have installed?
  • How do I know if an upgrade to a Collection may including breaking changes?
  • How do I install a newer Collection version and override the version included in Ansible?
  • How can I tell if a collection will work with the version of ansible-base (or Ansible) I’ve standardized on?
ISSUE TYPE
  • Documentation Report
COMPONENT NAME

docs/docsite/rst/user_guide/index.rst

ANSIBLE VERSION

2.10

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

More updates for Matrix as a chat option

Summary

ansible/ansible#75406 took the first step toward documenting Matrix as an option for Ansible community chat. Here's the remaining work to be done:

  • update references to specific channels (#ansible, #ansible-devel, #ansible-docs, #ansible-windows) to offer direct links to the correct Matrix room as well as a reference or link for the IRC channel
  • in the SeeAlso sections that discuss chat, add lines with links to the "start here / stop by and say hi" Matrix room
  • update the existing SeeAlso references to make it clear that the communicating page has more information about Matrix and IRC in general
  • consider moving the list of Working Groups and their chat venues from https://github.com/ansible/community/blob/master/meetings/README.md into the communicating page; alternatively, update the README.md page to reflect the Matrix rooms as well as the IRC channels
  • add a section or page for "Chat etiquette" somewhere that gives tips on making the Matrix/IRC bridge work well for users on both protocols
  • adapt some content from https://matrix-help.envs.net/

Issue Type

Documentation Report

Component Name

docs/docsite/rst/community/

Ansible Version

N/A

Configuration

N/A

OS / Environment

N/A

Additional Information

None.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Evaluate and improve the hacking folder

The hacking/ folder is be temporarily duplicated with the ansible/ansible repository. This folder is included in its entirety to make sure the ansible-documentation repository has a functional copy and the docs build does not break.

The purpose of this task is to evaluate the contents and relocate, restructure, and simplify things in parallel with the efforts that the core team will take in the ansible/ansible repository.

add copy option to the code snippets in documentation

Summary

I was reading the ansible installation guide to make it better its good to add the copy option to the code snippets

Issue Type

Documentation Report

Component Name

documentation update

Ansible Version

$ ansible --version

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all

OS / Environment

windows

Additional Information

https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Docs survey feedback: add a "cheatsheet" for the main commands

Summary

Add a page with examples for ansible-playbook and other commonly-used CLI commands, similar to an O'Reilly cookbook. Include lots of options/flags.

  • ansible-playbook
  • ansible-galaxy
  • ansible
  • ansible-inventory
  • ansible-doc
  • ansible-config
  • ansible-vault
  • ansible-console
  • ansible-pull
  • ansible-test

Issue Type

Documentation Report

Component Name

docs/docsite/cli/

Ansible Version

$ ansible --version
N/A

Configuration

$ ansible-config dump --only-changed
N/A

OS / Environment

N/A

Additional Information

None needed.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Collection Dev / Test docs should note filesystem path requirements

Summary

We get a lot of questions from contributors about how to use ansible-test on their local machine to run sanity/unit/integration tests because they don't have the repo checked out to a path like ~/collections/ansible_collections/namespace/collection. There doesn't appear to be any mention of this requirement in the https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html or https://docs.ansible.com/ansible/devel/dev_guide/developing_collections_testing.html sections.

I'm unsure which section it would be better in - for testing purposes it makes sense to use the testing doc, but there's reasons to use this sort of directory structure for all development work right from the start. We're not currently linking to the developing_collections section of docs in many of our collection readme's now (that I looked at anyway) so we'll need to remedy that regardless, and thus I don't have a preference.

Issue Type

Documentation Report

Component Name

docs/docsite/rst/dev_guide/developing_collections_testing.rst

Ansible Version

ansible [core 2.13.0.dev0] (devel ffd0343670) last updated 2022/01/06 23:12:01 (GMT +000)
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/jill/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/jill/src/ansible/lib/ansible
  ansible collection location = /home/jill/collections:/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/jill/src/ansible/bin/ansible
  python version = 3.8.0 (default, Dec  9 2021, 17:53:27) [GCC 8.4.0]
  jinja version = 3.0.1
  libyaml = True

Configuration

$ ansible-config dump --only-changed

OS / Environment

ubutnu

Additional Information

--

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

D&I working group Docs Hackfest for inclusive language

Let's plan a docs hackfest to make language in our documentation more inclusive.

Some suggestions to look for:
simple, simply, obvious,obviously, guy, guys, man in docs (ansible-base + collections)

ETA: If we can write up specific things to be fixed DaWGs can help us with either (or both) planning a docs day or pointing community members at the list as easy_fixes. This was done for the collections docs and worked well.

Create tagged releases for stable branches

Would it be possible to tag the current state of a stable-2.X branch after each ansible-core release? I understand that the plan is to separate the deployment of docs from ansible-core releases, but this would be helpful for distributions that provide docs and want to sync them with core releases1. Also, I think this will be helpful for upstream purposes so it's easier to see how docs change overtime when looking back at the git history.

Footnotes

  1. Currently, Fedora does not build the html docs, but we do include the raw rst files in an ansible-core-doc subpackage, and I'd prefer not to remove that package in the middle of a release.

include params from the list of variable precedence list has no examples

Summary

https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#understanding-variable-precedence
shows include params in number 21 of the precendence list, but I could not find any example of how it can be used.
I tried it similar to include_vars and it does not work

Issue Type

Documentation Report

Component Name

https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#understanding-variable-precedence

Ansible Version

$ ansible --version

ansible 2.10.5
  config file = /Users/zarin.ohibaibm.com/.ansible.cfg
  configured module search path = ['/Users/zarin.ohibaibm.com/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.9.1 (default, Jan  8 2021, 17:17:17) [Clang 12.0.0 (clang-1200.0.32.28)]

Configuration

$ ansible-config dump --only-changed

ANSIBLE_SSH_CONTROL_PATH_DIR(/Users/zarin.ohibaibm.com/.ansible.cfg) = /tmp/cp
DEFAULT_CALLBACK_PLUGIN_PATH(/Users/zarin.ohibaibm.com/.ansible.cfg) = ['/.ansible/plugins/callback', '/usr/share/ansible/plugins/callback']
DEFAULT_HOST_LIST(/Users/zarin.ohibaibm.com/.ansible.cfg) = ['/Users/zarin.ohibaibm.com/hosts.yaml']
DEFAULT_LOAD_CALLBACK_PLUGINS(/Users/zarin.ohibaibm.com/.ansible.cfg) = True
DEFAULT_PRIVATE_KEY_FILE(/Users/zarin.ohibaibm.com/.ansible.cfg) = /opt/ansible/.ssh/supplied_key
GALAXY_SERVER_LIST(/Users/zarin.ohibaibm.com/.ansible.cfg) = ['internal', 'external']

OS / Environment

MacOS Big Sur version 11.4

Additional Information

Just need examples of how to use include_params. since it has higher predence than include_role.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Audit the rst pages for accessibility

SUMMARY

How well does our documentation work with screenreaders?

We want to:

  • Make sure all link URLs (and cross-reference links) provide descriptive text that conveys information about the content of the target linked page prior to clicking the link.
  • Avoid generic phrases like “click here” in links.

Examples:
A link to a different section in the same document shows the section title.
An external link provides the site name, or title of the target web page.

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

docs.ansible.com

ANSIBLE VERSION

2.11

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

Evaluate and simplify the examples folder

The examples/ folder contains a good few artifacts that are likely to be no longer be maintained or related to docs.

Tasks

role allow_duplicates behaviour incorrectly described

SUMMARY

allow_duplicates: no for import_role appears to do nothing as there appears to be no way to pass role parameters.

allow_duplicate: no for include_role appears to work for vars: dict passing, and also matches those defined via roles: keyword with vars: dict.

The behaviour between between roles included/imported via the different methods, and ways to pass parameters/vars is not documented, and is not at all clear. parameter passing via play role: keyword or dependencies meta/main.yml entry appear to not match with passing identical via vars: dict.

Below is example play omitting only the meta/main.yml method to pull in role. Assuming role meta/main.yml is empty in this case.

- name: first play
  hosts: bla
  roles:
   # one of these will be actioned
    - { role: role1, testvar: 1 }
    - { role: role1, testvar: 1 }
   # one of these will also be actioned
    - role: role1
      vars:
          testvar: 1
    - role: role1
      vars:
          testvar: 1
   tasks:
    # both of these will be actioned
     - name: import role role1, testvar=1
       include_role:
          name: role1
          allow_duplicates: no
       vars:
           testvar: 1
     - name: import role role1, testvar=1, again
       include_role:
          name: role1
          allow_duplicates: no
       vars:
           testvar: 1
     # none of these will be actioned (due to roles section matching)
     - name: include role role1, testvar=1
       include_role:
           name: role1
           allow_duplicates: no
       vars:
           testvar: 1
     - name: include role role1, testvar=1, again
       include_role:
           name: role1
           allow_duplicates: no
       vars:
           testvar: 1
ISSUE TYPE
  • Documentation Report
COMPONENT NAME

roles
include_role
import_role
role dependencies

ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT

Oracle Linux 6

ADDITIONAL INFORMATION

Confusing use of the all group in the inventory guide

The first yaml example in the inventory guide ( https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html ) puts everything into the all:-group. Why? Isn't the all group automatically created? Is there any benefit to doing it explicitly?

According to bcoca: all group is not required
in this case it is just there as the mail.example.com host is not part of any group

This issue should update the example to remove similar confusion in future.

Use of patchback bot

How about installing the patchback bot for this repository? This allows easier backporting of PRs - simply add the backport label for the corresponding stable-2.x branch, and the bot will create a backport PR (assuming no conflict happens).

In the collections I maintain, and in particular in community.general, this is really helpful and simplifies the backporting work a lot. For example I added the backport-6 and backport-7 labels to ansible-collections/community.general#6774, and on merge the bot created two backport PRs ansible-collections/community.general#6817 and ansible-collections/community.general#6818.

Broken `Edit on Github` link

Summary

When I click the edit on github link I am redirected to a 404 page.
image
image

Issue Type

Bug Report

Component Name

docs

Ansible Version

$ ansible --version
Docs Site

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
Docs Site

OS / Environment

Edge Browser on Windows

Steps to Reproduce

click 
![image](https://github.com/ansible/ansible/assets/49696165/a9a8ba2e-9d08-43ce-b576-ef5e5e179374)

Expected Results

I expected to be brought to the sanity tests page

Actual Results

Routed to a 404 page

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Add nox config to automate building docs

It would be nice to have a nox or tox configuration to clone ansible-core, install the necessary build dependencies in a managed virtualenv, and build docs. This improves the contributor experience, as they can run one command instead of four (clone core, create venv, install deps, run Makefile) to build the docs.

nox and tox both preform similar purposes. They allow running different jobs and manage each job's dependencies in a separate virtualenv. nox has its config in Python and tox has a domain-specific INI-like configuration format. I personally prefer nox, and we successfully adopted it in the 5 antsibull projects, but other projects in the ecosystem use tox.

/cc @mattclay

Mention a way for absolute path referencing

Summary

When you start having a lot of playbooks, it makes sense to want to reorganize them or to split reusable tasks in separate files. But if you are referencing other files (like templates, files or other playbooks) in those playbooks, you can't move them easily.
There is a way to implement absolute referencing (although it is a workaround and I believe an environment variable should exist in ansible directly) and I believe it should be included in the documentation. Although I'm not sure of where.

Issue Type

Documentation Report

Component Name

docs/docsite/rst/user_guide/

Ansible Version

N/A

Configuration

N/A

OS / Environment

N/A

Additional Information

Proposed inclusion :

Absolute paths
--------------

Considering you might want to reorganize files referenced in your playbooks later, you should consider using absolute paths. To do that, set the following variables for the `all` group::

    ansible_repo_path: "{{ ansible_config_file[:-12] }}" # Get current repo path : remove trailing /ansible.cfg
    files_path: "{{ ansible_repo_path }}/playbooks/files"
    templates_path: "{{ ansible_repo_path }}/playbooks/templates"
    tasks_path: "{{ ansible_repo_path }}/playbooks/tasks"
    vaults_path: "{{ ansible_repo_path }}/playbooks/vaults"

Then, after creating the file ``playbooks/files/foo.conf``, you can reference it in your playbooks like this::

    - name: Copy file
      ansible.builtin.copy:
        src: {{ files_path }}/foo.conf
        dest: /etc/foo.conf

.. note: This use the fact that you have a ``ansible.cfg`` file at the root of your folder. If this file doesn't exists, this method won't work.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Guidelines for python requirements

Summary

When packaging an ansible collection/role, there currently is no standard way of specifying python requirements, primarily the hard requirements of plugins. Some people use requirements.txt, but there is no standard guidelines for role and collection authors that I could find. It would be nice to have this documented and discussed somewhere.

Issue Type

Documentation Report

Component Name

N/A

Ansible Version

N/A

Configuration

N/A

OS / Environment

N/A

Additional Information

Here is my consideration of possible standards

Using requirements.txt

Pros

  • Currently a popular approach
  • Does not leave a python footprint, e.g. a package name with .egg files

Cons

  • It is not standardized what are build/test/module requirements
  • Only python dependencies

Using python metadata

Pros

  • Current standard for python projects
  • Can specify separate build/test/module requirements, e.g.:
    • build-system.requires for any build requirements, e.g. in ansible-galaxy collection build and equivalents
    • project.dependenceis for local runtime requirements, i.e. plugin requirements
    • project.optional-dependencies.test, etc. for ansible test. Naming not standardized, but it is not that much of an issue
    • project.optional-dependencies.local-runner, project.optional-dependencies.moduleA, or some other format. For dependencies of running a particular runner or module. Does not have to be standardized, just mentioned as a good practice

Cons

  • Python footprint, e.g. must avoid name-clash. Not that severe since some projects already have a setup.py configuration and they use sensible namespacing
  • Only python dependencies

galaxy.yaml

Pros

  • Already standardized

Cons

  • Only handles ansible dependencies

This could be expanded though to include:

  • system_requirements: for system, packages, library and executable requirements
  • python_requirements: for python package requirements

Maybe we could use a similar format like PEP621 to separate them logically by usage

In documentation

Pros

  • Widely used for system requirements

Cons

  • Not standardized
  • Hard to separate system/python requirements and logical

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.