diff --git a/playbooks/roles/common/tasks/main.yml b/playbooks/roles/common/tasks/main.yml index 8f524dca62a..a74654edef1 100644 --- a/playbooks/roles/common/tasks/main.yml +++ b/playbooks/roles/common/tasks/main.yml @@ -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: diff --git a/playbooks/roles/common_vars/defaults/main.yml b/playbooks/roles/common_vars/defaults/main.yml index e461607cdf3..25f5ea157d4 100644 --- a/playbooks/roles/common_vars/defaults/main.yml +++ b/playbooks/roles/common_vars/defaults/main.yml @@ -137,6 +137,7 @@ common_debian_pkgs_default: - unzip - net-tools - python3-pip + - xz-utils common_release_specific_debian_pkgs: xenial: @@ -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