mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-12-27 04:25:02 +01:00
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
- name: create administrator
|
|
user:
|
|
name: administrator
|
|
update_password: on_create
|
|
password: "{{ user_administrator_initial_password | password_hash('sha512') }}"
|
|
create_home: yes
|
|
generate_ssh_key: yes
|
|
ssh_key_type: rsa
|
|
ssh_key_bits: 8192
|
|
|
|
- name: "create {{path_administrator_scripts}}"
|
|
file:
|
|
path: "{{path_administrator_home}}scripts"
|
|
state: directory
|
|
owner: administrator
|
|
group: administrator
|
|
mode: 0700
|
|
|
|
- name: create {{path_administrator_home}}.ssh/authorized_keys
|
|
copy:
|
|
src: "{{ inventory_dir }}/files/{{ inventory_hostname }}{{path_administrator_home}}.ssh/authorized_keys"
|
|
dest: "{{path_administrator_home}}.ssh/authorized_keys"
|
|
owner: administrator
|
|
group: administrator
|
|
mode: '0644'
|
|
|
|
- name: grant administrator sudo rights with password
|
|
copy:
|
|
src: "administrator"
|
|
dest: /etc/sudoers.d/administrator
|
|
mode: '0644'
|
|
owner: root
|
|
group: root
|
|
notify: sshd restart
|
|
|
|
- name: "create {{path_administrator_home}}volumes/"
|
|
file:
|
|
path: "{{path_administrator_home}}volumes"
|
|
state: directory
|
|
owner: administrator
|
|
group: administrator
|
|
mode: 0700
|