You need to specify all attributes of the resource type usage as parameters at
the define:
accounts::virtual { ‘mysql’:
uid => ‘…’,
shell => ‘…'
home => ‘…’,
realname => ‘…’,
pass => ‘…’,
}
define accounts::virtual (
$uid,
$shell => ‘…’,
$home => ‘…’,
$realname => ‘…’,
$pass => ‘…',
){
…
}
Parameters within the define will be attributes on define declaration.
Best,
Martin
On 23 Jan 2016, at 19:15, Lowe Schmidt <[email protected]> wrote:
> you probably need to lift up the parameters to the define.
>
> something like
>
> ´´´´
> define accounts::virtual ($uid, $realname, $pass, $shell='/bin/bash') {... }
> ´´´´
>
> It's been awhile since I did program in puppet, but that should be a start.
>
>
> --
> Lowe Schmidt | +46 723 867 157
>
> On 23 January 2016 at 18:22, Tim Dunphy <[email protected]> wrote:
> Hey guys,
>
> I've got a puppet module that creates user accounts on linux machines.
>
> I'm trying to override a couple settings in my config for the user's shell
> and home directory. And I'm getting this error:
>
> Error: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Invalid parameter shell on Accounts::Virtual[mysql] at
> /etc/puppet/environments/production/modules/accounts/manifests/init.pp:70 on
> node solr1.jokefire.com
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
> I have the user virtual account definitions setup this way in the account
> module's init.pp:
>
>
> @accounts::virtual { 'mysql':
> uid => 1007,
> shell => '/bin/false',
> home => '/var/lib/mysql',
> realname => 'mysql',
> pass => 'secret_hash',
> }
>
> And this is how the virtual account definitions are setup:
>
> # Defined type for creating virtual user accounts
> #
> define accounts::virtual ($uid,$realname,$pass) {
>
> user { $title:
> ensure => 'present',
> uid => $uid,
> gid => $title,
> shell => '/bin/bash',
> home => "/home/${title}",
> comment => $realname,
> password => $pass,
> managehome => true,
> require => Group[$title]
> }
>
> group { $title:
> gid => $uid,
> }
>
> file { "/home/${title}":
> ensure => directory,
> owner => $title,
> group => $title,
> mode => 0750,
> require => [ User[$title], Group[$title] ]
> }
> }
>
> Where am I going wrong? Why can't I override these values?
>
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAOZy0ekGSusExu6fP03HA-%2BY2iPmCaMgv%2B7%3Dkr6V%2BCBOHS%3DH9Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAC-wWcSzshwerCyVLSJMYP3_kS%2BxftCjRkERc-mwd0O2JEiwZg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/66AC8A2A-5139-43FD-9741-7527E3E63A25%40gmail.com.
For more options, visit https://groups.google.com/d/optout.