diff --git a/lava-create-user.yml b/lava-create-user.yml new file mode 100644 index 0000000..17081dc --- /dev/null +++ b/lava-create-user.yml @@ -0,0 +1,21 @@ +- hosts: all + vars_prompt: + - name: username + prompt: "Username" + private: no + default: "root" + - name: email + prompt: "Email" + private: no + - name: password + prompt: "Password" + private: yes + tasks: + - name: Create user + shell: lava-server manage createsuperuser --username {{username}} --email {{email}} --noinput + - name: Set password + expect: + command: lava-server manage changepassword {{username}} + responses: + Password: "{{password}}" + Password (again): "{{password}}" diff --git a/lava.yml b/lava.yml index f92cd0b..fc427eb 100644 --- a/lava.yml +++ b/lava.yml @@ -22,6 +22,14 @@ args: creates: /etc/apache2/sites-enabled/lava-server.conf notify: reload apache + - name: Create root account + shell: lava-server manage createsuperuser --username root --email root@example.com --noinput + - name: Set temporary password + expect: + command: lava-server manage changepassword root + responses: + Password: root + Password (again): root handlers: - name: reload apache service: