2.0 - Documentation

Task 1

  • Print out a list of all Ansible modules in your terminal

Don’t be rattled about the massive amount of modules you’ll see in your terminal.

  • Print out information about the Ansible module file in your terminal

Task 2

  • Find the official online documentation of Ansible in your browser
  • Visit the module index (e.g. list of all modules) in the online documentation
  • Use the search field in the upper left of the webpage and also use the search field in the lower right

Task 3 (Advanced)

  • By installing the ansible-doc package, not only the command itself gets installed but also a lot of additional documentation. Use your package-managers functionality to find out what files are installed with yum install ansible-doc.
  • Now find documentation about jinja2 on the controller.

Solutions

$ ansible-doc -l
$ ansible-doc file
$ ansible-doc -s file

Ansible Doc options explained:
-l is synoymous with --list and list all available modules.
-s is synoymous with --snippet and displays for the file module.`


One way to find a list of provided documentation:

$ yum install -y yum-utils # (if needed)
$ repoquery ansible-doc -l

Note: Above only applies for ansible version 2.8 and earlier. In 2.9 there is only one package called ansible

You can also search for files in /usr/share/doc:

$ ls -lahr /usr/share/doc/ | grep jinja2

Note: Above only applies for ansible version 2.8 and earlier. In 2.9 there is only one package called ansible