summaryrefslogtreecommitdiff
path: root/roles/ssh/tasks/main.yml
diff options
context:
space:
mode:
authorDmitry Ilvokhin <d@ilvokhin.com>2024-03-08 21:26:47 +0000
committerDmitry Ilvokhin <d@ilvokhin.com>2024-03-08 21:26:47 +0000
commitb8d90587492becebbc8828a79deee1edb0792083 (patch)
tree1c5e9d5c5342de586cdded523c4855726b15ccaf /roles/ssh/tasks/main.yml
parent55fe803f1795061d1397c76a793cc2f1986b4774 (diff)
downloadinfra-b8d90587492becebbc8828a79deee1edb0792083.tar.gz
infra-b8d90587492becebbc8828a79deee1edb0792083.tar.bz2
infra-b8d90587492becebbc8828a79deee1edb0792083.zip
Add ssh role
Diffstat (limited to 'roles/ssh/tasks/main.yml')
-rw-r--r--roles/ssh/tasks/main.yml33
1 files changed, 33 insertions, 0 deletions
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