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.

29 line
683B

  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:
  13. - root_ssh_key
  14. - not root_target_directory is defined
  15. - name: root user ssh directory
  16. file:
  17. path: "{{ root_target_directory | default('') }}/root/.ssh"
  18. state: directory
  19. when: root_ssh_authorized_keys is defined
  20. - name: root user ssh authorized keys
  21. template:
  22. src: root_user_ssh_authorized_keys.j2
  23. dest: "{{ root_target_directory | default('') }}/root/.ssh/authorized_keys"
  24. when: root_ssh_authorized_keys is defined