Running playbooks in an execution environment
Now that we have explored how to create execution environments, we can start using them. The first thing we will do is check the Ansible and Python versions.
To execute commands and Playbooks in execution environments, we can use ansible-navigator
. To install it, we can execute $ pip
install ansible-navigator
.
The equivalent of the ansible --version
command in the minimal-ee
is the following:
$ ansible-navigator exec --eei minimal-ee -- ansible --version
As you can see, the biggest difference is the addition of --eei minimal-ee
, which tells ansible-navigator
which execution environment image to use, and running it will return the following:
ansible [core 2.15.1] config file = /etc/ansible/ansible.cfg configured module search path = ['/tmp/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.9/site-packages...