Este conteúdo não está disponível no idioma selecionado.

Chapter 6. Running Ansible playbooks with Automation content navigator


As a content creator, you can execute your Ansible playbooks with Automation content navigator and interactively delve into the results of each play and task to verify or troubleshoot the playbook. You can also execute your Ansible playbooks inside an execution environment and without an execution environment to compare and troubleshoot any problems.

6.1. Executing a playbook from Automation content navigator

You can run Ansible playbooks with the Automation content navigator text-based user interface to follow the execution of the tasks and delve into the results of each task.

Prerequisites

  • A playbook.
  • A valid inventory file if not using localhost or an inventory plugin.

Procedure

  1. Start Automation content navigator

    $ ansible-navigator
    Copy to Clipboard Toggle word wrap
  2. Run the playbook.

    $ :run
    Copy to Clipboard Toggle word wrap
  3. Optional: type ansible-navigator run simple-playbook.yml -i inventory.yml to run the playbook.
  4. Verify or add the inventory and any other command line parameters.

    INVENTORY OR PLAYBOOK NOT FOUND, PLEASE CONFIRM THE FOLLOWING
    ─────────────────────────────────────────────────────────────────────────
       Path to playbook: /home/ansible-navigator_demo/simple_playbook.yml
       Inventory source: /home/ansible-navigator-demo/inventory.yml
      Additional command line parameters: Please provide a value (optional)
    ──────────────────────────────────────────────────────────────────────────
                                                               Submit Cancel
    Copy to Clipboard Toggle word wrap
  5. Tab to Submit and hit Enter. You should see the tasks executing.

  6. Type the number next to a play to step into the play results, or type :<number> for numbers above 9.

    Notice failed tasks show up in red if you have colors enabled for Automation content navigator.

  7. Type the number next to a task to review the task results, or type :<number> for numbers above 9.

  8. Optional: type :doc bring up the documentation for the module or plugin used in the task to aid in troubleshooting.

    ANSIBLE.BUILTIN.PACKAGE_FACTS (MODULE)
      0│---
      1│doc:
      2│  author:
      3│  - Matthew Jones (@matburt)
      4│  - Brian Coca (@bcoca)
      5│  - Adam Miller (@maxamillion)
      6│  collection: ansible.builtin
      7│  description:
      8│  - Return information about installed packages as facts.
    <... output omitted ...>
     11│  module: package_facts
     12│  notes:
     13│  - Supports C(check_mode).
     14│  options:
     15│    manager:
     16│      choices:
     17│      - auto
     18│      - rpm
     19│      - apt
     20│      - portage
     21│      - pkg
     22│      - pacman
    
    <... output truncated ...>
    Copy to Clipboard Toggle word wrap

6.2. Reviewing playbook results with an Automation content navigator artifact file

Automation content navigator saves the results of the playbook run in a JSON artifact file. You can use this file to share the playbook results with someone else, save it for security or compliance reasons, or review and troubleshoot later. You only need the artifact file to review the playbook run. You do not need access to the playbook itself or inventory access.

Prerequisites

  • A Automation content navigator artifact JSON file from a playbook run.

Procedure

  • Start Automation content navigator with the artifact file.

    $ ansible-navigator replay simple_playbook_artifact.json
    Copy to Clipboard Toggle word wrap
    1. Review the playbook results that match when the playbook ran.

You can now type the number next to the plays and tasks to step into each to review the results, as you would after executing the playbook.

Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat