diff --git a/playbooks/bootstrap/roles/users/defaults/main.yaml b/playbooks/bootstrap/roles/users/defaults/main.yaml index 8c2b09c..7463726 100644 --- a/playbooks/bootstrap/roles/users/defaults/main.yaml +++ b/playbooks/bootstrap/roles/users/defaults/main.yaml @@ -12,4 +12,5 @@ # License for the specific language governing permissions and limitations # under the License. --- +windmill_root_users: [] windmill_users: {} diff --git a/playbooks/bootstrap/roles/users/tasks/main.yaml b/playbooks/bootstrap/roles/users/tasks/main.yaml index b918c14..aaa5570 100644 --- a/playbooks/bootstrap/roles/users/tasks/main.yaml +++ b/playbooks/bootstrap/roles/users/tasks/main.yaml @@ -15,29 +15,29 @@ - name: Create windmill_users group become: true group: - name: "{{ item.name }}" - gid: "{{ item.gid }}" + name: "{{ item }}" + gid: "{{ windmill_users[item].gid }}" state: present - with_items: "{{ windmill_users }}" + with_items: "{{ windmill_root_users }}" - name: Create windmill_users user become: true user: - name: "{{ item.name }}" - group: "{{ item.gid }}" + name: "{{ item }}" + group: "{{ windmill_users[item].gid }}" groups: sudo shell: /bin/bash - uid: "{{ item.uid }}" - with_items: "{{ windmill_users }}" + uid: "{{ windmill_users[item].uid }}" + with_items: "{{ windmill_root_users }}" - name: Add SSH public key become: true authorized_key: exclusive: true - key: "{{ item.key }}" + key: "{{ windmill_users[item].key }}" state: present - user: "{{ item.name }}" - with_items: "{{ windmill_users }}" + user: "{{ item }}" + with_items: "{{ windmill_root_users }}" - name: Disable password for sudo users become: true