Ah that did the trick...now a new error. I tried simplifying the module from camptocamp, https://github.com/camptocamp/puppet-dhcp, but a lot of it's usage I don't understand, and as such my "simplification" just broke it. I've got it much farther now...near the end of puppet run I get this error...
err: Could not run Puppet configuration client: Parameter source failed: Could not understand source false: private method `gsub' called for false:FalseClass at /etc/puppet/modules/common/manifests/ definitions/concatfilepart.pp:51 This is the first time to use the puppet-common, https://github.com/camptocamp/puppet-common, module and that seems to be what's generating the error. Below is the updated config and debug output...The node I'm testing on has "include fog_server" === manifests/init.pp === import "classes/*.pp" import "definitions/*.pp" class dhcp { include dhcp::server } === manifests/classes/server.pp === class dhcp::server { include dhcp::params package {"dhcp": ensure => present, } service {"dhcpd": ensure => running, enable => true, require => Package["dhcp"], } file {"${dhcp::params::dhcp_config_dir}/subnets": ensure => directory, source => 'puppet:///dhcp/empty', recurse => true, purge => true, owner => 'root', group => 'root', mode => '755', notify => Service['dhcpd'], require => Package['dhcp'], } common::concatfilepart {"00.dhcp.server.base": file => "${dhcp::params::dhcp_config_dir}/dhcpd.conf", ensure => present, require => Package["dhcp"], notify => Service["dhcpd"], } file {"/etc/dhcpd.conf": content => template("dhcp/dhcpd_conf.erb"), ensure => present, require => Package["dhcp"], notify => Service["dhcpd"], } } === manifests/classes/params.pp === /* = Class: dhcp::params Do NOT include this class - it won't do anything. Set variables for names and paths */ class dhcp::params { case $operatingsystem { CentOS: { $dhcp_config_dir = $operatingsystemrelease? { 5.6 => "/etc/dhcp", } } } } === manifests/definitions/subnet.pp === define dhcp::subnet ( $name=false, $netmask=false, $range_start=false, $range_end=false, $router=false, $domain_name=false, $dns_servers=false, $pxe_opts=false) { include dhcp::params common::concatfilepart {"dhcp.${name}": file => "${dhcp::params::dhcp_config_dir}/dhcpd.conf", ensure => $ensure, content => "include \"${dhcp::params::dhcp_config_dir}/subnets/ ${name}.conf\";\n", } file {"${dhcp::params::dhcp_config_dir}/subnets/${name}.conf": ensure => present, owner => 'root', group => 'root', content => template("dhcp/subnet_conf.erb"), notify => Service["dhcpd"], } } === manifests/roles.pp === class role_dhcp_server { $my_role = "dhcp_server" $dhcpd_domain_name = "tamu.edu" $dhcpd_dns_servers = "0.0.0.0, 0.0.0.0" $dhcpd_authoritative = true $dhcpd_ddns_update = "interim" $dhcpd_opts = [ 'allow booting', 'allow bootp', 'use-host-decl- names on', 'ignore client-updates;' ] include dhcp } class fog_server { include role_dhcp_server dhcp::subnet { "10.1.0.1": name => '10.1.0.1', netmask => '255.255.255.0', range_start => '10.1.0.10', range_end => '10.1.0.254', router => '10.1.0.1', domain_name => 'tamu.edu', dns_servers => "0.0.0.0, 0.0.0.0", pxe_opts => [ 'filename "pxelinux.0";' ], } } Thanks - Trey On Jun 7, 11:14 am, Jamison Fryman <jami...@puppetlabs.com> wrote: > Trey, > > It looks like the module is attempting to create a file resource in > /etc/subnets, versus your intended directory of $dhcp_config_dir/subnets. > Puppet is creating an error because the directory /etc/subnets does not > exist, and puppet will not automatically create the directory if it is not > managed. I'm not sure if this is your intended behavior after looking at your > code. > > Try this instead: In your custom resource block dhcp::subnet, change the file > resource from "/etc/subnets/$name.conf" to > "${dhcp_config_dir}/subnets/${name}.conf". This might be the behavior you're > looking for. > > -jamison > > -- > Jamison Fryman > jami...@puppetlabs.com > ph +1.615.669.2048 | twitter jfryman | gtalk: jami...@puppetlabs.com > > On Jun 7, 2011, at 8:40 AM, Trey Dockendorf wrote: > > > > > > > > > I'm working on a DHCP module, modeled after > > thishttps://github.com/camptocamp/puppet-dhcp. Mine is just a much simpler > > version as I don't manage multiple OSes in my environment. However I > > cannot get my subnet file to create, this is the error from debug I get > > > "err: > > /Stage[main]/Fog_server/Dhcp::Subnet[10.1.0.1]/File[/etc/subnets/10.1.0.1.c > > onf]/ensure: change from absent to present failed: Could not set 'present > > on ensure: No such file or directory - > > /etc/subnets/10.1.0.1.conf.puppettmp_5637 at > > /etc/puppet/modules/dhcp/manifests/definitions/subnet.pp:18" > > > See below for the full output and my modules. > > > Been pulling my hair out for past day over this so any help is greatly > > appreciated. > > > Thanks > > - Trey > > > == modules/dhcp/manifests/init.pp == > > import "classes/*.pp" > > import "definitions/*.pp" > > > class dhcp { > > $dhcp_config_dir = "/etc/dhcp" > > > include dhcp::server > > } > > > == modules/dhcp/manifests/classes/server.pp == > > class dhcp::server { > > > package {"dhcp": > > ensure => present, > > } > > > service {"dhcpd": > > ensure => running, > > enable => true, > > require => Package["dhcp"], > > } > > > file {"$dhcp_config_dir": > > ensure => directory, > > source => 'puppet:///dhcp/empty', > > recurse => true, > > purge => true, > > owner => 'root', > > group => 'root', > > mode => '755', > > require => Package['dhcp'], > > } > > > file {"$dhcp_config_dir/subnets": > > ensure => directory, > > source => 'puppet:///dhcp/empty', > > recurse => true, > > purge => true, > > owner => 'root', > > group => 'root', > > mode => '755', > > notify => Service['dhcpd'], > > require => File["$dhcp_config_dir"], > > } > > > file {"/etc/dhcpd.conf": > > content => template("dhcp/dhcpd_conf.erb"), > > ensure => present, > > require => Package["dhcp"], > > notify => Service["dhcpd"], > > } > > > } > > > == modules/dhcp/manifests/definitions/subnets.pp == > > define dhcp::subnet ( > > $name=false, > > $netmask=false, > > $range_start=false, > > $range_end=false, > > $router=false, > > $domain_name=false, > > $dns_servers=false, > > $pxe_opts=false) { > > > file {"/etc/subnets/$name.conf": > > ensure => present, > > owner => 'root', > > group => 'root', > > content => template("dhcp/subnet_conf.erb"), > > notify => Service["dhcpd"], > > require => File['/etc/dhcp/subnets'], > > } > > } > > > == manifests/roles.pp == > > class role_dhcp_server { > > $my_role = "dhcp_server" > > > $dhcpd_domain_name = "tamu.edu" > > $dhcpd_dns_servers = "0.0.0.0, 0.0.0.0" > > $dhcpd_authoritative = true > > $dhcpd_ddns_update = "interim" > > $dhcpd_opts = [ 'allow booting', 'allow bootp', > > 'use-host-decl-names on', 'ignore client-updates' ] > > > include dhcp > > > dhcp::subnet { "10.1.0.1": > > name => '10.1.0.1', > > netmask => '255.255.255.0', > > range_start => '10.1.0.10', > > range_end => '10.1.0.254', > > router => '10.1.0.1', > > domain_name => 'tamu.edu', > > dns_servers => "0.0.0.0, 0.0.0.0", > > pxe_opts => [ 'filename "pxelinux.0";' ], > > } > > } > > > == The error == > > > # puppetd --test --debug -vvv > > debug: Failed to load library 'ldap' for feature 'ldap' > > debug: Puppet::Type::User::ProviderLdap: feature ldap is missing > > debug: Puppet::Type::User::ProviderUser_role_add: file rolemod does not > > exist > > debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl > > does not exist > > debug: Puppet::Type::User::ProviderPw: file pw does not exist > > debug: Failed to load library 'rubygems' for feature 'rubygems' > > debug: Failed to load library 'selinux' for feature 'selinux' > > debug: Puppet::Type::File::ProviderMicrosoft_windows: feature > > microsoft_windows is missing > > debug: /File[/var/lib/puppet/clientbucket]: Autorequiring > > File[/var/lib/puppet] > > debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring > > File[/var/lib/puppet/ssl/certs] > > debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet] > > debug: /File[/etc/puppet/namespaceauth.conf]: Autorequiring > > File[/etc/puppet] > > debug: /File[/etc/puppet/puppet.conf]: Autorequiring File[/etc/puppet] > > debug: /File[/var/lib/puppet/state/last_run_summary.yaml]: Autorequiring > > File[/var/lib/puppet/state] > > debug: /File[/var/lib/puppet/state/last_run_report.yaml]: Autorequiring > > File[/var/lib/puppet/state] > > debug: /File[/var/log/puppet/http.log]: Autorequiring File[/var/log/puppet] > > debug: /File[/var/lib/puppet/client_yaml]: Autorequiring > > File[/var/lib/puppet] > > debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/ssl/public_keys/itscfognode.tamu.edu.pem]: > > Autorequiring File[/var/lib/puppet/ssl/public_keys] > > debug: /File[/var/lib/puppet/client_data]: Autorequiring > > File[/var/lib/puppet] > > debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet] > > debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet] > > debug: /File[/var/lib/puppet/ssl/private]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/state/graphs]: Autorequiring > > File[/var/lib/puppet/state] > > debug: /File[/var/lib/puppet/classes.txt]: Autorequiring > > File[/var/lib/puppet] > > debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring > > File[/var/lib/puppet/state] > > debug: /File[/var/lib/puppet/ssl/private_keys/itscfognode.tamu.edu.pem]: > > Autorequiring File[/var/lib/puppet/ssl/private_keys] > > debug: /File[/var/lib/puppet/ssl/certs/itscfognode.tamu.edu.pem]: > > Autorequiring File[/var/lib/puppet/ssl/certs] > > debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet] > > debug: Finishing transaction 23631659864180 > > debug: /File[/etc/puppet/namespaceauth.conf]: Autorequiring > > File[/etc/puppet] > > debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/ssl/public_keys/itscfognode.tamu.edu.pem]: > > Autorequiring File[/var/lib/puppet/ssl/public_keys] > > debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet] > > debug: /File[/var/lib/puppet/ssl/certs/itscfognode.tamu.edu.pem]: > > Autorequiring File[/var/lib/puppet/ssl/certs] > > debug: /File[/var/lib/puppet/ssl/private]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet] > > debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring > > File[/var/lib/puppet/ssl/certs] > > debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet] > > debug: /File[/var/log/puppet/http.log]: Autorequiring File[/var/log/puppet] > > debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring > > File[/var/lib/puppet/ssl] > > debug: /File[/var/lib/puppet/ssl/private_keys/itscfognode.tamu.edu.pem]: > > Autorequiring File[/var/lib/puppet/ssl/private_keys] > > debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet] > > debug: Finishing transaction 23631658931580 > > debug: Using cached certificate for ca > > debug: Using cached certificate for itscfognode.tamu.edu > > notice: Ignoring --listen on onetime run > > debug: Finishing transaction 23631660726540 > > debug: Loaded state in 0.00 seconds > > debug: Using cached certificate for ca > > debug: Using cached certificate for itscfognode.tamu.edu > > debug: Using cached certificate_revocation_list for ca > > debug: catalog supports formats: b64_zlib_yaml dot marshal pson raw yaml; > > using pson > > debug: Puppet::Type::Package::ProviderRpm: Executing '/bin/rpm --version' > > debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm --version' > > debug: Puppet::Type::Package::ProviderUrpmi: Executing '/bin/rpm -ql rpm' > > debug: Puppet::Type::Package::ProviderAptrpm: Executing '/bin/rpm -ql rpm' > > info: Caching catalog for itscfognode.tamu.edu > > debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist > > debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not > > exist > > debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d > > does not exist > > debug: > > ... > > read more » -- 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.