Please check one of the following
Still, I am not able to get it working.
#aws_ec2.yaml --- plugin: aws_ec2 aws_profile: default regions: - eu-west-1 filters: instance-state-name : running
# ansible.cfg [default] enable_plugins = aws_ec2 inventory = hosts host_key_checking = False stdout_callback = debug
# ~/.aws/config [default] region = eu-west-1 output = json
Output of Describe Instances:
$ aws ec2 describe-instances { "Reservations": [ { "Groups": [], "Instances": [ { "AmiLaunchIndex": 0, "ImageId": "ami-0aef57767f5404a3c", "InstanceId": "i-03da2458c13c728e3", "InstanceType": "t2.micro", "KeyName": "astroamoreapp", "LaunchTime": "2020-12-08T12:27:17+00:00", "Monitoring": { "State": "disabled" } ..... ..... } ], "OwnerId": "493670244487", "ReservationId": "r-033c3a14ba52afbf7" } ] }
Output of ansible-inventory -i aws_ec2.yml --list
ansible-inventory -i aws_ec2.yml --list
[WARNING]: Unable to parse /home/dishant/nodejs-ansible/aws_ec2.yml as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available { "_meta": { "hostvars": {} }, "all": { "children": [ "ungrouped" ] } }
Did you install aws_ec2 plugin? Read more here: docs.ansible.com/ansible/latest/co...
Plus, it requires boto3 and botocore python modules.
Thanks! its working, actually the issue was with the file name, as mentioned in the given documentation its should end end with aws_ec2.(yml/yaml)
Great!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Please check one of the following
Still, I am not able to get it working.
Output of Describe Instances:
Output of
ansible-inventory -i aws_ec2.yml --list
Did you install aws_ec2 plugin? Read more here: docs.ansible.com/ansible/latest/co...
Plus, it requires boto3 and botocore python modules.
Thanks! its working, actually the issue was with the file name, as mentioned in the given documentation its should end end with aws_ec2.(yml/yaml)
Great!