From c48b1d565c4bb07d9fcb9dad4e249a3a235d4e8e Mon Sep 17 00:00:00 2001
From: Benjamin Graillot <graillot@crans.org>
Date: Sun, 27 Dec 2020 10:24:41 +0100
Subject: [PATCH] [home] add playbook to deploy home creation script

---
 plays/home.yml                         | 11 +++++++++++
 roles/home/templates/home/config.py.j2 |  6 +++---
 2 files changed, 14 insertions(+), 3 deletions(-)
 create mode 100755 plays/home.yml

diff --git a/plays/home.yml b/plays/home.yml
new file mode 100755
index 00000000..aa47fa4c
--- /dev/null
+++ b/plays/home.yml
@@ -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
diff --git a/roles/home/templates/home/config.py.j2 b/roles/home/templates/home/config.py.j2
index 457b0293..e7f29b91 100644
--- a/roles/home/templates/home/config.py.j2
+++ b/roles/home/templates/home/config.py.j2
@@ -1,9 +1,9 @@
 {{ ansible_header | comment }}
 
-ldap_server = 'ldap://re2o-ldap.adm.crans.org'
-binddn = 'cn=home,ou=service-users,dc=crans,dc=org'
+ldap_server = '{{ home.ldap_server }}'
+binddn = '{{ home.binddn }}'
 password = '{{ home.ldap_password }}'
-rootdn = 'cn=Utilisateurs,dc=crans,dc=org'
+rootdn = '{{ home.rootdn }}'
 home_dir = '/pool/home'
 mail_dir = '/pool/mail'
 home_quota = 'zfs set userquota@{user}=30G pool/home'
-- 
GitLab