From: Oleg Broytman Date: Wed, 31 Jul 2019 16:05:55 +0000 (+0300) Subject: Refactor(phd): Merge `create.yml` back into `main.yml` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=e2f84bb9d51c4452b61763857dee14db8bc32824;p=ansible.git Refactor(phd): Merge `create.yml` back into `main.yml` --- diff --git a/playbooks/debian/roles/phd/tasks/create.yml b/playbooks/debian/roles/phd/tasks/create.yml deleted file mode 100644 index dbd4209..0000000 --- a/playbooks/debian/roles/phd/tasks/create.yml +++ /dev/null @@ -1,18 +0,0 @@ -- 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: "{{ system_groups }}" diff --git a/playbooks/debian/roles/phd/tasks/main.yml b/playbooks/debian/roles/phd/tasks/main.yml index dfd8780..1ca3a4b 100644 --- a/playbooks/debian/roles/phd/tasks/main.yml +++ b/playbooks/debian/roles/phd/tasks/main.yml @@ -11,8 +11,25 @@ - name: Create and setup user phd block: - - name: Create user phd - import_tasks: create.yml + - 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: "{{ system_groups }}" + - name: Upload and extract home archive unarchive: src: ~/archive/STORE/phd/Home/phd.tar.bz2