New to Ansible, just testing it. For now, I'm using dynamic inventory scrips, and I'm trying to run simple commands on all hosts, via ansible.
I've setup ec2.py and digital_ocean.py in ~/ansible/, and both scripts work just fine. Provisioned with the correct credentials, if I run either script manually, I get the correct list of assets from those two cloud providers, respectively.
If I run Ansible with just one script (either ec2.py or digital_ocean.py) then that also works well:
ansible -i ~/ansible/ec2.py -u my-special-user -f 20 -s \* -m shell -a 'ps'
ansible -i ~/ansible/digital_ocean.py -u my-special-user -f 20 -s \* -m shell -a 'ps'
But if I try to do just -i ~/ansible/ (hoping to use both inventory scripts in a concatenated list) then it doesn't work. Spying the process list with pstree, I've noticed that ansible runs digital_ocean.py --host with all the hosts from the EC2 list. That can't be right. No wonder it doesn't work then.
What is the correct way to use several dynamic inventory scripts at once for something simple like -m shell -a 'ps'?
P.S.:
If I run ./digital_ocean.py --list manually, it just throws a JSON with my hosts. But if I do ./ec2.py --list manually, then it generates first the "_meta": tag, and then throws a list similar to the DO script. Not sure if this is relevant to the main issue, I just thought I should mention it.