ansible-documentation icon indicating copy to clipboard operation
ansible-documentation copied to clipboard

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

Open acozine opened this issue 4 years ago • 18 comments

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.

  • [x] ansible-playbook
  • [x] 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

  • [X] I agree to follow the Ansible Code of Conduct

acozine avatar Aug 16 '21 19:08 acozine

Files identified in the description: None

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibot avatar Aug 16 '21 19:08 ansibot

For folks who find this issue searching for documentation on the CLI tools, current detailed docs for them are here: https://docs.ansible.com/ansible/latest/user_guide/command_line_tools.html.

The cheatsheet is a good idea, it just hasn't been implemented yet. Check out the DaWGs (Docs Working Group) if you can help!

acozine avatar Dec 21 '21 16:12 acozine

Hi ! I'd like to document the most used ansible commands in the mentionned CheatSheet, can I be assigned on this issue ?

IlyesSemlali avatar Oct 17 '22 19:10 IlyesSemlali

Hey @IlyesSemlali ! So sorry I didn't see this! Are you still up for adding this documentation to the cheatsheet?

samccann avatar Apr 18 '23 15:04 samccann

This can be one PR per command if you don't want to add all of them.

samccann avatar Apr 18 '23 15:04 samccann

Hey @acozine creating a PR with a template of the example you point me to, how should I go about getting the cheatsheet for Ansible-galaxy as one of the main commands?

To be sure, should I have created a folder cli to store the docs for other commonly-used CLI commands as mentioned above?

Dule-martins avatar May 16 '23 22:05 Dule-martins

@Dule-martins you can just add the other commands to the existing page in the docs. Take a look at https://github.com/ansible/ansible/pull/76655/files, which added the ansible-playbook command (but be aware, that file has moved . . . see below for the new location).

The complete CLI docs are auto-generated. For example the page https://docs.ansible.com/ansible/latest/cli/ansible-config.html is created from the python code for the ansible-config utility. So there is no file called docs/docsite/rst/cli/ansible-config.rst even though there is a docs page at https://docs.ansible.com/ansible/latest/cli/ansible-config.html.

You can use that docs page as a source of content for adding a section about ansible-config to the cheatsheet file in its new location at https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/command_guide/cheatsheet.rst.

Thanks for taking a look at this!

acozine avatar May 25 '23 15:05 acozine

@Dule-martins hey thanks for taking this on! I just had a thought - as writers, we may not know the common flags etc for each command. What do you and @acozine think about asking for common flags etc on something like the ansible Reddit? They are usually a helpful group of people there and we might get and idea of what people typically do with something like the ansible-galaxy command etc..

samccann avatar May 25 '23 15:05 samccann

@Dule-martins you can just add the other commands to the existing page in the docs. Take a look at https://github.com/ansible/ansible/pull/76655/files, which added the ansible-playbook command (but be aware, that file has moved . . . see below for the new location).

The complete CLI docs are auto-generated. For example the page https://docs.ansible.com/ansible/latest/cli/ansible-config.html is created from the python code for the ansible-config utility. So there is no file called docs/docsite/rst/cli/ansible-config.rst even though there is a docs page at https://docs.ansible.com/ansible/latest/cli/ansible-config.html.

You can use that docs page as a source of content for adding a section about ansible-config to the cheatsheet file in its new location at https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/command_guide/cheatsheet.rst.

Thanks for taking a look at this!

Thank you for helping me understand how to handle this issue.

Dule-martins avatar Jun 06 '23 14:06 Dule-martins

@Dule-martins hey thanks for taking this on! I just had a thought - as writers, we may not know the common flags etc for each command. What do you and @acozine think about asking for common flags etc on something like the ansible Reddit? They are usually a helpful group of people there and we might get and idea of what people typically do with something like the ansible-galaxy command etc..

I will check that out as I work on this, thank you @samccann

Dule-martins avatar Jun 06 '23 14:06 Dule-martins

We did ask on reddit here and with a community-topic. So far not so much feedback but hopefully we'll get a few more replies.

samccann avatar Jun 06 '23 19:06 samccann

Hi I'm interested to start working in this issue. Please assign me.

BhattacharjeeSutapa avatar Jul 03 '23 18:07 BhattacharjeeSutapa

@BhattacharjeeSutapa You're all set. Please let us know if you have any questions or need more help for this one.

oraNod avatar Jul 04 '23 08:07 oraNod

@acozine Is there a reason some commands were omitted from the checklist in the summary?

  • ansible-console
  • ansible-pull
  • ansible-test

mattclay avatar Jul 05 '23 23:07 mattclay

Updated the description to add those three.. thanks @mattclay

samccann avatar Jul 11 '23 14:07 samccann

@BhattacharjeeSutapa - let's try taking this one command at a time. The next one on the list is [ansible-galaxy](https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html).

From a user perspective, this is used two ways:

  • to install a role from galaxy `ansible-galaxy install
  • to install a collection from galaxy
  • to batch download either of these using a requirements file.
  • to list all installed roles or collections

Since this cheatsheet is in the user guide, I'd say we should ignore how developers use this command for now.

So if we follow the cheatsheet for ansible-playbook, then we'd want three simple examples I think:

  • ansible-galaxy install <role>
  • ansible-galaxy collection <namespace.collection-name>
  • ansible-galaxy collection -r requirements.txt

That last one is the only one with a flag and the requirements.txt is a file that lists all the collections the user wants to install at once.

samccann avatar Jul 17 '23 19:07 samccann

Since we moved docs to a new repo, the cheatsheet rst file is now at https://github.com/ansible/ansible-documentation/edit/devel/docs/docsite/rst/command_guide/cheatsheet.rst

samccann avatar Aug 04 '23 14:08 samccann

For ansible-galaxy - should also include ansible-galaxy role install and ansible-galaxy install -r in a follow up PR.

samccann avatar Nov 30 '23 19:11 samccann