lava-create-user.yml 534 B

123456789101112131415161718192021
  1. - hosts: all
  2. vars_prompt:
  3. - name: username
  4. prompt: "Username"
  5. private: no
  6. default: "root"
  7. - name: email
  8. prompt: "Email"
  9. private: no
  10. - name: password
  11. prompt: "Password"
  12. private: yes
  13. tasks:
  14. - name: Create user
  15. shell: lava-server manage createsuperuser --username {{username}} --email {{email}} --noinput
  16. - name: Set password
  17. expect:
  18. command: lava-server manage changepassword {{username}}
  19. responses:
  20. Password: "{{password}}"
  21. Password (again): "{{password}}"