Navigator and Builder

The

CC BY-SA 4.0

Sagar Paul

About me.

SAGAR

Software Engineer at Ansible by Red Hat
Open Source Enthusiast
Learning and Automating Networks

 

Index

ansible-navigator

  • Navigator is a text-based user interface (TUI).
  • It is a command-based tool for creating, reviewing, and troubleshooting Ansible content, including inventories, playbooks, and collections.
  • Comes in handy exploring execution environments and running content with them
Playbook
Execution Environment
ansible-navigator
content creator

How to get navigator?


Install Automation content navigator.
$ dnf install ansible-navigator

Install Automation content navigator via pip.
$ pip install ansible-navigator

Uses for Automation content navigator

  • Launch and watch jobs and playbooks.
  • Share stored, completed playbook and job run artifacts in JSON format.
  • Browse and introspect automation execution environments.
  • Browse your file-based inventory.
  • Render Ansible module documentation and extract examples you can use in your playbooks.
  • View a detailed command output on the user interface.

Automation content navigator commands

ansible-playbook
vs
ansible-navigator

Difference between

commands

What makes an automation execution environment?

..........................................................

EXECUTION ENVIRONMENT
  • A base image like ansible-runner or centos
  • A version of Python
  • A version of ansible-core
  • Python modules/dependencies
  • Ansible Content Collections (optional)

I would build it for you!

.................................................................................

ansible-builder v2

exec-env.yml

requirements.yml

requirements.txt

bindep.txt

ansible-builder version 3

  • Single location to define process, no need for separate bindep/ requirements file.
  • Define every aspect of the build, multiple prepend and append steps (add extra repos/ python packages location/ local certificates)
  • Define ansible-core, runner, python, pkg manager, user, and more.
  • Add custom files anywhere on the VM into the build context.
  • Build off a single image, no builder image is needed.

How to get builder?


Install ansible builder.
$ dnf install ansible-builder

Install ansible builder via pip.
$ pip install ansible-builder

or 

$ pip3 install ansible-builder==3.0.0
NOTE: ansible-builder requires python>=3.9
Ansible Runner

Ansible Runner is a tool that allows users to run Ansible Playbooks in an isolated environment. It provides a simple command-line interface for running playbooks and provides a range of output formats, including JSON, YAML, and CSV.

Ansible Runner can work as a standalone tool, a container image interface, or a Python module that can be imported. The goal is to provide a stable and consistent interface abstraction to Ansible.

Ansible Runner can be used to automate complex workflows and integrate with other tools, such as Jenkins or Ansible Tower.

How to get runner?


Install ansible runner.
$ dnf install ansible-runner

Install ansible runner via pip.
$ pip install ansible-runner

ansible-runner

DEMO

&

Sagar Paul

CC BY-SA 4.0

Ansible Navigator and Builder talk

By Sagar Paul

Ansible Navigator and Builder talk

  • 104