diff options
author | Dmitry Ilvokhin <d@ilvokhin.com> | 2023-12-19 17:14:50 +0000 |
---|---|---|
committer | Dmitry Ilvokhin <d@ilvokhin.com> | 2023-12-19 17:14:50 +0000 |
commit | 7428c86dd779a4a7938d461ee5bc0105546815f0 (patch) | |
tree | 50a6c68a7324334f467bb196318a248234c3fe8d /roles | |
parent | b1198d5bc54bcda6e6eed5cf7b559a33eeb875f5 (diff) | |
download | infra-7428c86dd779a4a7938d461ee5bc0105546815f0.tar.gz infra-7428c86dd779a4a7938d461ee5bc0105546815f0.tar.bz2 infra-7428c86dd779a4a7938d461ee5bc0105546815f0.zip |
Split essential task into packages and users
Diffstat (limited to 'roles')
-rw-r--r-- | roles/essential/tasks/main.yml | 37 | ||||
-rw-r--r-- | roles/essential/tasks/packages.yml | 7 | ||||
-rw-r--r-- | roles/essential/tasks/users.yml | 27 |
3 files changed, 36 insertions, 35 deletions
diff --git a/roles/essential/tasks/main.yml b/roles/essential/tasks/main.yml index 66fd9e4..111e718 100644 --- a/roles/essential/tasks/main.yml +++ b/roles/essential/tasks/main.yml @@ -1,35 +1,2 @@ -- name: Install essential tools - ansible.builtin.package: - name: - - vim - - screen - - git - state: present - -- name: Remove default arch user - ansible.builtin.user: - name: arch - state: absent - -- 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/essential/files/id_rsa.pub - dest: /home/d/.ssh/authorized_keys - owner: d - group: d - mode: u+rw,g-rwx,o-rwx +- ansible.builtin.include_tasks: roles/essential/tasks/packages.yml +- ansible.builtin.include_tasks: roles/essential/tasks/users.yml diff --git a/roles/essential/tasks/packages.yml b/roles/essential/tasks/packages.yml new file mode 100644 index 0000000..e0f0390 --- /dev/null +++ b/roles/essential/tasks/packages.yml @@ -0,0 +1,7 @@ +- name: Install essential tools + ansible.builtin.package: + name: + - vim + - screen + - git + state: present diff --git a/roles/essential/tasks/users.yml b/roles/essential/tasks/users.yml new file mode 100644 index 0000000..add5757 --- /dev/null +++ b/roles/essential/tasks/users.yml @@ -0,0 +1,27 @@ +- name: Remove default arch user + ansible.builtin.user: + name: arch + state: absent + +- 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/essential/files/id_rsa.pub + dest: /home/d/.ssh/authorized_keys + owner: d + group: d + mode: u+rw,g-rwx,o-rwx |