From 01fdf3634f5c3de97b8f2762246a3a5943e77347 Mon Sep 17 00:00:00 2001 From: Tobias Maier Date: Mon, 18 Oct 2021 14:28:03 +0200 Subject: [PATCH] maybe this time? --- playbook.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/playbook.yml b/playbook.yml index 8146634..07e9a14 100644 --- a/playbook.yml +++ b/playbook.yml @@ -17,16 +17,21 @@ name: sudo state: present - - name: Allow 'tobi' user to have sudo + - name: Make sure we have a 'wheel' group + group: + name: wheel + state=present + + - name: Allow 'wheel' group to have passwordless sudo lineinfile: - dest: /etc/sudoers - state: present - regexp: '^%tobi' - line: '%tobi ALL=(ALL) NOPASSWD: ALL' - validate: 'visudo -cf %s' + dest=/etc/sudoers + state: present + regexp='^%wheel' + line: '%wheel ALL=(ALL) NOPASSWD: ALL' - name: Add the user tobi ansible.builtin.user: name: tobi password: $6$9OnvBMN6Sxc.muW1$afASAJdoPZL/WxTp6.lh/SurRRiClaru2Pl19fEo6j1aDEQw99kdkfls6.DB8OBacBDnT3bpsLYD3JqrvXlE9/ comment: Tobias Maier + groups: wheel