summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc/pubkeys/a/a.pub1
-rw-r--r--roles/ssh/tasks/main.yml22
-rw-r--r--roles/users/tasks/main.yml6
3 files changed, 29 insertions, 0 deletions
diff --git a/misc/pubkeys/a/a.pub b/misc/pubkeys/a/a.pub
new file mode 100644
index 0000000..1b7b204
--- /dev/null
+++ b/misc/pubkeys/a/a.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDk5+tNJwLlWBkatoKdoXG+itsKteunHQhGwnBQVjD0nwilddNi/28jWM7FhhLSSVHDx9tUa2vv6jvs9MVamTbrNB7jTqnsG8vbX8fPjQAYV7U8zi5EGKK+pc63y9AJeTMiJQaiuYpq0qlu+9MQUBm+3tzhFDj3Y+VgTa28VufxLjkPYIrG0gKNLTHo4xwmwhy7J2jqZQ4E6Rx593406gtV8UCh+cLufFnoqM4KrvqxQw439QSMAG+3y9rvWEZwDcBsgsNdUrlN9Mb8SqL028Z/liaV21c8siR/ydHyAmmIAJpmpKlqeGbWn7IR2FAS/fl7AeQP6DVFEjTG41yct64t
diff --git a/roles/ssh/tasks/main.yml b/roles/ssh/tasks/main.yml
index 0e2fdbf..24b50da 100644
--- a/roles/ssh/tasks/main.yml
+++ b/roles/ssh/tasks/main.yml
@@ -23,3 +23,25 @@
name: sshconfig
tags:
- dotfiles
+
+- name: Setup SSH directory for Anastasiia Semenova
+ ansible.builtin.file:
+ path: /home/a/.ssh
+ state: directory
+ owner: a
+ group: a
+ mode: u+rw,g-wx,o-rwx
+ when: inventory_hostname in groups['home']
+ tags:
+ - dotfiles
+
+- name: Update authorized_keys for Anastasiia Semenova
+ ansible.posix.authorized_key:
+ user: a
+ state: present
+ key: "{{ lookup('file', item) }}"
+ with_fileglob:
+ - misc/pubkeys/a/*.pub
+ when: inventory_hostname in groups['home']
+ tags:
+ - dotfiles
diff --git a/roles/users/tasks/main.yml b/roles/users/tasks/main.yml
index f3df2df..6906823 100644
--- a/roles/users/tasks/main.yml
+++ b/roles/users/tasks/main.yml
@@ -14,3 +14,9 @@
# Group http required to deploy websites with rsync under personal
# username.
- http
+
+- name: Create user for Anastasiia Semenova
+ ansible.builtin.user:
+ name: a
+ home: /home/a
+ when: inventory_hostname in groups['home']