commit
6a1ca30834
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env ansible-playbook
|
||||
---
|
||||
- hosts: cameron.adm.crans.org
|
||||
vars:
|
||||
home:
|
||||
ldap_server: ldap://re2o-ldap.adm.crans.org
|
||||
ldap_password: "{{ vault_ldap_home_password }}"
|
||||
binddn: cn=home,ou=service-users,dc=crans,dc=org
|
||||
rootdn: cn=Utilisateurs,dc=crans,dc=org
|
||||
roles:
|
||||
- home
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
- name: Install home dependencies
|
||||
apt:
|
||||
update_cache: true
|
||||
install_recommends: false
|
||||
name:
|
||||
- python3-ldap
|
||||
register: apt_result
|
||||
retries: 3
|
||||
until: apt_result is succeeded
|
||||
|
||||
- name: Create home directory
|
||||
file:
|
||||
path: /var/local/home
|
||||
state: directory
|
||||
mode: '2775'
|
||||
owner: root
|
||||
group: nounou
|
||||
|
||||
- name: Set ACL for home directory
|
||||
acl:
|
||||
path: /var/local/home
|
||||
default: true
|
||||
entity: nounou
|
||||
etype: group
|
||||
permissions: rwx
|
||||
state: query
|
||||
|
||||
- name: Clone home repository
|
||||
git:
|
||||
repo: 'http://gitlab.adm.crans.org/nounous/home.git'
|
||||
dest: /var/local/home
|
||||
umask: '002'
|
||||
|
||||
- name: Deploy home config
|
||||
template:
|
||||
src: home/config.py.j2
|
||||
dest: /var/local/home/config.py
|
||||
mode: 0600
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Deploy cron for home
|
||||
template:
|
||||
src: cron.d/home.j2
|
||||
dest: /etc/cron.d/home
|
|
@ -0,0 +1,2 @@
|
|||
{{ ansible_header | comment }}
|
||||
* * * * * root /usr/bin/python3 /var/local/home/main.py
|
|
@ -0,0 +1,10 @@
|
|||
{{ ansible_header | comment }}
|
||||
|
||||
ldap_server = '{{ home.ldap_server }}'
|
||||
binddn = '{{ home.binddn }}'
|
||||
password = '{{ home.ldap_password }}'
|
||||
rootdn = '{{ home.rootdn }}'
|
||||
home_dir = '/pool/home'
|
||||
mail_dir = '/pool/mail'
|
||||
home_quota = 'zfs set userquota@{user}=30G pool/home'
|
||||
mail_quota = 'zfs set userquota@{user}=10G pool/mail'
|
Loading…
Reference in New Issue