aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-10-19 16:12:50 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-10-19 16:12:50 +0200
commitb3ac23bb9960207194de901275f33a72b0779690 (patch)
treefdf055e37a86a4987885cef8e74f86ec4187a9bf /modules
parentf7ef7ce7f8d596d38739c5e96623e8630e1036ae (diff)
downloadPuppet-b3ac23bb9960207194de901275f33a72b0779690.tar.gz
Puppet-b3ac23bb9960207194de901275f33a72b0779690.tar.zst
Puppet-b3ac23bb9960207194de901275f33a72b0779690.zip
Add ldap ssha script
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/base_installation/files/scripts/ldap_ssha13
-rw-r--r--modules/role/manifests/caldance.pp11
2 files changed, 24 insertions, 0 deletions
diff --git a/modules/base_installation/files/scripts/ldap_ssha b/modules/base_installation/files/scripts/ldap_ssha
new file mode 100755
index 0000000..cdbea1b
--- /dev/null
+++ b/modules/base_installation/files/scripts/ldap_ssha
@@ -0,0 +1,13 @@
1#! /usr/bin/perl
2use strict;
3use Digest::SHA qw(sha1);
4use MIME::Base64;
5
6print 'Password: ';
7system ( "stty -echo");
8my $secret = <STDIN>;
9chomp $secret;
10my $salt;
11$salt .= ('.','/',0..9,'A'..'Z','a'..'z')[rand 64] foreach(1..8);
12
13print "\nHashed string for LDAP:\nuserPassword: {SSHA}" . encode_base64(sha1($secret . $salt) . $salt, '') . "\n";
diff --git a/modules/role/manifests/caldance.pp b/modules/role/manifests/caldance.pp
index b7948e6..63dda1f 100644
--- a/modules/role/manifests/caldance.pp
+++ b/modules/role/manifests/caldance.pp
@@ -9,4 +9,15 @@ class role::caldance (
9 include "profile::monitoring" 9 include "profile::monitoring"
10 10
11 ensure_packages(["python-pip", "python-virtualenv", "python-django"]) 11 ensure_packages(["python-pip", "python-virtualenv", "python-django"])
12
13 # pour le script de génération de mdp
14 ensure_packages(["perl-digest-sha1"])
15
16 file { "/usr/local/bin/ldap_ssha":
17 owner => "root",
18 group => "root",
19 mode => "0755",
20 source => "puppet:///modules/base_installation/scripts/ldap_ssha",
21 require => Package["perl-digest-sha1"],
22 }
12} 23}