Skip to content
Snippets Groups Projects
Commit 6a1ca308 authored by Benjamin Graillot's avatar Benjamin Graillot
Browse files

Merge branch 'home' into 'newinfra'

Home

See merge request !125
parents 69565b87 89192111
No related branches found
No related tags found
1 merge request!125Home
#!/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
---
- 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
{{ ansible_header | comment }}
* * * * * root /usr/bin/python3 /var/local/home/main.py
{{ 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'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment