diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-10-19 16:12:50 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-10-19 16:12:50 +0200 |
commit | b3ac23bb9960207194de901275f33a72b0779690 (patch) | |
tree | fdf055e37a86a4987885cef8e74f86ec4187a9bf /modules | |
parent | f7ef7ce7f8d596d38739c5e96623e8630e1036ae (diff) | |
download | Puppet-b3ac23bb9960207194de901275f33a72b0779690.tar.gz Puppet-b3ac23bb9960207194de901275f33a72b0779690.tar.zst Puppet-b3ac23bb9960207194de901275f33a72b0779690.zip |
Add ldap ssha script
Diffstat (limited to 'modules')
-rwxr-xr-x | modules/base_installation/files/scripts/ldap_ssha | 13 | ||||
-rw-r--r-- | modules/role/manifests/caldance.pp | 11 |
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 | ||
2 | use strict; | ||
3 | use Digest::SHA qw(sha1); | ||
4 | use MIME::Base64; | ||
5 | |||
6 | print 'Password: '; | ||
7 | system ( "stty -echo"); | ||
8 | my $secret = <STDIN>; | ||
9 | chomp $secret; | ||
10 | my $salt; | ||
11 | $salt .= ('.','/',0..9,'A'..'Z','a'..'z')[rand 64] foreach(1..8); | ||
12 | |||
13 | print "\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 | } |