Answer the question
In order to leave comments, you need to log in
How to use ansible ad-hoc with AWS EC2 by Name tag?
Hello
Please explain how you need to configure ansible to work with ec2 by tag. Rantsche used the Dynamic Inventory script ec2.py for this purpose. Which has recently been deprecated.
And at the moment, the aws_ec2 plugin is somehow used.
IMHO: There is no information on how this plugin is connected in the offdock .
Google so far found an article on how to switch from using ec2.py to aws_ec2. Created a file:
aws_ec2.yml:
plugin: aws_ec2
regions:
- eu-west-1
ansible all -i ./aws_ec2.yml -m ping
[WARNING]: * Failed to parse /home/user/aws_ec2.yml with auto plugin: Insufficient boto credentials found. Please provide them in your inventory configuration file or
set them as environment variables.
[WARNING]: * Failed to parse /home/user/aws_ec2.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]: * Failed to parse /home/user/aws_ec2.yml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved
to provide a port.
[WARNING]: Unable to parse /home/user/aws_ec2.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question