41 lines
1,007 B
YAML
41 lines
1,007 B
YAML
- name: Setup ssh dir
|
|
file:
|
|
path: "{{ home }}/.ssh"
|
|
state: directory
|
|
recurse: true
|
|
owner: "{{ user }}"
|
|
|
|
- name: Copy pre-generated ssh keys
|
|
when: "not target_is_real"
|
|
block:
|
|
- copy:
|
|
src: ./vm_files/remote_key
|
|
dest: "{{ home }}/.ssh/{{ device_name }}_generic_ed25519"
|
|
mode: u=rw,g=,o=
|
|
- copy:
|
|
src: ./vm_files/remote_key.pub
|
|
dest: "{{ home }}/.ssh/{{ device_name }}_generic_ed25519.pub"
|
|
mode: u=rw,g=,o=
|
|
|
|
- name: Config git
|
|
template:
|
|
src: ssh_config
|
|
dest: "{{ home }}/.ssh/config"
|
|
owner: "{{ user }}"
|
|
mode: u=rw,g=,o=
|
|
|
|
- name: Load known hosts
|
|
template:
|
|
src: known_hosts
|
|
dest: "{{ home }}/.ssh/known_hosts"
|
|
owner: "{{ user }}"
|
|
mode: u=rw,g=,o=
|
|
|
|
- name: Load organization profile
|
|
when: organization is defined and "ssh" in organization_customize
|
|
become: true
|
|
copy:
|
|
src: "{{ home }}/.dots/profiles/{{ organization }}/configs/ssh"
|
|
dest: "{{ home }}/.ssh/profiles/{{ organization }}"
|
|
|
|
template:
|