File tree Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 11---
22# defaults file for aws-ssm
33url : ' amd64'
4+ # aws_ssm_activation_code:
5+ # aws_ssm_activation_id:
6+ # aws_ssm_ec2_region: "{{ec2_region}}"
Original file line number Diff line number Diff line change 11---
2- # handlers file for aws-ssm
2+
3+ - name : restart amazon-ssm-agent
4+ service :
5+ name : amazon-ssm-agent
6+ state : restarted
Original file line number Diff line number Diff line change 2626 deb : " https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_{{ url }}/amazon-ssm-agent.deb"
2727 when : ansible_os_family == 'Debian'
2828
29+ - include : register.yml
30+ when : aws_ssm_activation_code is defined and aws_ssm_activation_id is defined
31+
2932- name : Register to service
3033 become : yes
3134 become_user : root
Original file line number Diff line number Diff line change 1+ ---
2+
3+ - name : Check if node is registered
4+ stat :
5+ path : /var/lib/amazon/ssm/registration
6+ register : stat_result
7+
8+ - name : Register managed instance
9+ command : amazon-ssm-agent -register -clear -code '{{aws_ssm_activation_code}}' -id '{{aws_ssm_activation_id}}' -region '{{aws_ssm_ec2_region}}' -y
10+ notify : restart amazon-ssm-agent
11+ when : not stat_result.stat.exists
You can’t perform that action at this time.
0 commit comments