Hi,

Is there a way to do something like :

$computers_dbm="'computer1','computer2'"

$computers_worklflow="'computer4','computer3'"
  
node $computers_dbm {
  include dbm_installation
}

node $computers_worklflow {
  include dbm_worklflow
}

The point is not the include, but the fact to use a variable to define a nodes 
list.
I tried several solution but I did not find a good one.

Thanks in advance for any helps.

Cordialement,

Bernard Granier
CE Plateforme Système
bernard.gran...@morpho.com
01 58 11 32 51


-----Original Message-----
From: puppet-users@googlegroups.com [mailto:puppet-users@googlegroups.com] On 
Behalf Of Xesc Arbona
Sent: Wednesday, January 16, 2013 6:11 PM
To: puppet-users@googlegroups.com
Subject: [Puppet Users] Broken pipe on generate function

Hi,

I'm trying to generate passwords for user accounts using the generate function 
and calling a local script on the server, but that fails with an error about 
Broken pipe :

notice: 
/Stage[main]/Accounts::Virtual/Accounts::Add_user[xesc]/Notify[DM1HjM9a-VIx/usr/bin/tr:
write error: Broken pipe
/usr/bin/tr: write error
/bin/cat: write error: Broken pipe
]/message: defined 'message' as 'DM1HjM9a-VIx/usr/bin/tr: write error:
Broken pipe
/usr/bin/tr: write error
/bin/cat: write error: Broken pipe
'
notice: dAfux7Bb3YRz/usr/bin/tr: write error: Broken pipe
/usr/bin/tr: write error
/bin/cat: write error: Broken pipe

Code I'm using is:

  # generate random password and send to user if necessary
  if $generate_password {
    $password = generate("/opt/ict/bash/generate_password.sh", '12')
    $encrypted_password =
generate("/opt/ict/bash/encrypt_password.sh", "$password")

    notify { $password: }

    exec { "setpass $username":
      path         => "/sbin:/usr/sbin:/bin/:/usr/bin",
      command      => "usermod -p '$encrypted_password' $username",
      refreshonly  => true,
      subscribe    => User[$username],
      unless       => "cat /etc/shadow | grep $username| cut -f 2 -d :
| grep -v '!'",
    }

script /opt/ict/bash/generate_password.sh
PWDLEN=12
/bin/cat /dev/urandom |/usr/bin/tr -dc _A-Z-a-z-0-9 | /usr/bin/head 
-c${1:-$PWDLEN};

Any idea how the generate function works internally in Puppet? Can I use pipes 
in the scripts?

Thanks!

Kind regards,
Xesc

--
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to