From 97afdac16af888334a80c4a3666bd1b2645f784b Mon Sep 17 00:00:00 2001 From: Julian Schacher Date: Wed, 22 Nov 2023 16:39:54 +0100 Subject: [PATCH] Add role for ensuring a cit user, which has root privileges --- playbooks/roles/cit_user/tasks/main.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 playbooks/roles/cit_user/tasks/main.yaml diff --git a/playbooks/roles/cit_user/tasks/main.yaml b/playbooks/roles/cit_user/tasks/main.yaml new file mode 100644 index 0000000..6206996 --- /dev/null +++ b/playbooks/roles/cit_user/tasks/main.yaml @@ -0,0 +1,18 @@ +- name: Ensure cit user + ansible.builtin.user: + name: cit + create_home: true + shell: /bin/bash + password: '!' + state: present + become: true + +- name: Ensure cit user has root privileges + community.general.sudoers: + name: cit root privileges + user: cit + commands: ALL + host: ALL + nopassword: true + validation: required + state: present