Creating a default user account during setup. Also a playbook for creating new users.
This commit is contained in:
parent
d8105a9fe5
commit
fb20560801
21
lava-create-user.yml
Normal file
21
lava-create-user.yml
Normal 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}}"
|
8
lava.yml
8
lava.yml
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user