Split users between me and deploy_users

This commit is contained in:
Bertrand Benjamin 2018-08-23 14:29:20 +02:00
parent ae3687242a
commit d24a9f4f6e
3 changed files with 15 additions and 3 deletions

View File

@ -17,7 +17,7 @@
- name: Add local user to sudo group - name: Add local user to sudo group
user: user:
name: "{{ item }}" name: "{{ item.username }}"
groups: sudo groups: sudo
append: yes append: yes
with_items: '{{ deploy_users }}' with_items: '{{ deploy_users }}'

View File

@ -1,9 +1,18 @@
--- ---
- name: Add users - name: Add deploy users
user: user:
name: "{{ item.username }}" name: "{{ item.username }}"
password: "{{ item.password }}" password: "{{ item.password }}"
uid: "{{ item.uid }}" uid: "{{ item.uid }}"
shell: /bin/zsh 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

View File

@ -4,6 +4,9 @@ users:
- { username: 'lafrite', password: '$6$OnPrZgotbSWZlh0T$VSyF8lUhD/N881d1GsggE7jDFt0uAzls2r.pqgDV6XQKbTqZWfv0X4QWd/3wivUDyzaSjP4LQWVfne7KYR6Vv1', uid: '1000'} - { username: 'lafrite', password: '$6$OnPrZgotbSWZlh0T$VSyF8lUhD/N881d1GsggE7jDFt0uAzls2r.pqgDV6XQKbTqZWfv0X4QWd/3wivUDyzaSjP4LQWVfne7KYR6Vv1', uid: '1000'}
- { username: 'waha', password: '$6$tQLlZ3lI/NDcT3.C$VCBzrpNxDgOK7b2que2/BnAYWl.zKVugZrQEPxtsq3iWcskEzQ1NvytZRXkB4GCDa/xEohxiodyCaZyFnhxby1', uid: '999'} - { username: 'waha', password: '$6$tQLlZ3lI/NDcT3.C$VCBzrpNxDgOK7b2que2/BnAYWl.zKVugZrQEPxtsq3iWcskEzQ1NvytZRXkB4GCDa/xEohxiodyCaZyFnhxby1', uid: '999'}
me:
- lafrite
deploy_users: deploy_users:
- waha - waha