Feat: account creation!

This commit is contained in:
2020-09-23 23:04:15 +02:00
parent d8b0c86d3d
commit 67626a455b
6 changed files with 33 additions and 4 deletions

View File

@@ -1 +1,24 @@
---
- name: add users
user:
name: "{{ item.name }}"
create_home: true
password: "{{ lookup('password', './pass/' + item.name + '_pass length=10 chars=ascii_letters') | password_hash('sha512') }}"
update_password: on_create
with_items: "{{ users }}"
register: returned
- name: create public_html
file:
path: "/home/{{ item.name}}/public_html/"
owner: "{{ item.name }}"
group: www-data
state: directory
with_items: "{{ users }}"
- name: Sets Up Index page
template:
src: "files/index.html.j2"
dest: "/home/{{ item.name }}/public_html/index.html"
mode: 774
with_items: "{{ users }}"

View File

@@ -68,7 +68,8 @@
src: "files/index.html.j2"
dest: "/var/www/{{ http_host }}/index.html"
vars:
name: "la SNT"
item:
name: "la SNT"
- name: Enable userdir
shell: /usr/sbin/a2enmod userdir