Hello, I'm lab on my local environment with RHEL9.3 and subcribed. When using the command to list the inventory output, I found it displayed too much unnecessary information, which is not happening at all in the teaching video. I tried it dozens of times thinking the environment didn't exist yet, but the information kept showing up.
[root@huyvl-linux-training ~]# ansible-navigator inventory -i my_inventory/ -m stdout --list
--------------------------------------------------------------------------------------------------------------
Execution environment image and pull policy overview
--------------------------------------------------------------------------------------------------------------
Execution environment image name: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
Execution environment image tag: latest
Execution environment pull arguments: None
Execution environment pull policy: tag
Execution environment pull needed: True
--------------------------------------------------------------------------------------------------------------
Updating the execution environment
--------------------------------------------------------------------------------------------------------------
Running the command: podman pull registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
Trying to pull registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob 1de299fb0d50 skipped: already exists
Copying blob 87e3ab05d9a4 skipped: already exists
Copying blob 08c375495313 skipped: already exists
Copying blob dc9b17c0a14e skipped: already exists
Copying config 80a02196e3 done
Writing manifest to image destination
Storing signatures
80a02196e30edffdb7b41aa7ac37628559fdf6aebe066f53c0e68a49450b4917
[WARNING]: * Failed to parse /root/my_inventory/dev/linux with yaml plugin: We were unable to read either as JSON nor YAML, these are the errors we got from each: JSON: Expecting value: line 1 column 2
(char 1) Syntax Error while loading YAML. did not find expected <document start> The error appears to be in '/root/my_inventory/dev/linux': line 2, column 1, but may be elsewhere in the file depending
on the exact syntax problem. The offending line appears to be: [rhel8] rhel[a-b].example.com ^ here
[WARNING]: * Failed to parse /root/my_inventory/dev/linux with ini plugin: host range must be begin:end or begin:end:step
[WARNING]: Unable to parse /root/my_inventory/dev/linux as an inventory source
[WARNING]: Unable to parse /root/my_inventory/prod as an inventory source
[WARNING]: Unable to parse /root/my_inventory/qa as an inventory source
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped",
"rhel8",
"switches",
"routers"
]
},
"routers": {
"hosts": [
"192.168.0.254",
"192.168.1.254",
"192.168.2.254"
]
},
"switches": {
"hosts": [
"192.168.0.1",
"192.168.1.1",
"192.168.2.1",
"192.168.3.1"
]
}
}
[root@huyvl-linux-training ~]#
Ah ok I got it - check the image and pull policy overview in your screenshot : you can set accordingly : https://docs.ansible.com/automation-controller/latest/html/userguide/execution_environments.html
Specify the image pull policy
always:Always pull the image,
missing:Pull if not locally available,
never:Never pull the image,
tag:if the image tag is 'latest', always pull the image, otherwise pull if not locally available
@huyvl3-fptcloud Which video lecture are you referring to ? It seems ansible-navigator failed to parse the inventory files either because of the syntax error or file format error.
Thanks for your respond @Chetan_Tiwary_ . Maybe I have a problem with the syntax. After tweaking it properly, the problem still shows up.
showing up.
[root@huyvltest ~]# ansible-navigator inventory -i my_inventory/dev/linux -m stdout --list
--------------------------------------------------------------------------------------------------------------
Execution environment image and pull policy overview
--------------------------------------------------------------------------------------------------------------
Execution environment image name: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
Execution environment image tag: latest
Execution environment pull arguments: None
Execution environment pull policy: tag
Execution environment pull needed: True
--------------------------------------------------------------------------------------------------------------
Updating the execution environment
--------------------------------------------------------------------------------------------------------------
Running the command: podman pull registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
Trying to pull registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob 08c375495313 skipped: already exists
Copying blob 87e3ab05d9a4 skipped: already exists
Copying blob 1de299fb0d50 skipped: already exists
Copying blob dc9b17c0a14e skipped: already exists
Copying config 80a02196e3 done
Writing manifest to image destination
Storing signatures
80a02196e30edffdb7b41aa7ac37628559fdf6aebe066f53c0e68a49450b4917
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped",
"rhel8"
]
},
"rhel8": {
"hosts": [
"web1.example.com"
]
}
}
[root@huyvltest ~]# ansible-navigator inventory -i my_inventory/dev/linux -m stdout --list
--------------------------------------------------------------------------------------------------------------
Execution environment image and pull policy overview
--------------------------------------------------------------------------------------------------------------
Execution environment image name: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
Execution environment image tag: latest
Execution environment pull arguments: None
Execution environment pull policy: tag
Execution environment pull needed: True
--------------------------------------------------------------------------------------------------------------
Updating the execution environment
--------------------------------------------------------------------------------------------------------------
Running the command: podman pull registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
Trying to pull registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob 08c375495313 skipped: already exists
Copying blob dc9b17c0a14e skipped: already exists
Copying blob 87e3ab05d9a4 skipped: already exists
Copying blob 1de299fb0d50 skipped: already exists
Copying config 80a02196e3 done
Writing manifest to image destination
Storing signatures
80a02196e30edffdb7b41aa7ac37628559fdf6aebe066f53c0e68a49450b4917
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped",
"rhel8"
]
},
"rhel8": {
"hosts": [
"web1.example.com"
]
}
}
[root@huyvltest ~]#
It is the lesson content of the first part of RH294 chapter 02
Ah ok I got it - check the image and pull policy overview in your screenshot : you can set accordingly : https://docs.ansible.com/automation-controller/latest/html/userguide/execution_environments.html
Specify the image pull policy
always:Always pull the image,
missing:Pull if not locally available,
never:Never pull the image,
tag:if the image tag is 'latest', always pull the image, otherwise pull if not locally available
That's what's been bugging me these past few days - missing ansible-navigator configuration
[root@huyvl-linux-training ~]# cat .ansible-navigator.yml
---
ansible-navigator:
execution-environment:
image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
pull:
policy: missing
[root@huyvl-linux-training ~]#
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.