2020-12-24 14:27:31 +01:00
|
|
|
- name: create administrator
|
|
|
|
user:
|
|
|
|
name: administrator
|
2021-01-01 13:14:12 +01:00
|
|
|
update_password: on_create
|
2021-01-01 13:22:15 +01:00
|
|
|
password: "{{ user_administrator_initial_password | password_hash('sha512') }}"
|
2021-01-01 21:07:35 +01:00
|
|
|
create_home: yes
|
|
|
|
generate_ssh_key: yes
|
|
|
|
ssh_key_type: rsa
|
|
|
|
ssh_key_bits: 8192
|
2020-12-25 15:38:42 +01:00
|
|
|
|
|
|
|
- name: create /home/administrator/.ssh/authorized_keys
|
|
|
|
copy:
|
|
|
|
src: "{{ inventory_dir }}/files/{{ inventory_hostname }}/home/administrator/.ssh/authorized_keys"
|
|
|
|
dest: /home/administrator/.ssh/authorized_keys
|
|
|
|
owner: administrator
|
|
|
|
group: administrator
|
|
|
|
mode: '0644'
|
|
|
|
|
2020-12-31 17:01:47 +01:00
|
|
|
- name: grant administrator sudo rights with password
|
2020-12-25 15:38:42 +01:00
|
|
|
copy:
|
2021-01-01 12:51:40 +01:00
|
|
|
src: "administrator"
|
|
|
|
dest: /etc/sudoers.d/administrator
|
|
|
|
mode: '0644'
|
|
|
|
owner: root
|
|
|
|
group: root
|