You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

28 lines
576B

  1. ---
  2. - name: root user password
  3. user:
  4. name: root
  5. password: "{{ root_password }}"
  6. when: root_password is defined
  7. - name: root user ssh key
  8. user:
  9. name: root
  10. generate_ssh_key: yes
  11. ssh_key_type: ed25519
  12. when: root_ssh_key
  13. - name: root user ssh directory
  14. file:
  15. path: /root/.ssh
  16. state: directory
  17. mode: 0700
  18. when: root_ssh_authorized_keys is defined
  19. - name: root user ssh authorized keys
  20. copy:
  21. content: "{{ root_ssh_authorized_keys | join('\n') }}"
  22. dest: /root/.ssh/authorized_keys
  23. when: root_ssh_authorized_keys is defined