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:
[testserver] 255.255.255.255
Writing ssm -playbook.yml
--- - hosts: belfrics user: ubuntu roles: - 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: "https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb"
Writing roles/ssm/tasks/main.yml file:
--- - name: Creating SSM directory in tmp file: path: "{{ temp_ssm }}" state: directory - name: Install deb file for Debian family 32/64-bit become: yes become_user: root apt: deb: "https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb" - name: Starting SSM service service: name: amazon-ssm-agent enabled: yes state: started
Finally,
ansible-playbook -i inventory ssm-playbook.yml
Request for Proposal
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Ankit Arora
Ankit is a Redhat Certified Engineer and Cloud Engineer.