From 17e34063d12f8017994996817722975a1477f671 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Wed, 9 Dec 2020 19:27:42 +0100 Subject: [PATCH] users task is no longer needed This is now a role --- tasks/users.yml | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 tasks/users.yml diff --git a/tasks/users.yml b/tasks/users.yml deleted file mode 100644 index becf453..0000000 --- a/tasks/users.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- name: Add users | create users, shell, home dirs - user: - name: "{{ item }}" - shell: /bin/bash - createhome: yes - comment: 'created with ansible' - password_lock: true - append: true - with_items: - - "{{ admin_users }}" - -- name: Create .ssh user directories - file: - path: "{{ '/home/' + item + '/.ssh' }}" - state: directory - mode: "0700" - owner: "{{ item }}" - group: "{{ item }}" - with_items: - - "{{ admin_users }}" - -- name: Set authorized keys for users - copy: - src: "{{'users/' + item + '_authorized_keys'}}" - remote_src: no - dest: "{{ '/home/' + item + '/.ssh/authorized_keys' }}" - mode: "0600" - owner: "{{ item }}" - group: "{{ item }}" - with_items: - - "{{ admin_users }}" - -- name: Place users in sudo group - user: - name: "{{ item }}" - groups: sudo - append: yes - with_items: - - "{{ admin_users }}" - -- name: Configure group sudo for sudoers without password - lineinfile: - path: /etc/sudoers - state: present - regexp: '^%sudo\s' - line: '%sudo ALL=(ALL) NOPASSWD: ALL' - validate: /usr/sbin/visudo -cf %s