forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpre_infra.yml
30 lines (27 loc) · 902 Bytes
/
pre_infra.yml
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
- name: Step 000 Pre Infrastructure
hosts: localhost
connection: local
gather_facts: false
become: false
tags:
- step001
- pre_infrastructure
- generate_env_keys
tasks:
- debug:
msg: "Step 000 Pre Infrastructure"
- name: Generate SSH keys
shell: ssh-keygen -b 2048 -t rsa -f "{{output_dir}}/{{env_authorized_key}}" -q -N ""
args:
creates: "{{output_dir}}/{{env_authorized_key}}"
when: set_env_authorized_key | bool
- name: fix permission
file:
path: "{{output_dir}}/{{env_authorized_key}}"
mode: 0400
when: set_env_authorized_key | bool
- name: Generate SSH pub key
shell: ssh-keygen -y -f "{{output_dir}}/{{env_authorized_key}}" > "{{output_dir}}/{{env_authorized_key}}.pub"
args:
creates: "{{output_dir}}/{{env_authorized_key}}.pub"
when: set_env_authorized_key | bool