Skip to content

Commit d623fb2

Browse files
committed
chore: Add Amazon SSM Agent via apt & remove the snap version
1 parent f42bdca commit d623fb2

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

playbooks/roles/common/tasks/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,36 @@
141141
update_cache: yes
142142
when: ansible_distribution in common_redhat_variants
143143

144+
- name: Remove Amazon SSM Agent installed via snap
145+
snap:
146+
name: "amazon-ssm-agent"
147+
state: absent
148+
when: ansible_distribution in common_debian_variants
149+
150+
- name: Download Amazon SSM Agent
151+
get_url:
152+
url: "{{ common_amazon_ssm_agent_package_url }}"
153+
dest: "{{ common_amazon_ssm_agent_package_local_path }}"
154+
mode: '0644'
155+
when: ansible_distribution in common_debian_variants
156+
157+
- name: Install Amazon SSM Agent via apt
158+
apt:
159+
deb: "{{ common_amazon_ssm_agent_package_local_path }}"
160+
when: ansible_distribution in common_debian_variants
161+
162+
- name: Remove Amazon SSM Agent package
163+
file:
164+
path: "{{ common_amazon_ssm_agent_package_local_path }}"
165+
state: absent
166+
when: ansible_distribution in common_debian_variants
167+
168+
- name: Enable Amazon SSM Agent
169+
systemd:
170+
name: "amazon-ssm-agent"
171+
state: stopped
172+
enabled: true
173+
when: ansible_distribution in common_debian_variants
144174

145175
- name: Create common directories
146176
file:

playbooks/roles/common_vars/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ common_debian_pkgs_default:
137137
- unzip
138138
- net-tools
139139
- python3-pip
140+
- xz-utils
140141

141142
common_release_specific_debian_pkgs:
142143
xenial:
@@ -152,6 +153,9 @@ common_release_specific_debian_pkgs:
152153

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

156+
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"
157+
common_amazon_ssm_agent_package_local_path: "/tmp/amazon-ssm-agent.deb"
158+
155159
common_debian_devstack_pkgs:
156160
- watchman
157161

0 commit comments

Comments
 (0)