From b8d90587492becebbc8828a79deee1edb0792083 Mon Sep 17 00:00:00 2001 From: Dmitry Ilvokhin Date: Fri, 8 Mar 2024 21:26:47 +0000 Subject: Add ssh role --- roles/ssh/tasks/main.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 roles/ssh/tasks/main.yml (limited to 'roles/ssh/tasks/main.yml') diff --git a/roles/ssh/tasks/main.yml b/roles/ssh/tasks/main.yml new file mode 100644 index 0000000..92d4efd --- /dev/null +++ b/roles/ssh/tasks/main.yml @@ -0,0 +1,33 @@ +- name: Setup SSH directory for Dmitry Ilvokhin + ansible.builtin.file: + path: /home/d/.ssh + state: directory + owner: d + group: d + mode: u+rw,g-wx,o-rwx + +- name: Update authorized_keys for Dmitry Ilvokhin + ansible.posix.authorized_key: + user: d + state: present + key: '{{ item }}' + with_file: + - misc/pubkeys/d.pub + +- name: Configure ssh for Dmitry Ilvokhin + ansible.builtin.template: + src: misc/dotfiles/ssh/config.j2 + dest: "~{{ user }}/.ssh/config" + owner: "{{ user }}" + mode: u+rw,g-rw,o-rw + when: + - jumphost + +- name: Add ssh rc for Dmitry Ilvokhin + ansible.builtin.copy: + src: misc/dotfiles/ssh/rc + dest: "~{{ user }}/.ssh/rc" + owner: "{{ user }}" + mode: u+rwx,g-rw,o-rw + when: + - jumphost -- cgit v1.2.3-70-g09d2