Issue #20286 has been updated by vinod kumar.
Any update on this issue? At least can any one provide alternate to read the value from client at server side if possible as facter is not working for me in this version. ---------------------------------------- Bug #20286: Custom factor value is empty https://projects.puppetlabs.com/issues/20286#change-89761 * Author: vinod kumar * Status: Unreviewed * Priority: Normal * Assignee: * Category: * Target version: * Keywords: * Branch: * Affected Facter version: ---------------------------------------- Follow the steps: 1. Created a custom factory <pre> export FACTER_TENANT="GroupA" export FACTER_FOO="bar" </pre> 2. Verified the same using <pre> root@ip-10-197-64-16:~# facter | grep 'tenant' tenant => GroupA root@ip-10-197-64-16:~# facter | grep 'foo' foo => bar </pre> 3. Puppet Agent Version details: <pre> root@ip-10-197-64-16:~# ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] root@ip-10-197-64-16:~# puppet --version 2.7.18 root@ip-10-197-64-16:~# facter -v 1.6.9 root@ip-10-197-64-16:~# </pre> 4. test.pp file at server side: <pre> class mysql{ file {"/tmp/facts.yaml": ensure => present, content => inline_template("<%= scope.to_hash.reject { |k,v| ! (k.is_a?(String) && v.is_a?(String) ) }.to_yaml %>"); } notify {"node vinod called ...":} notify {'msg': message => "network_eth0 : ${network_eth0} , tenant : ${tenant} , foo : $foo ... ${foo}" } } # default will run on every client if not specified the node name node default { include mysql } </pre> 5. puppet.conf at server level: <pre> [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet factpath=$vardir/lib/facter templatedir=$confdir/templates [master] # These are needed when the puppetmaster is run by passenger # and can safely be removed if webrick is used. ssl_client_header = SSL_CLIENT_S_DN ssl_client_verify_header = SSL_CLIENT_VERIFY [test] manifest = $confdir/manifests/test.pp </pre> 6. Server version details: <pre> root@domU-12-31-39-09-20-C6:/etc/puppet# puppet --version 3.1.0 root@domU-12-31-39-09-20-C6:/etc/puppet# ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux] root@domU-12-31-39-09-20-C6:/etc/puppet# facter -v 1.6.17 root@domU-12-31-39-09-20-C6:/etc/puppet# </pre> 7. Now, executed the following command at puppet client: <pre> root@ip-10-197-64-16:~# sudo puppet agent --server puppet --waitforcert 60 --test --debug --environment test debug: Failed to load library 'rubygems' for feature 'rubygems' debug: Failed to load library 'selinux' for feature 'selinux' 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 'ldap' for feature 'ldap' debug: Puppet::Type::User::ProviderLdap: feature ldap is missing debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist debug: /File[/var/lib/puppet/state/classes.txt]: Autorequiring File[/var/lib/puppet/state] debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring File[/var/lib/puppet/ssl] debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/ssl/certs/ip-10-197-64-16.us-west-1.compute.internal.pem]: Autorequiring File[/var/lib/puppet/ssl/certs] debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/state/last_run_summary.yaml]: Autorequiring File[/var/lib/puppet/state] debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/lib/puppet/ssl] debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/puppet/ssl] debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/lib/puppet/state] debug: /File[/var/lib/puppet/ssl/private_keys/ip-10-197-64-16.us-west-1.compute.internal.pem]: Autorequiring File[/var/lib/puppet/ssl/private_keys] debug: /File[/var/lib/puppet/state/last_run_report.yaml]: Autorequiring File[/var/lib/puppet/state] debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet] debug: /File[/etc/puppet/puppet.conf]: Autorequiring File[/etc/puppet] debug: /File[/var/lib/puppet/ssl/public_keys/ip-10-197-64-16.us-west-1.compute.internal.pem]: Autorequiring File[/var/lib/puppet/ssl/public_keys] debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/var/lib/puppet/ssl] debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring File[/var/lib/puppet/state] debug: /File[/var/lib/puppet/state/resources.txt]: Autorequiring File[/var/lib/puppet/state] debug: /File[/var/lib/puppet/ssl/private]: 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/certs/ca.pem]: Autorequiring File[/var/lib/puppet/ssl/certs] debug: Finishing transaction 70359361794880 debug: /File[/var/lib/puppet/ssl/certs/ip-10-197-64-16.us-west-1.compute.internal.pem]: Autorequiring File[/var/lib/puppet/ssl/certs] debug: /File[/var/lib/puppet/ssl/certificate_requests]: 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/private]: 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]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/puppet/ssl] debug: /File[/var/lib/puppet/state]: 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/public_keys/ip-10-197-64-16.us-west-1.compute.internal.pem]: Autorequiring File[/var/lib/puppet/ssl/public_keys] debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/lib/puppet/ssl] debug: /File[/var/lib/puppet/ssl/private_keys/ip-10-197-64-16.us-west-1.compute.internal.pem]: Autorequiring File[/var/lib/puppet/ssl/private_keys] debug: Finishing transaction 70359360269220 debug: Using cached certificate for ca debug: Using cached certificate for ip-10-197-64-16.us-west-1.compute.internal debug: Finishing transaction 70359359768000 debug: Loaded state in 0.03 seconds debug: Executing '/etc/puppet/etckeeper-commit-pre' debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson debug: Using cached certificate for ca debug: Using cached certificate for ip-10-197-64-16.us-west-1.compute.internal debug: Using cached certificate_revocation_list for ca info: Caching catalog for ip-10-197-64-16.us-west-1.compute.internal debug: Creating default schedules debug: Loaded state in 0.00 seconds info: Applying configuration version '1366289441' debug: /Schedule[daily]: Skipping device resources because running on a host debug: /Schedule[monthly]: Skipping device resources because running on a host debug: /Schedule[hourly]: Skipping device resources because running on a host debug: /Stage[main]/Mysql/File[/tmp/facts.yaml]/content: Executing 'diff -u /tmp/facts.yaml /tmp/puppet-file20130418-12048-ny0a68-0' notice: /Stage[main]/Mysql/File[/tmp/facts.yaml]/content: --- /tmp/facts.yaml 2013-04-18 12:50:25.470892681 +0000 +++ /tmp/puppet-file20130418-12048-ny0a68-0 2013-04-18 12:51:08.358892680 +0000 @@ -1,85 +1,85 @@ --- - network_eth0: "10.197.64.0" - lsbdistdescription: "Ubuntu 12.10" - swapfree: "0.00 kB" - timezone: UTC - lsbdistrelease: "12.10" - ec2_instance_type: t1.micro - path: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - arp_eth0: "fe:ff:ff:ff:ff:ff" + facterversion: "1.6.9" + architecture: amd64 + ec2_local_ipv4: "10.197.64.16" + ec2_hostname: ip-10-197-64-16.us-west-1.compute.internal + operatingsystemrelease: "12.10" + ipaddress: "10.197.64.16" ec2_ami_launch_index: "0" - uptime: "0:38 hours" + uptime_hours: "0" + processorcount: "1" + ipaddress_eth0: "10.197.64.16" + timezone: UTC + memoryfree: "475.00 MB" + ec2_block_device_mapping_ami: /dev/sda1 interfaces: "eth0,lo" + is_virtual: "true" + domain: us-west-1.compute.internal + fqdn: ip-10-197-64-16.us-west-1.compute.internal + kernelrelease: "3.5.0-21-generic" augeasversion: "0.10.0" + lsbdistrelease: "12.10" + kernelmajversion: "3.5" + ec2_kernel_id: aki-8d396bc8 + sshecdsakey: "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOSDwPx0qpKtluYZIgNlgaZYAqQnq/rfyk+IZW6McrGbe5S+HlGwMRrHdFG1lDGYpuA2mu52ZDOudV74qhzA7yw=" + rubyversion: "1.8.7" processor0: "Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz" - ec2_public_ipv4: "54.241.226.80" + ec2_instance_type: t1.micro + swapfree: "0.00 kB" + hardwaremodel: x86_64 + uniqueid: c50a1040 + rubysitedir: /usr/local/lib/site_ruby/1.8 + ec2_public_hostname: ec2-54-241-226-80.us-west-1.compute.amazonaws.com + uptime: "0:39 hours" + ps: "ps -ef" + ec2_ami_manifest_path: "(unknown)" + ec2_block_device_mapping_ephemeral0: sdb + swapsize: "0.00 kB" + uptime_days: "0" + kernel: Linux + id: root + hostname: ip-10-197-64-16 + environment: test + clientversion: "2.7.18" + network_eth0: "10.197.64.0" + physicalprocessorcount: "1" + ec2_placement_availability_zone: us-west-1c + kernelversion: "3.5.0" + lsbdistdescription: "Ubuntu 12.10" + clientcert: ip-10-197-64-16.us-west-1.compute.internal + ec2_reservation_id: r-68314a31 operatingsystem: Ubuntu sshrsakey: "AAAAB3NzaC1yc2EAAAADAQABAAABAQCsFwtMHV0tvZO1ErdZa/qGN7/si/dC7il1NR4qLRlnVb8s9nPxs3QnXf9yTSAEOorfjILBFJOzQMitDQu6IsMr6wqgumYQXsxVSZi5KU7uqj30iAsMr0VqlXcFwnCSg7hoYse3ILUHqYQkEET4kd8H06jYhD2g5lCrDBD8FJCLXKOIC9tatNNzZ4KDMvFKRgC2wuIN4KAuIo5rhkj+1r+rKuACQ/4mC8gqdG7nC/kwcjQM754bUEvRUQQpdJEVQ+GNSyFaZ6BxOewax/1mZANIwUmrEebNmc1sTCh+xzzDOI6iEj2sDi+2mQmOxDIpPFyimPgFdxggRJzBNF6NPYHX" - ipaddress: "10.197.64.16" - kernelrelease: "3.5.0-21-generic" + macaddress: "22:00:0a:c5:40:10" + osfamily: Debian ec2_security_groups: default + network_lo: "127.0.0.0" + netmask_eth0: "255.255.255.192" ec2_block_device_mapping_root: /dev/sda1 - memorytotal: "589.91 MB" - netmask: "255.255.255.192" - sshecdsakey: "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOSDwPx0qpKtluYZIgNlgaZYAqQnq/rfyk+IZW6McrGbe5S+HlGwMRrHdFG1lDGYpuA2mu52ZDOudV74qhzA7yw=" - hardwaremodel: x86_64 - macaddress_eth0: "22:00:0a:c5:40:10" - uniqueid: c50a1040 - processorcount: "1" - id: root + path: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ec2_instance_id: i-156c094d - ec2_placement_availability_zone: us-west-1c - kernelmajversion: "3.5" + lsbdistcodename: quantal + netmask: "255.255.255.192" + netmask_lo: "255.0.0.0" + ec2_profile: default-paravirtual + lsbdistid: Ubuntu lsbmajdistrelease: "12" - uptime_days: "0" - ec2_hostname: ip-10-197-64-16.us-west-1.compute.internal + ec2_local_hostname: ip-10-197-64-16.us-west-1.compute.internal + ec2_ami_id: ami-26745463 + puppetversion: "2.7.18" memorysize: "589.91 MB" - clientversion: "2.7.18" + arp_eth0: "fe:ff:ff:ff:ff:ff" + ec2_public_ipv4: "54.241.226.80" + memorytotal: "589.91 MB" + uptime_seconds: "2381" + arp: "fe:ff:ff:ff:ff:ff" + sshdsakey: "AAAAB3NzaC1kc3MAAACBAJvbTyk/H9yOyLGBS9gZ0lr5xKk6kJ2o7m4q8Yzl/m5oHMBKdae6kaE3guKruiPTdOMSfRjVY+EsJyHTvWM1N9JWtr+5dnOL5c262qVrdGAru+Gu2giWObVaAfKP4jwxHJ0rgclU8eVVF3F6xPNBNtRtVBAdKf/VCqy/oVqjuxWpAAAAFQCBakFHGF0Jc8IVBIaXD9leN1sLowAAAIB8hu/BeaD+BNoHHNVQIzkc+BtlGp8FWMLA3HR9ICkiDRxsQEqg7wf6SFmDi1CJOIsGt6vpLCRWp4E9inRW9jzco3Itjq3E9CVCxVP7+UWFiw9L93LARiZyqEkuf/oCELldVgDCg9Z74xfK0o050CGWkxCkk5bHe4zM2I9WxZtcyQAAAIAJkz4Aqar/PXsubaPzByhxWRnTJfL1FsPFt+06d+itn7zezP/5noi/meHbZdfsuwl23PHPr79LQkxv+ehgwBZIaXDcdnXebOm7d3JRAoYekCdhcVEQy5iMdAn8Xe/RM+2uYH/Le97o85T0X+zS6I+U5qxFU820HFeeEKDonszK5g==" virtual: xenu selinux: "false" - lsbdistcodename: quantal - ec2_kernel_id: aki-8d396bc8 - ipaddress_eth0: "10.197.64.16" - environment: test - osfamily: Debian - ec2_public_hostname: ec2-54-241-226-80.us-west-1.compute.amazonaws.com - hostname: ip-10-197-64-16 - ec2_block_device_mapping_ami: /dev/sda1 - facterversion: "1.6.9" - arp: "fe:ff:ff:ff:ff:ff" - uptime_seconds: "2338" - ec2_ami_manifest_path: "(unknown)" - operatingsystemrelease: "12.10" - architecture: amd64 - memoryfree: "475.02 MB" hardwareisa: x86_64 - kernel: Linux - ec2_local_hostname: ip-10-197-64-16.us-west-1.compute.internal - lsbdistid: Ubuntu - uptime_hours: "0" - sshdsakey: "AAAAB3NzaC1kc3MAAACBAJvbTyk/H9yOyLGBS9gZ0lr5xKk6kJ2o7m4q8Yzl/m5oHMBKdae6kaE3guKruiPTdOMSfRjVY+EsJyHTvWM1N9JWtr+5dnOL5c262qVrdGAru+Gu2giWObVaAfKP4jwxHJ0rgclU8eVVF3F6xPNBNtRtVBAdKf/VCqy/oVqjuxWpAAAAFQCBakFHGF0Jc8IVBIaXD9leN1sLowAAAIB8hu/BeaD+BNoHHNVQIzkc+BtlGp8FWMLA3HR9ICkiDRxsQEqg7wf6SFmDi1CJOIsGt6vpLCRWp4E9inRW9jzco3Itjq3E9CVCxVP7+UWFiw9L93LARiZyqEkuf/oCELldVgDCg9Z74xfK0o050CGWkxCkk5bHe4zM2I9WxZtcyQAAAIAJkz4Aqar/PXsubaPzByhxWRnTJfL1FsPFt+06d+itn7zezP/5noi/meHbZdfsuwl23PHPr79LQkxv+ehgwBZIaXDcdnXebOm7d3JRAoYekCdhcVEQy5iMdAn8Xe/RM+2uYH/Le97o85T0X+zS6I+U5qxFU820HFeeEKDonszK5g==" - rubysitedir: /usr/local/lib/site_ruby/1.8 - ec2_ami_id: ami-26745463 - domain: us-west-1.compute.internal - netmask_lo: "255.0.0.0" - network_lo: "127.0.0.0" - ec2_profile: default-paravirtual - ec2_local_ipv4: "10.197.64.16" - ps: "ps -ef" - swapsize: "0.00 kB" - puppetversion: "2.7.18" - clientcert: ip-10-197-64-16.us-west-1.compute.internal + macaddress_eth0: "22:00:0a:c5:40:10" ipaddress_lo: "127.0.0.1" - physicalprocessorcount: "1" ec2_public_keys_0_openssh_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDK7pUmGi4OTs6EpdJWLrfqA0rg8aql+Iwfuo67zNazx+le0UT2aaCv1HzvYEpqV5NZ4cw52Y1e3BY0Sb+3E/oy0vqRBTko5zUzJLawDNKj8r0CzHo0Z23lQmpkMiFUPfNJUqP+dGQjzRnst+V3nwrGwDkioUYs4+P3xYabywJIPLbwOZSDFf1ilxSWgTKybc7aI7GHlmXClpSfA2Npoxd0DAiqeaSVMwd8P4akmT8wP9pX9VcqesJ+pWn5lstubz8pRKslPPiUnCNYatArMH+M8lspTtuWGdnZnxnj4lWgGTZXHCfswg/SycZs2Wl6A6ALfY5EhgDqILg1AR3T0hKr ubuntukey" - ec2_reservation_id: r-68314a31 - macaddress: "22:00:0a:c5:40:10" - netmask_eth0: "255.255.255.192" - ec2_block_device_mapping_ephemeral0: sdb - kernelversion: "3.5.0" - fqdn: ip-10-197-64-16.us-west-1.compute.internal - is_virtual: "true" - rubyversion: "1.8.7" serverversion: "3.1.0" servername: domU-12-31-39-09-20-C6.compute-1.internal serverip: "10.210.39.52" debug: Finishing transaction 70359359761460 info: FileBucket adding {md5}ed62b8bff66653979c7880f7f52fc129 info: /Stage[main]/Mysql/File[/tmp/facts.yaml]: Filebucketed /tmp/facts.yaml to puppet with sum ed62b8bff66653979c7880f7f52fc129 notice: /Stage[main]/Mysql/File[/tmp/facts.yaml]/content: content changed '{md5}ed62b8bff66653979c7880f7f52fc129' to '{md5}5f21d91a482859a803856695d81c720b' debug: /Stage[main]/Mysql/File[/tmp/facts.yaml]: The container Class[Mysql] will propagate my refresh event debug: /Schedule[never]: Skipping device resources because running on a host notice: node vinod called ... notice: /Stage[main]/Mysql/Notify[node vinod called ...]/message: defined 'message' as 'node vinod called ...' debug: /Stage[main]/Mysql/Notify[node vinod called ...]: The container Class[Mysql] will propagate my refresh event debug: /Schedule[weekly]: Skipping device resources because running on a host notice: network_eth0 : 10.197.64.0 , tenant : , foo : ... notice: /Stage[main]/Mysql/Notify[msg]/message: defined 'message' as 'network_eth0 : 10.197.64.0 , tenant : , foo : ... ' debug: /Stage[main]/Mysql/Notify[msg]: The container Class[Mysql] will propagate my refresh event debug: Class[Mysql]: The container Stage[main] will propagate my refresh event debug: /Schedule[puppet]: Skipping device resources because running on a host debug: Finishing transaction 70359360008500 debug: Storing state debug: Stored state in 0.00 seconds notice: Finished catalog run in 0.29 seconds debug: Executing '/etc/puppet/etckeeper-commit-post' debug: Value of 'preferred_serialization_format' (pson) is invalid for report, using default (b64_zlib_yaml) debug: report supports formats: b64_zlib_yaml raw yaml; using b64_zlib_yaml root@ip-10-197-64-16:~# root@ip-10-197-64-16:~# </pre> Observation: I see that the values for facter 'tenant' and 'foo' are blank where as 'network_eth0' is showing properly. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.