Does anyone have some examples of using this create_resources function, https://github.com/puppetlabs/puppetlabs-create_resources, ? Based on the README example I can't figure out exactly how to change from using defines to using this function. Maybe I misunderstand the purpose of create_resources...is it to replace defines, or is it to allow ENCs (for example) to use a define?
Below is an example of a define I use for apache virtual hosts. From the example on the functions readme, does "class webserver::instances" use the information in $instances? So if I wanted to create files / directories from the information in $instances, would that be done in "class webserver::instances" or else where? Here's the example... node 'webserver' { apache::vhost { 'drupal-multisite1': domain => 'com', docroot => '/var/www/example2.com/html', options => 'None', override => 'All', protocol => 'http'; 'drupal-multisite2': domain => 'com', docroot => '/var/www/example2.com/html', create_docroot => false, options => 'None', override => 'All', protocol => 'http'; } } .... define apache::vhost ( $protocol='http', $cname=$name, $domain=false, $server_alias="www.$cname.$domain", $alias_list=false, $docroot=false, $create_docroot=true, $docroot_owner=false, $docroot_group=false, $docroot_mode=false, $options=false, $sendfile=true, $override='None', $order='allow,deny', $allowfrom='all', $denyfrom=false, $source=false ) { host{ "${name}.$domain": ensure => present, host_aliases => [ $name ], ip => $ipaddress_eth0, } if $create_docroot != false { file { "$docroot": ensure => directory, owner => $docroot_owner ? { false => undef, default => $docroot_owner, }, group => $docroot_group ? { false => undef, default => $docroot_group, }, mode => $docroot_mode ? { false => undef, default => $docroot_mode, }, require => Package['httpd']; } } file { "/etc/httpd/conf.d/$cname.conf": ensure => present, owner => 'root', group => 'root', mode => 644, content => $source ? { false => template('apache/ virtualhost_conf.erb'), default => $source, }, require => Package['httpd'], notify => Exec['reload-apache'], } } Thanks - Trey -- 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.