Skip to content

Commit

Permalink
chore: Add Amazon SSM Agent via apt & remove the snap version
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXKnight committed Jan 21, 2025
1 parent f42bdca commit d94ed3f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
30 changes: 30 additions & 0 deletions playbooks/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,36 @@
update_cache: yes
when: ansible_distribution in common_redhat_variants

- name: Remove Amazon SSM Agent installed via snap
snap:
name: "amazon-ssm-agent"
state: absent
when: ansible_distribution in common_debian_variants

- name: Download Amazon SSM Agent
get_url:
url: "{{ common_amazon_ssm_agent_package_url }}"
dest: "{{ common_amazon_ssm_agent_package_local_path }}"
mode: '0644'
when: ansible_distribution in common_debian_variants

- name: Install Amazon SSM Agent via apt
apt:
deb: "{{ common_amazon_ssm_agent_package_local_path }}"
when: ansible_distribution in common_debian_variants

- name: Remove Amazon SSM Agent package
file:
path: "{{ common_amazon_ssm_agent_package_local_path }}"
state: absent
when: ansible_distribution in common_debian_variants

- name: Enable Amazon SSM Agent
systemd_service:
name: "amazon-ssm-agent"
state: stopped
enabled: true
when: ansible_distribution in common_debian_variants

- name: Create common directories
file:
Expand Down
4 changes: 4 additions & 0 deletions playbooks/roles/common_vars/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ common_debian_pkgs_default:
- unzip
- net-tools
- python3-pip
- xz-utils

common_release_specific_debian_pkgs:
xenial:
Expand All @@ -152,6 +153,9 @@ common_release_specific_debian_pkgs:

common_debian_pkgs: "{{ common_debian_pkgs_default + common_release_specific_debian_pkgs[ansible_distribution_release] }}"

common_amazon_ssm_agent_package_url: "https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/debian_amd64/amazon-ssm-agent.deb"
common_amazon_ssm_agent_package_local_path: "/tmp/amazon-ssm-agent.deb"

common_debian_devstack_pkgs:
- watchman

Expand Down

0 comments on commit d94ed3f

Please sign in to comment.