diff options
author | Quentin <quentin@deuxfleurs.fr> | 2020-09-13 12:03:07 +0200 |
---|---|---|
committer | Quentin <quentin@deuxfleurs.fr> | 2020-09-13 12:03:07 +0200 |
commit | 484c3fe667cd8c5a647256cb78f05c8a39b835b1 (patch) | |
tree | 7be3c868ce1d0e0c96125a4c94cadce429be9e1d /ansible/roles/users/tasks/main.yml | |
parent | 0550647b9348d1e36431400e0832b4340564c658 (diff) | |
parent | d5bfc38fe826aa12f46de64790195cc8e76756de (diff) | |
download | infrastructure-484c3fe667cd8c5a647256cb78f05c8a39b835b1.tar.gz infrastructure-484c3fe667cd8c5a647256cb78f05c8a39b835b1.zip |
Merge branch 'feature/rebase'
Diffstat (limited to 'ansible/roles/users/tasks/main.yml')
-rw-r--r-- | ansible/roles/users/tasks/main.yml | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/ansible/roles/users/tasks/main.yml b/ansible/roles/users/tasks/main.yml deleted file mode 100644 index 990a041..0000000 --- a/ansible/roles/users/tasks/main.yml +++ /dev/null @@ -1,39 +0,0 @@ -- name: Add users in the system - user: - name: "{{ item.username }}" - #groups: docker - shell: "{{ item.shell | default('/bin/bash') }}" - append: no - loop: "{{ active_users - | selectattr('is_admin', 'defined') - | rejectattr('is_admin') - | list - | union( active_users - | selectattr('is_admin', 'undefined') - | list )}}" - -- name: Set admin rights - user: - name: "{{ item.username }}" - groups: docker, sudo - shell: "{{ item.shell | default('/bin/bash') }}" - append: no - loop: "{{ active_users - | selectattr('is_admin', 'defined') - | selectattr('is_admin') - | list }}" - -# [V How SSH Key works] magic is done by subelements, understand the trick at: -# https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#subelements-filter -- name: Add SSH keys - authorized_key: - user: "{{ item.0.username }}" - state: present - key: "{{ lookup('file', item.1) }}" - loop: "{{ active_users | subelements('ssh_keys', skip_missing=True) }}" - -- name: Disable old users - user: - name: "{{ item }}" - state: absent - loop: "{{ disabled_users }}" |