add tasks/user.yml to create nimbus user

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-06-10 17:54:12 +02:00
parent 8a7c949408
commit 5573109b49
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 31 additions and 0 deletions

View File

@ -1,4 +1,5 @@
---
- import_tasks: checks.yml
- import_tasks: user.yml
- import_tasks: service.yml
- import_tasks: firewall.yml

30
tasks/user.yml Normal file
View File

@ -0,0 +1,30 @@
---
- name: Create service user
win_user:
name: '{{ beacon_node_service_user_name }}'
profile: '{{ beacon_node_service_home }}'
home_directory: '{{ beacon_node_service_home }}'
# We set garbage since we use SSH keys anyway
password: '{{ beacon_node_service_user_pass }}'
- name: Create user profile
win_user_profile:
username: '{{ beacon_node_service_user_name }}'
- name: Create folder for SSH authorized keys
win_file:
path: '{{ beacon_node_service_home }}/.ssh'
state: 'directory'
- name: Copy SSH authorized keys from admin
win_copy:
src: 'C:/Users/admin/.ssh/authorized_keys'
dest: '{{ beacon_node_service_home }}/.ssh/authorized_keys'
remote_src: true
become_user: '{{ beacon_node_service_user_name }}'
- name: Fix permissions on the SSH folder
win_owner:
path: '{{ beacon_node_service_home }}/.ssh'
user: '{{ beacon_node_service_user_name }}'
recurse: true