Compare commits

...

2 Commits

Author SHA1 Message Date
67626a455b Feat: account creation! 2020-09-23 23:04:15 +02:00
d8b0c86d3d Fix: good dest for root_index 2020-09-23 22:38:15 +02:00
6 changed files with 34 additions and 5 deletions

View File

@ -1 +1 @@
<h1> Serveur pédagogique pour {{ name }} </h1> <h1> Serveur pédagogique pour {{ item.name }} </h1>

2
hosts Normal file
View File

@ -0,0 +1,2 @@
[all]
stex.ovh ansible_port=25022 ansible_user=root

View File

@ -1,6 +1,6 @@
--- ---
- hosts: 127.0.0.1 - hosts: all
connection: local #ask_pass: true
become: true become: true
vars_files: vars_files:
- vars/default.yml - vars/default.yml

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

@ -66,9 +66,10 @@
- name: Sets Up Index page - name: Sets Up Index page
template: template:
src: "files/index.html.j2" src: "files/index.html.j2"
dest: "/var/www/{{ http_host }}/info.php" dest: "/var/www/{{ http_host }}/index.html"
vars: vars:
name: "la SNT" item:
name: "la SNT"
- name: Enable userdir - name: Enable userdir
shell: /usr/sbin/a2enmod userdir shell: /usr/sbin/a2enmod userdir

View File

@ -1 +1,4 @@
--- ---
users:
- name: test1
- name: test2