Hi,

I have a problem with running puppet with hiera based data. I am trying to 
cleanup
user accounts on a range of servers (to have the same uid/gid). When I 
create existing account
but with different uid/gid it doesn't change files group ownership so I 
need to
run a script which cleanups after cleanup ;-)

I use the following code:
---
:backends:
  - yaml

:hierarchy:
  - nodes/%{clientcert}
  - virtual/%{virtual}
  - common

:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /var/lib/hiera on *nix
# - %CommonAppData%\PuppetLabs\hiera\var on Windows
# When specifying a datadir, make sure the directory exists.
  #:datadir: /etc/puppet/hieradata
  :datadir: /etc/puppet/environments/%{environment}/hieradata
:merge_behavior: deeper

/etc/puppet/environments/env1/manifests/site.pp
node default {
        hiera_include ( "classes", [] )
}

/etc/puppet/environments/env1/hieradata/common.yaml
classes:
  - accounts

/etc/puppet/environments/env1/modules/accounts/manifests/init.pp
class accounts::users (
        $accounts,
        $groups,
)
{
        create_resources(group, $groups)
        create_resources(user, $accounts, { notify => 
Exec['clean_up_accounts'] })
}

class accounts::cleanup
{
        exec { "clean_up_accounts":
                command => "/script/to/cleanup",
                refreshonly => true,
        }
}

class accounts {
        include accounts::users, accounts::cleanup
}

Is it possible to run this script ("/script/to/cleanup") for each created 
user (so the script doesn't have to cope with whole /home
tree structure) with its home (taken from puppet/hiera) as a parameter ? 
How can I pass puppet/hiera parameters to external script ?
Or maybe there is another, more puppet-native way to do that ?


-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to