What you are looking for is a define resource instead of a class.
define sudoers::config {
file { "/path/to/sudoers.d/${name}:
source => "puppet:///modules/sudoers/sudoers.d/${name}",
}
}
The require File[/etc/sudoers.d] should not be necessary, since it's
an implied dependency (puppet knows it's a file under that directory,
and you can find all implied dependency using --graph). You can use
the define like it's any standard resource:
sudoers::config { "group1": }
sudoers::config { "group2": }
...
Thanks,
Nan
Defines result in a custom resource type, and the sytax is the same as
any other puppet resource:
type { 'title':
attribute => value,
}
In your example above simply:
node abc {
sudoers::config { "group1":
}
}
Thanks,
Nan