-
Notifications
You must be signed in to change notification settings - Fork 3
/
ssh_key_local.yaml
33 lines (29 loc) · 1.21 KB
/
ssh_key_local.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
- name: Create a Local SSH Key
hosts: localhost
gather_facts: no
vars:
vars_prompt:
- name: project_name
prompt: project_name
default: "{{ project_name | default( lookup('env','PROJECT', default='PROJECT') ) }}"
private: false
vars_files:
pre_tasks:
- name: Show
delegate_to: localhost
ansible.builtin.debug:
msg: |
- project_name: {{ project_name }}
- ssh_key_directory {{ ssh_key_directory | default('UNDEFINED') }}
- ssh_key_name {{ ssh_key_name | default('UNDEFINED') }}
- ssh_key_size {{ ssh_key_size | default('UNDEFINED') }}
- ssh_key_type {{ ssh_key_type | default('UNDEFINED') }}
- ssh_key_private_file {{ ssh_key_directory | default('UNDEFINED') }}/{{ ssh_key_name | default('UNDEFINED') }}
- ssh_key_public_file {{ ssh_key_directory | default('UNDEFINED') }}/{{ ssh_key_name | default('UNDEFINED') }}.pub
roles:
# - ssh_key_local # Create local default SSH keypair
- role: ssh_key_local # Create local default SSH keypair
vars:
ssh_key_name: "{{ project_name }}"
ssh_key_passphrase: "{{ project_name }}"