Original post https://github.com/ansible/ansible/issues/26574

ANSIBLE VERSION

ansible 2.3.1.0
config file = /projects/robomation/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.5 (default, Aug 2 2016, 04:20:16) [GCC 4.8.5 20150623 
(Red Hat 4.8.5-4)]

I have several resources running and when i run

ec2.py --list

{
  "_meta": {
    "hostvars": {}
  }
}

Also when i try to run ansible playbooks targeting hosts with certain tags, 
i get this

[WARNING]: Found both group and host with same name: localhost
...
...
...
skipping: no hosts matched

I am having issues setting up dynamic inventory to work properly. I have my 
ec2.ini and ec2.py files and ec2.py is set to be executable and i believe i 
have setup right. Also command does not return error only it returns 
nothing in body.

What do i do to troubleshoot dynamic inventory?



I have also tried what @Deepakkothandan <https://github.com/deepakkothandan>

Still doesn't work

[root@robomation robomation]# env | grep ANSIBLE
ANSIBLE_HOSTS=/projects/robomation/inventory/ec2.py

[root@robomation robomation]# env | grep EC2_INI
EC2_INI_PATH=/projects/robomation/inventory/ec2.ini

[root@robomation robomation]# env | grep AWS
AWS_REGION=us-west-2

[root@robomation robomation]# inventory/ec2.py --list
{
  "_meta": {
    "hostvars": {}
  }
}

[root@robomation robomation]# ansible --version
ansible 2.3.1.0
  config file = /projects/robomation/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.5 (default, Aug  2 2016, 04:20:16) [GCC 4.8.5 20150623 
(Red Hat 4.8.5-4)]

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dfabee3f-39ea-4ebc-b307-1b475ddbeb70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to