From d24a9f4f6efb6c7cc219010c5d1609b5481bb11c Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Thu, 23 Aug 2018 14:29:20 +0200 Subject: [PATCH] Split users between me and deploy_users --- tasks/sudo.yml | 2 +- tasks/users.yml | 13 +++++++++++-- vars/common.yml | 3 +++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tasks/sudo.yml b/tasks/sudo.yml index 5e10da0..1cee243 100644 --- a/tasks/sudo.yml +++ b/tasks/sudo.yml @@ -17,7 +17,7 @@ - name: Add local user to sudo group user: - name: "{{ item }}" + name: "{{ item.username }}" groups: sudo append: yes with_items: '{{ deploy_users }}' diff --git a/tasks/users.yml b/tasks/users.yml index 56bec97..251037f 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -1,9 +1,18 @@ --- -- name: Add users +- name: Add deploy users user: name: "{{ item.username }}" password: "{{ item.password }}" uid: "{{ item.uid }}" shell: /bin/zsh - with_items: "{{ users }}" + with_items: "{{ deploy_users }}" + +- name: Add me + user: + name: "{{ item.username }}" + password: "{{ item.password }}" + uid: "{{ item.uid }}" + shell: /bin/zsh + with_items: "{{ me }}" + when: not minimal diff --git a/vars/common.yml b/vars/common.yml index 16b36c7..49c7ee5 100644 --- a/vars/common.yml +++ b/vars/common.yml @@ -4,6 +4,9 @@ users: - { username: 'lafrite', password: '$6$OnPrZgotbSWZlh0T$VSyF8lUhD/N881d1GsggE7jDFt0uAzls2r.pqgDV6XQKbTqZWfv0X4QWd/3wivUDyzaSjP4LQWVfne7KYR6Vv1', uid: '1000'} - { username: 'waha', password: '$6$tQLlZ3lI/NDcT3.C$VCBzrpNxDgOK7b2que2/BnAYWl.zKVugZrQEPxtsq3iWcskEzQ1NvytZRXkB4GCDa/xEohxiodyCaZyFnhxby1', uid: '999'} +me: + - lafrite + deploy_users: - waha