File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 22
33export ANSIBLE_HOST_KEY_CHECKING=false
44
5- sudo yum -y install awscli python-boto3
5+ sudo yum -y install awscli python-boto3 jq
66sudo amazon-linux-extras install ansible2 -y
77
88cd /tmp
99
1010aws s3 cp --region ${region} --recursive s3://${bucket} / .
1111
12- aws secretsmanager get-secret-value --secret-id ansible-key-pairs | jq ' .SecretString' | sed ' s/"//g' | base64 -Di - -o ~ /.ssh/current_id_rsa
13- aws secretsmanager get-secret-value --secret-id ansible-key-pairs --version-stage AWSPREVIOUS | jq ' .SecretString' | sed ' s/"//g' | base64 -Di - -o ~ /.ssh/previous_id_rsa
12+ mkdir ~ /.ssh
13+ chmod 700 ~ /.ssh
14+ aws secretsmanager get-secret-value --region ${region} --secret-id ansible-key-pairs | jq ' .SecretString' | sed ' s/"//g' | base64 -di - > ~ /.ssh/current_id_rsa
15+ aws secretsmanager get-secret-value --region ${region} --secret-id ansible-key-pairs --version-stage AWSPREVIOUS | jq ' .SecretString' | sed ' s/"//g' | base64 -di - > ~ /.ssh/previous_id_rsa
1416chmod 400 ~ /.ssh/current_id_rsa
1517chmod 400 ~ /.ssh/previous_id_rsa
16- ssh-agent
18+ eval $( ssh-agent)
1719ssh-add ~ /.ssh/current_id_rsa ~ /.ssh/previous_id_rsa
1820ssh-keygen -l -f ~ /.ssh/current_id_rsa > ~ /.ssh/current_id_rsa.pub
1921ssh-keygen -l -f ~ /.ssh/previous_id_rsa > ~ /.ssh/previous_id_rsa.pub
You can’t perform that action at this time.
0 commit comments