initial_users.yml 1.1 KB

123456789101112131415161718192021222324
  1. ---
  2. # Intended to be called on a fresh box, just to set up my users
  3. - name: Add the fdamstra account
  4. hosts: all
  5. become: yes
  6. become_user: root
  7. tasks:
  8. - name: Create fdamstra user
  9. ansible.builtin.user:
  10. name: fdamstra
  11. state: present
  12. comment: Fred Damstra
  13. shell: /bin/bash
  14. append: yes # add groups, not replace
  15. groups:
  16. - sudo
  17. home: /home/fdamstra
  18. password: $6$hYFN1pnIw3Gi8Lca$HdoHUUVVPbBdp/HGeBdo2rpWjhvBYcpV2EbCkZqW0Sqp1nsxQmuAy6sy6wjLHv1EdODG8oNUBPys94bxOOwbp/
  19. update_password: on_create
  20. - name: Create authorized key
  21. authorized_key:
  22. user: fdamstra
  23. state: present
  24. key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDF3pGU9+HufgfEhPP7P0Lt7kqfGWLTGd6sfJgSypcSo3FP1XhwFOWkaNvZIpoIeQXhux5vTm+RoqYZ/3Gj7hcGMLdoHWArvLHD2AGjxbFnsmiCioQgsC/rYLBjiWNsDdVF5Arofby/RwzivMAi7yivhY4nGzXPsHZoucB0Wi34/9AmxbvXWv6ckuWkMjrXVe+uwFje3U7jQHRW9jQRpCRRfUjVA4FmH0PWqWFBlt/zqsDPOzbxNNhAvyrJho7jVBNjCLsq0++lT8BDKrYbaZiT0F2c9uIDRpHJSdjpqVCf9bghmeJWYMoNHAkGR7WCFjPCJ7QM57a2oRBtm1A/EWcr fdamstra@io"