diff options
author | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-01-06 18:31:09 +0000 |
---|---|---|
committer | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-01-06 18:31:09 +0000 |
commit | a2f60b8691706d67c1b5446a78f8bebd541f554c (patch) | |
tree | 1ad6835d702d361805f2c04ff5a2babbb0c71076 /roles/users/tasks | |
parent | db46530e3349439f4417efab5af7b38e1ad928d1 (diff) | |
download | infra-a2f60b8691706d67c1b5446a78f8bebd541f554c.tar.gz infra-a2f60b8691706d67c1b5446a78f8bebd541f554c.tar.bz2 infra-a2f60b8691706d67c1b5446a78f8bebd541f554c.zip |
Migrate essential role to playbook completely
Diffstat (limited to 'roles/users/tasks')
-rw-r--r-- | roles/users/tasks/main.yml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/roles/users/tasks/main.yml b/roles/users/tasks/main.yml new file mode 100644 index 0000000..264ad28 --- /dev/null +++ b/roles/users/tasks/main.yml @@ -0,0 +1,29 @@ +- name: Remove default users + ansible.builtin.user: + name: '{{ item }}' + state: absent + loop: + - arch + +- name: Create user for Dmitry Ilvokhin + ansible.builtin.user: + name: d + home: /home/d + groups: + - wheel + +- 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.builtin.copy: + src: roles/users/files/id_rsa.pub + dest: /home/d/.ssh/authorized_keys + owner: d + group: d + mode: u+rw,g-rwx,o-rwx |