From 89b4a9bda17344e8f0c73f6f7a85b5c3d5d8922f Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 2 Sep 2023 09:42:37 +0200 Subject: [PATCH] Removed independent_user-administrator role --- .../tasks/main.yml | 17 ----------------- roles/user-administrator/meta/main.yml | 3 +-- roles/user-administrator/tasks/main.yml | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 roles/independent_user-administrator/tasks/main.yml diff --git a/roles/independent_user-administrator/tasks/main.yml b/roles/independent_user-administrator/tasks/main.yml deleted file mode 100644 index 7aa2cee6..00000000 --- a/roles/independent_user-administrator/tasks/main.yml +++ /dev/null @@ -1,17 +0,0 @@ -- 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 \ No newline at end of file diff --git a/roles/user-administrator/meta/main.yml b/roles/user-administrator/meta/main.yml index cdc1561d..7b4707e1 100644 --- a/roles/user-administrator/meta/main.yml +++ b/roles/user-administrator/meta/main.yml @@ -1,3 +1,2 @@ dependencies: -- native-sudo -- independent_user-administrator +- native-sudo \ No newline at end of file diff --git a/roles/user-administrator/tasks/main.yml b/roles/user-administrator/tasks/main.yml index 819b444f..dd18691d 100644 --- a/roles/user-administrator/tasks/main.yml +++ b/roles/user-administrator/tasks/main.yml @@ -1,3 +1,21 @@ +- 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"