tobiko/roles/tobiko-ensure-ssh-keys/tasks/main.yaml
Federico Ressi 07e593f829 Rewrite Vagrant file using ansible and Centos 8
Depends-On: Ifa876b3e5f89258f40055fa7ce03f5e9c601771c
Change-Id: I806c76bff85210f74cd23c29835f41c174b8c960
2020-06-23 11:47:17 +02:00

23 lines
428 B
YAML

---
- name: "generate local SSH key '{{ ssh_key_file }}'"
openssh_keypair:
path: '{{ ssh_key_file }}'
type: rsa
size: 4096
state: present
force: no
delegate_to: localhost
- name: "copy '{{ ssh_key_file }}' file to host"
copy:
src: '{{ ssh_key_file }}{{ item }}'
dest: '/home/vagrant/.ssh/id_rsa{{ item }}'
owner: vagrant
group: vagrant
mode: '0600'
loop:
- ''
- '.pub'