summaryrefslogtreecommitdiffstats
path: root/roles/ands_openshift/tasks/ssh_keygen.yml
blob: 21a7b0ab99e5a9624e7a392e9d0c4cd85c7afd77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
---
- name: Ensure ssh directory exists
  file: path="{{ ssh_template_path }}" state="directory" mode=0600 owner=root group=root

- name: Generate ssh-key
  command: ssh-keygen -t rsa -C "ands-ssh@ipe.kit.edu" -N "" -f "{{ ssh_template_path }}"/id_rsa creates="{{ ssh_template_path }}/id_rsa"

- name: Create ssh secret
  command: oc -n "{{ openshift_namespace }}" secrets new ands-ssh id_rsa="{{ ssh_template_path }}"/id_rsa id_rsa_pub="{{ ssh_template_path }}/id_rsa.pub"

- name: Ensure ssh secret key is removed
  file: path="{{ ssh_template_path }}/id_rsa" state=absent