Add playbook deploy_ssh_private_key.yml.
This commit is contained in:
parent
fae8a6b61b
commit
da9c24f1fc
23
deploy_ssh_private_key.yml
Normal file
23
deploy_ssh_private_key.yml
Normal file
@ -0,0 +1,23 @@
|
||||
- name: deploy SSH private key on Ansible controller
|
||||
hosts: localhost
|
||||
vars_files:
|
||||
- vars/main.yml
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Gather facts
|
||||
ansible.builtin.setup:
|
||||
|
||||
- name: Set ansible_user
|
||||
set_fact:
|
||||
ansible_user: "{{ ansible_user_id }}"
|
||||
|
||||
- name: Retrieve secrets
|
||||
ansible.builtin.include_tasks:
|
||||
file: "tasks/retrieve_secret_vars.yml"
|
||||
|
||||
- name: Deploy SSH private key
|
||||
copy:
|
||||
src: "{{ PRIVATE_KEY_FILE }}"
|
||||
dest: "{{ ansible_user_dir }}/.ssh/"
|
||||
mode: 0600
|
||||
|
Loading…
Reference in New Issue
Block a user