0
In Red Hat Ansible Engine 2.4, we made some changes to how inventory works. We introduced a new cli tool, and added an inventory plugin type.
The goal of this plugin type, was well, to make Ansible Engine even more pluggable. All kidding aside, we wanted to provide Ansible Engine content authors and Ansible Engine users a new way to visualize their target inventory. Using the ansible-inventory command, the targeted inventory will be listed with the details of the hosts in that inventory, and the hosts groups.
For example:
[thaumos@ecb51a545078 /]# ansible-inventory -i ~/Development/playbooks/inventory/prod.aws_ec2.yml --list
{
"_meta": {
"hostvars": {
"ec2-5x-xx-x-xxx.us-west-2.compute.amazonaws.com": {
"AmiLaunchIndex": 2,
"Architecture": "x86_64",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"AttachTime": "2017-12-13T15:40:19+00:00",
"DeleteOnTermination": false,
"Status": "attached",
"VolumeId": "vol-0514xxx"
}
}
],
"ClientToken": "",
"EbsOptimized": false,
"Hypervisor": "xen",
"ImageId": "ami-0c2aba6c",
"InstanceId": "i-009xxxx3",
"InstanceType": "t2.micro",
"KeyName": "blogKey",
"LaunchTime": "2017-12-13T15:40:18+00:00",
"Monitoring": {
"State": "disabled"
},
"NetworkInterfaces": [
{
"Association": {
"IpOwnerId": "amazon",
"PublicDnsName": "ec2-5x-xx-x-xxx.us-west-2.compute.amazonaws.com",
"PublicIp": "5x.xx.x.xxx"
},
"Attachment": {
"AttachTime": "2017-12-13T15:40:18+00:00",
"AttachmentId": "eni-attach-97c4xxxx",
"DeleteOnTermination": true,
"DeviceIndex": 0,
"Status": "attached"
},
"Description": "",
"Groups": [
{
"GroupId": "sg-e63xxxxd",
"GroupName": "blogGroup"
}
],
"Ipv6Addresses": Continue reading