blob: 89646eba51f01e0e97dfd55ba1dd6d5d799226b4 [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Zack Williamsc989f262017-05-11 13:02:59 -070017---
18# ssh-install/tasks/main.yml
19
20- name: Create ~/.ssh directory
21 file:
22 dest: "{{ ansible_user_dir }}/.ssh/"
23 mode: 0700
24 owner: "{{ ansible_user_id }}"
25 group: "{{ ansible_user_gid }}"
26 state: directory
27
28- name: Install ssh private key
29 copy:
30 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey"
31 dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}"
32 mode: 0600
33 owner: "{{ ansible_user_id }}"
34 group: "{{ ansible_user_gid }}"
35 backup: true
36
37- name: Install ssh public key
38 copy:
39 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub"
40 dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}.pub"
41 mode: 0600
42 owner: "{{ ansible_user_id }}"
43 group: "{{ ansible_user_gid }}"
44 backup: true
45