Installing AWS SSM agents in EC2 instances using Ansible 2.0.

Posted By : Ankit Arora | 25-Sep-2017

Installing AWS SSM agents in EC2 instances using Ansible 2.0.

AWS SSM also provides us a service to provision the servers from AWS dashboard.

To work with SSM, we need to install SSM agents first on EC2 instances.


Writing inventory file:



Writing ssm-playbook.yml


 - hosts: belfrics

   user: ubuntu


     - ssm


Writing vars.yml



## Variables for installing SSM agent on Ubuntu


# Directory in which package will be installed

temp_ssm: "/tmp/ssm" # URL from package will be downloaded. ssm_url: ""



Writing roles/ssm/tasks/main.yml file:


 - name: Creating SSM directory  in tmp


    path: "{{ temp_ssm }}"

    state: directory


 - name: Install deb file for Debian family 32/64-bit

   become: yes

   become_user: root


    deb: ""

 - name: Starting SSM service    service:     name: amazon-ssm-agent     enabled: yes     state: started



ansible-playbook -i inventory ssm-playbook.yml


About Author

Author Image
Ankit Arora

Ankit is a Redhat Certified Engineer and Cloud Engineer.

Request for Proposal

Name is required

Comment is required

Sending message..