You can run your EE on the command line against localhost or a remote target using ansible-navigator.
Note
There are other tools besides ansible-navigator you can run EEs with.
Create a test_localhost.yml playbook.
- name: Gather and print local facts
hosts: localhost
become: true
gather_facts: true
tasks:
- name: Print facts
ansible.builtin.debug:
var: ansible_facts
Run the playbook inside the postgresql_ee EE.
ansible-navigator run test_localhost.yml --execution-environment-image postgresql_ee --mode stdout --pull-policy missing --container-options='--user=0'
You may notice the facts being gathered are about the container and not the developer machine. This is because the ansible playbook was run inside the container.
Before you start, ensure you have the following:
sudo permissions on the remote host.Execute a playbook inside the postgresql_ee EE against a remote host machine as in the following example:
Create a directory for inventory files.
mkdir inventory
Create the hosts.yml inventory file in the inventory directory.
all:
hosts:
192.168.0.2 # Replace with the IP of your target host
Create a test_remote.yml playbook.
- name: Gather and print facts
hosts: all
become: true
gather_facts: true
tasks:
- name: Print facts
ansible.builtin.debug:
var: ansible_facts
Run the playbook inside the postgresql_ee EE.
Replace student with the appropriate username. Some arguments in the command can be optional depending on your target host authentication method.
ansible-navigator run test_remote.yml -i inventory --execution-environment-image postgresql_ee:latest --mode stdout --pull-policy missing --enable-prompts -u student -k -K
See also
Provides information about the about Execution Environment definition file and available options.
Provides details about using Ansible Builder.
Provides details about using Ansible Navigator.
This guide in the Ansible community forum explains how to set up a local registry for your Execution Environment images.
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/getting_started_ee/run_execution_environment.html