Skip to content

Commit dde7f32

Browse files
author
Brian Fitzwater - IDI-C
authored
Merge pull request #12 from GSA/fix_run_data
fix errors in run_data
2 parents 9c21dcc + e9a1d71 commit dde7f32

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

files/run.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22

33
export ANSIBLE_HOST_KEY_CHECKING=false
44

5-
sudo yum -y install awscli python-boto3
5+
sudo yum -y install awscli python-boto3 jq
66
sudo amazon-linux-extras install ansible2 -y
77

88
cd /tmp
99

1010
aws 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
1416
chmod 400 ~/.ssh/current_id_rsa
1517
chmod 400 ~/.ssh/previous_id_rsa
16-
ssh-agent
18+
eval $(ssh-agent)
1719
ssh-add ~/.ssh/current_id_rsa ~/.ssh/previous_id_rsa
1820
ssh-keygen -l -f ~/.ssh/current_id_rsa > ~/.ssh/current_id_rsa.pub
1921
ssh-keygen -l -f ~/.ssh/previous_id_rsa > ~/.ssh/previous_id_rsa.pub

0 commit comments

Comments
 (0)