Merge remote-tracking branch 'origin/master' into master
This commit is contained in:
commit
211b7d5725
@ -1 +1 @@
|
||||
<h1> Serveur pédagogique pour {{ name }} </h1>
|
||||
<h1> Serveur pédagogique pour {{ item.name }} </h1>
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
- hosts: 127.0.0.1
|
||||
connection: local
|
||||
- hosts: all
|
||||
#ask_pass: true
|
||||
become: true
|
||||
vars_files:
|
||||
- vars/default.yml
|
||||
|
@ -1 +1,42 @@
|
||||
---
|
||||
- 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 }}"
|
||||
|
||||
- name: create database
|
||||
mysql_db:
|
||||
db: "{{ item.name }}"
|
||||
state: present
|
||||
login_user: root
|
||||
login_password: "{{ mysql_root_password }}"
|
||||
with_items: "{{ users }}"
|
||||
|
||||
- name: create db user
|
||||
mysql_user:
|
||||
user: "{{ item.name }}"
|
||||
password: "{{ lookup('password', './pass/' + item.name + '_sql length=10 chars=ascii_letters') | password_hash('sha512') }}"
|
||||
priv: "{{ item.name + '.*:ALL,GRANT' }}"
|
||||
login_user: root
|
||||
login_password: "{{ mysql_root_password }}"
|
||||
state: present
|
||||
with_items: "{{ users }}"
|
||||
|
@ -66,8 +66,9 @@
|
||||
- name: Sets Up Index page
|
||||
template:
|
||||
src: "files/index.html.j2"
|
||||
dest: "/var/www/{{ http_host }}/info.php"
|
||||
dest: "/var/www/{{ http_host }}/index.html"
|
||||
vars:
|
||||
item:
|
||||
name: "la SNT"
|
||||
|
||||
- name: Enable userdir
|
||||
|
@ -1,14 +1,20 @@
|
||||
---
|
||||
tribes:
|
||||
- "2GT1G1"
|
||||
- "2GT1G2"
|
||||
- "2GT2G1"
|
||||
- "2GT2G2"
|
||||
- "2GT3G1"
|
||||
- "2GT3G2"
|
||||
- "2GT4G1"
|
||||
- "2GT4G2"
|
||||
- "2GT5G1"
|
||||
- "2GT5G2"
|
||||
- "2GT6G1"
|
||||
- "2GT6G2"
|
||||
#tribes:
|
||||
# - "2GT1G1"
|
||||
# - "2GT1G2"
|
||||
# - "2GT2G1"
|
||||
# - "2GT2G2"
|
||||
# - "2GT3G1"
|
||||
# - "2GT3G2"
|
||||
# - "2GT4G1"
|
||||
# - "2GT4G2"
|
||||
# - "2GT5G1"
|
||||
# - "2GT5G2"
|
||||
# - "2GT6G1"
|
||||
# - "2GT6G2"
|
||||
#profs:
|
||||
# - "proftest"
|
||||
#users: tribes + profs
|
||||
users:
|
||||
- name: test1
|
||||
- name: test2
|
||||
|
Loading…
Reference in New Issue
Block a user