Supported Execution environments for agnosticd should be named using one of the following conventions:
-
ee-<python virtualenv>
- Execution Environments for legacy python virtualenvs available on ../virtualenvs Ex:ee-ansible2.9-python3.6-2021-11-30
-
ee-<purpose>
- execution environment customized for a particular purpose. For example, the<purpose>
string could be to support a particular version of a cloud provider different from what is included in the multi-cloud environment. Ansible version should be 2.9+ and python version should be 3.6+. Ex:ee-multicloud
. Version can be added as tag using semantic versioning.
Requirement:
-
podman or docker installed and configured on your workstation.
-
ansible-navigator installed, see below for instructions
Available public images are listed on Quay here:
Requirement:
-
podman or docker installed and configured on your workstation.
-
ansible-navigator installed, see below for instructions
-
access to private registry image-registry.apps.open.redhat.com:
-
oc login
to the OCP4 cluster hosting the registry
-
Supported images, based on supported Execution Environments, are available in the private registry image-registry.apps.open.redhat.com.
To login to the registry, get a token using the OCP client as follows:
podman login -u unused -p $(oc whoami -t) image-registry.apps.open.redhat.com
List of support EE can be found on the production clusters by looking at images in the agnosticd namespace.
As of 2022-03-07, the list is:
oc get is -n agnosticd
NAME IMAGE REPOSITORY TAGS UPDATED ee-ansible2.9-python3.6-2021-01-22 default-route-openshift-image-registry.apps.ocp-us-west-2.infra.open.redhat.com/agnosticd/ee-ansible2.9-python3.6-2021-01-22 latest 6 hours ago ee-ansible2.9-python3.6-2021-11-30 default-route-openshift-image-registry.apps.ocp-us-west-2.infra.open.redhat.com/agnosticd/ee-ansible2.9-python3.6-2021-11-30 latest 4 hours ago ee-azure_open_envs-ansible2.9-python3.6-2022-01-10 default-route-openshift-image-registry.apps.ocp-us-west-2.infra.open.redhat.com/agnosticd/ee-azure_open_envs-ansible2.9-python3.6-2022-01-10 latest 6 hours ago ee-equinix_metal-ansible2.9-python3.6-2021-07-02 default-route-openshift-image-registry.apps.ocp-us-west-2.infra.open.redhat.com/agnosticd/ee-equinix_metal-ansible2.9-python3.6-2021-07-02 latest 6 hours ago ee-equinix_metal-ansible2.9-python3.6-2021-11-03 default-route-openshift-image-registry.apps.ocp-us-west-2.infra.open.redhat.com/agnosticd/ee-equinix_metal-ansible2.9-python3.6-2021-11-03 latest 4 hours ago ee-multicloud default-route-openshift-image-registry.apps.ocp-us-west-2.infra.open.redhat.com/agnosticd/ee-multicloud v0.0.4,v0.0.3 7 hours ago
-
Upstream project: https://github.com/ansible/ansible-navigator
ansible-navigator
is the preferred tool for running AgnosticD. With this CLI tool, you can use the supported agnosticd images. It has both a static stdout mode and an interactive mode.
See Upstream project: https://github.com/ansible/ansible-navigator for complete instructions.
You can use requirements-ee.txt or just install it with pip
:
pip3 install 'ansible-navigator[ansible-core]'
To use Execution Environments, you need to run agnosticd with ansible-navigator
.
# Run from agnosticd directory
cd agnosticd
ansible-navigator run ansible/main.yml \
--eei image-registry.apps.open.redhat.com/agnosticd/ee-ansible2.9-python3.6-2021-11-30 \
-e @ansible/configs/test-empty-config/sample_vars.yml
Note
|
On Mac, you probably want to change the container engine to docker , using --ce docker
|
ansible-navigator run ansible/main.yml \ --eei quay.io/agnosticd/ee-multicloud:v0.0.4 \ --eev ~/secrets:/secrets \ -e @ansible/configs/test-empty-config/sample_vars_ec2.yml \ -e @/secrets/dev.yml
Note
|
Add --mode stdout option to mimic ansible-playbook simple output.
|
# Run from agnosticd directory
cd agnosticd
ansible-navigator run ansible/main.yml \
--eei quay.io/agnosticd/legacy-ee:ansible2.9-python3.6-2021-11-30 \
--eev ~/secrets:/secrets \
-e @ansible/configs/test-empty-config/sample_vars_ec2.yml \
-e @/secrets/dev.yml
Some of the arguments in the above example can be setup in a config file, in your home directory.
~/.ansible-navigator.yaml
ansible-navigator:
execution-environment:
image: quay.io/agnosticd/ee-multicloud:v0.0.4
volume-mounts:
- src: /home/fridim/vars
dest: /vars
- src: /home/fridim/secrets
dest: /secrets
mode: stdout
Then the command is much simpler:
ansible-navigator run ansible/main.yml \ -e @ansible/configs/test-empty-config/sample_vars_ec2.yml \ -e @/secrets/dev.yml
Please refer to upstream documentation for configuring ansible-navigator.
Requirements:
-
podman installed and configured
-
oc login
to the OCP4 cluster hosting the registry
mkdir -p ~/virtualenvs/ansible-builder python3 -mvenv ~/virtualenvs/ansible-builder . ~/virtualenvs/ansible-builder/bin/activate pip install --upgrade pip pip install -r requirements-ee.txt
podman login quay.io podman login registry.redhat.io podman login -u unused -p $(oc whoami -t) image-registry.apps.open.redhat.com
Execution environment images should always target specific dated versions.
ansible-builder build --tag ee-ansible2.9-python3.6-2021-10-29
-
PROD image-registry.apps.open.redhat.com
# prod podman login -u unused -p $(oc whoami -t) image-registry.apps.open.redhat.com
registry=image-registry.apps.open.redhat.com #replace with the image tag you want to push name=ee-ansible2.9-python3.6-2021-10-29 podman push $name $registry/agnosticd/$name name=ee-multicloud:v0.1.1 podman push $name $registry/agnosticd/$name