DEV Community

Discussion on: My Ansible AWS EC2 Dynamic Inventory

Collapse
 
jouo profile image
Jashua

Are there any advantages on using Ansible over AWS Systems Manager?

Collapse
 
abdallah profile image
Abdallah Deeb

One does not rule out the other. In fact, they are better together. AWS Systems Manager allows you to reach the running instances (managed by SSM), and run commands there (SendCommand, etc.) See: aws.amazon.com/blogs/mt/running-an...

Running Ansible playbooks (via SSM or directly) is one of the better options to update instances, install additional software, and basically do more complicated tasks on those instances.

However, running playbooks from a "home" (AKA controller) machine is sometimes more convenient. In these cases, you need a way to connect to those instances. You will notice that I use hostnames: [instance-id, dns-names] in my plugin configuration. This works well with my SSH over SSM setup on this home machine, and Ansible uses that. So since ssh i-xxxxxxxxxx works, ansible -m ping i-xxxxxxxxxx also works.

See: docs.aws.amazon.com/systems-manage... for more information on getting started with that.