Creating a default user account during setup. Also a playbook for creating new users.

This commit is contained in:
Madis Martin Lutter 2018-06-03 21:54:14 +03:00
parent d8105a9fe5
commit fb20560801
2 changed files with 29 additions and 0 deletions

21
lava-create-user.yml Normal file
View File

@ -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}}"

View File

@ -22,6 +22,14 @@
args: args:
creates: /etc/apache2/sites-enabled/lava-server.conf creates: /etc/apache2/sites-enabled/lava-server.conf
notify: reload apache 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: handlers:
- name: reload apache - name: reload apache
service: service: