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
已提問 4 年前檢視次數 544 次
1 個回答
0
已接受的答案

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
專家
已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南