File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+
3+ - name : Retrieve SSH private key for AWS instance(s) from Hashicorp Vault
4+ set_fact :
5+ aws : " {{ lookup('community.hashi_vault.hashi_vault', 'applications/heritage-{{ environment_name }}-eu-west-2/tuxedo/aws') }}"
6+ no_log : True
7+
8+ - name : Ensure SSH directory exists
9+ file :
10+ path : /root/.ssh
11+ owner : root
12+ group : root
13+ state : directory
14+ mode : ' 0700'
15+
16+ - name : Write SSH private key to Ansible controller
17+ copy :
18+ content : " {{ aws['ssh_private_key'] }}"
19+ dest : /root/.ssh/ansible_remote
20+ no_log : True
21+
22+ - name : Set SSH private key permissions
23+ file :
24+ path : /root/.ssh/ansible_remote
25+ owner : root
26+ group : root
27+ mode : ' 0600'
Original file line number Diff line number Diff line change 1+ ---
2+
3+ - hosts : localhost
4+ roles :
5+ - sshkey
You can’t perform that action at this time.
0 commit comments