From 3fcd4cd213446c84c892237f1e12d25fa636f862 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 12 Jul 2019 03:14:18 +0300 Subject: [PATCH] Feat(debian-init-user-phd): Create groups --- playbooks/debian-init-user-phd.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) 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 }}" -- 2.39.5