From: Oleg Broytman Date: Fri, 12 Jul 2019 00:14:18 +0000 (+0300) Subject: Feat(debian-init-user-phd): Create groups X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=3fcd4cd213446c84c892237f1e12d25fa636f862;p=ansible.git Feat(debian-init-user-phd): Create groups --- diff --git a/playbooks/debian-init-user-phd.yml b/playbooks/debian-init-user-phd.yml index be5c8fa..b842599 100644 --- a/playbooks/debian-init-user-phd.yml +++ b/playbooks/debian-init-user-phd.yml @@ -1,13 +1,25 @@ - name: Create user phd hosts: "{{ hosts | default('servers') }}" gather_facts: false + vars: + system_groups: root,adm,disk,cdrom,floppy,sudo,audio,www-data,video,plugdev,staff,users,Debian-exim,fuse,sambashare,input tasks: + - name: Create system groups + become: true + group: + name: "{{ item }}" + system: true + loop: "{{ system_groups.split(',') }}" + - name: Create group phd + become: true + group: + name: phd - name: Add user phd become: true user: name: phd group: phd - groups: root,adm,disk,cdrom,floppy,sudo,audio,www-data,video,plugdev,staff,users,Debian-exim,fuse,sambashare,input + groups: "{{ system_groups }}" - name: Create folder ~phd/.ssh file: path: ~phd/.ssh @@ -24,9 +36,22 @@ mode: 0600 - name: Update local user phd hosts: localhost + gather_facts: false + vars: + system_groups: root,adm,disk,cdrom,floppy,sudo,audio,www-data,video,plugdev,staff,users,Debian-exim,fuse,sambashare,bluetooth,davfs2,vboxusers,input tasks: + - name: Create system groups + become: true + group: + name: "{{ item }}" + system: true + loop: "{{ system_groups.split(',') }}" + - name: Create group phd + become: true + group: + name: phd - name: user phd become: true user: name: phd - groups: root,adm,disk,cdrom,floppy,sudo,audio,www-data,video,plugdev,staff,users,Debian-exim,fuse,sambashare,bluetooth,davfs2,vboxusers,input + groups: "{{ system_groups }}"