FAQ
I've been trying to get a puppet-master config together to push selected
user accounts to puppet clients, but I've not been able to figure out how
to pull their password and other data out of the password database on the
server side to replicate to the clients. In short I want to do something
like:


user { $username:
...
password => "ypmatch $username passwd | cut -f 2 -d :",
...
}

but that runs the "ypmatch" on the client, which isn't useful. Then I
found the "generate" function, but apparently "generate" can be called with
only one argument (spaces are excluded from the characters "generate" will
take). I tried:

user { $username:
...
password => generate("/path/getuserpasswd.sh $username"),
...
}

but that gets an error due to the space (getuserpaswd.sh is just a shell
script that does the ypmatch expecting $1 to be the username).

So in short, is there any way to do this? Using shell-like syntax I want:

user { $username:
...
password => `ypmatch $username passwd | cut -f 2 -d :`,
...
}


Any help would be most appreciated.

-Jeff

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

Search Discussions

  • Jakov Sosic at Jan 19, 2013 at 12:54 pm

    On 01/18/2013 08:33 PM, Jeff Thomas wrote:
    but that runs the "ypmatch" on the client, which isn't useful. Then I
    found the "generate" function, but apparently "generate" can be called
    with only one argument (spaces are excluded from the characters
    "generate" will take). I tried:

    user { $username:
    ...
    password => generate("/path/getuserpasswd.sh $username"),
    ...
    }

    but that gets an error due to the space (getuserpaswd.sh is just a shell
    script that does the ypmatch expecting $1 to be the username).
    Have you tried:

    password => generate('/path/getuserpasswd.sh', $username),



    --
    Jakov Sosic
    www.srce.unizg.hr

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Jeff Thomas at Jan 21, 2013 at 4:04 pm
    Well, I thought I had, but apparently not. Yes that works, thanks.

    -Jeff



    On Saturday, January 19, 2013 4:54:21 AM UTC-8, Jakov Sosic wrote:
    On 01/18/2013 08:33 PM, Jeff Thomas wrote:
    but that runs the "ypmatch" on the client, which isn't useful. Then I
    found the "generate" function, but apparently "generate" can be called
    with only one argument (spaces are excluded from the characters
    "generate" will take). I tried:

    user { $username:
    ...
    password => generate("/path/getuserpasswd.sh $username"),
    ...
    }

    but that gets an error due to the space (getuserpaswd.sh is just a shell
    script that does the ypmatch expecting $1 to be the username).
    Have you tried:

    password => generate('/path/getuserpasswd.sh', $username),



    --
    Jakov Sosic
    www.srce.unizg.hr
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/q9OS_R1Q0bkJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJan 18, '13 at 7:49p
activeJan 21, '13 at 4:04p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Jeff Thomas: 2 posts Jakov Sosic: 1 post

People

Translate

site design / logo © 2022 Grokbase