Ansible installation requirements for EC2 instances (managed nodes)

0

Reading the documentation about the execution of Ansible Playbooks on SSM (AWS-ApplyAnsiblePlaybooks), I've found the sentence: Ansible must be pre-installed on the instances. But, searching more info about the Ansible, we can confirm that Ansible installation only is needed when the local computer is a Control Node, used to create or manage the Ansible's scripts. See this section on Ansible article:

"You only need to install it on one machine (which could easily be a laptop) and it can manage an entire fleet of remote machines from that central point. When Ansible manages remote machines, it does not leave software installed or running on them, so there’s no real question about how to upgrade Ansible when moving to a new version."

So, why we need to deploy Ansible on EC2 previously to run SSM documents with Ansible? We can confirm again in this doc section "Installed Dependencies".

profile pictureAWS
asked 4 years ago535 views
1 Answer
0
Accepted Answer

When you use SSM to run an Ansible document, it actually executes the Ansible command on the host that you designate. All SSM documents have to run on an EC2 host so you need to have one host with ansible installed. This host can then connect to other hosts and run commands as stated in an ansible playbook. You can even use the AWS dynamic inventory boto script to group and define hosts (https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html). But this one host with ansible is required.

SSM document is just a remote script runner that has to connect to a host and run the script so that host has to have all the tools installed are required by the script.

AWS
EXPERT
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions