users.yml 552 B

1234567891011121314151617181920
  1. ---
  2. - name: Ensure admin users exist
  3. user:
  4. name: "{{ item.name }}"
  5. uid: "{{ item.uid }}"
  6. groups: adm,sudo,systemd-journal
  7. shell: /bin/bash
  8. with_items: "{{ users }}"
  9. - name: Ensure users ssh keys exist
  10. authorized_key:
  11. user: "{{ item.name }}"
  12. key: "{{ item.authorized | default([]) | join('\n') }}"
  13. with_items: "{{ users }}"
  14. - name: Ensure deprecated ssh keys are removed
  15. authorized_key:
  16. state: absent
  17. user: "{{ item.name }}"
  18. key: "{{ item.invalid | default([]) | join('\n') }}"
  19. with_items: "{{ users }}"