2024-07-10 09:06:57 +00:00
|
|
|
- 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:
|
2024-07-11 10:05:59 +00:00
|
|
|
src: ./vm_files/remote_key
|
|
|
|
dest: "{{ home }}/.ssh/{{ device_name }}_generic_ed25519"
|
|
|
|
mode: u=rw,g=,o=
|
2024-07-10 09:06:57 +00:00
|
|
|
- copy:
|
2024-07-11 10:05:59 +00:00
|
|
|
src: ./vm_files/remote_key.pub
|
|
|
|
dest: "{{ home }}/.ssh/{{ device_name }}_generic_ed25519.pub"
|
|
|
|
mode: u=rw,g=,o=
|
2024-07-10 09:06:57 +00:00
|
|
|
|
|
|
|
- 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
|
|
|
|
copy:
|
|
|
|
src: "{{ home }}/.dots/profiles/{{ organization }}/configs/ssh"
|
|
|
|
dest: "{{ home }}/.ssh/profiles/{{ organization }}"
|