2ead3bcd
2010-Sep-09 22:55 UTC
[Puppet Users] Having trouble configuring puppet for file serving
Hi, I am running puppet-server 0.25.5 on CentOS 5.4. I defined a moudle in /etc/puppet/fileserver.conf as below: [files] path /tmp/puppet allow * I also defined a resource in /etc/puppet/manifests/site.pp: file { "/etc/passwd": owner => "root", group => "bin", mode => 644, } file { "/tmp/0909.txt": source => "puppet://192.168.10.10/modules/files/0909.txt" } Then I ran the following command on a puppet client. The group of /etc/ passwd on the client became bin, but I don''t see /tmp/0909.txt on the client side. What am I missing here? Thanks. puppetd --onetime -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
deet
2010-Sep-10 03:58 UTC
[Puppet Users] Re: Having trouble configuring puppet for file serving
> [files] > path /tmp/puppetWhat is the structure under /tmp/puppet? I would expect to see /tmp/ puppet/files/0909.txt on the server. My understanding of how modules are structured is that in each module directory you would have a directory called "files" which contains the files you want to serve up . For example in my "snmp" module I have the following ls -1R snmp/ files manifests templates snmp//files: snmpd.conf snmp//manifests: init.pp As you can see the file I am passing out is located at snmp/files/ snmpd.conf. Also the system logs of your client and server should provide some further information which could be useful in discovering the problem. Another thing to mention is that the puppet master needs to be able to read the file''s that are being requested from it so double check the permissions. Anyhoo hope this get''s you moving in the right direction. Derek.> > I also defined a resource in /etc/puppet/manifests/site.pp: > file { "/etc/passwd": > owner => "root", > group => "bin", > mode => 644, > > } > > file { "/tmp/0909.txt": > source => "puppet://192.168.10.10/modules/files/0909.txt" > > } > > Then I ran the following command on a puppet client. The group of /etc/ > passwd on the client became bin, but I don''t see /tmp/0909.txt on the > client side. What am I missing here? Thanks. > puppetd --onetime-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
2ead3bcd
2010-Sep-10 16:09 UTC
[Puppet Users] Re: Having trouble configuring puppet for file serving
Thanks for your reply. I made some changes according to your feedback, but I''m still unable to copy files to the client. What else am I missing again? [root@puppet ~]# cat /etc/puppet/manifests/site.pp # site.pp file { "/tmp/0910.txt": source => "puppet://puppet.test.123.com/modules/configuration/ 0910.txt" } [root@puppet ~]# cat /etc/puppet/fileserver.conf [configuration] path /etc/puppet/manifests/configuration allow * [root@puppet ~]# ls -lR /etc/puppet/manifests/configuration/ /etc/puppet/manifests/configuration/: total 8 drw-r--r-- 2 root root 4096 Sep 10 09:51 files /etc/puppet/manifests/configuration/files: total 8 -rw-r--r-- 1 root root 4 Sep 10 09:51 0910.txt [root@node1 ~]# cat /etc/sysconfig/puppet # The puppetmaster server PUPPET_SERVER=192.168.6.13 # If you wish to specify the port to connect to do so here PUPPET_PORT=8140 # Where to log to. Specify syslog to send log messages to the system log. PUPPET_LOG=/var/log/puppet/puppet.log # You may specify other parameters to the puppet client here #PUPPET_EXTRA_OPTS=--waitforcert=500 Both 8140:tcp and 8140:udp are open on both the client and the server. ACCEPT udp -- anywhere anywhere state NEW udp dpt:8140 ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:8140 The client and the server are rebooted as well. Here''s the error message: err: //File[/tmp/0910.txt]: Failed to retrieve current state of resource: Could not retrieve information from source(s) puppet://puppet.test.123.com/modules/configuration/0910.txt at /etc/ puppet/manifests/site.pp:4 -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
deet
2010-Sep-10 20:04 UTC
[Puppet Users] Re: Having trouble configuring puppet for file serving
> What else am I missing again? >Let''s try a different approach. I think once you have a working example you''ll be able to mold it as desired. So here is a complete working minimal example to try out. If you use these files with the listed directory structure I''m pretty certain you''ll get a working solution. Then the lightbulb will go off and you can modify as you see fit. So here is the complete directory structure and all files under /etc/ puppet except for ssl related files/dirs find /etc/puppet -type f -exec ls {} \;|grep -v ssl /etc/puppet/fileserver.conf /etc/puppet/manifests/site.pp /etc/puppet/modules/example_module/files/0910.txt cat /etc/puppet/fileserver.conf #/etc/puppet/fileserver.conf [modules] allow * cat /etc/puppet/manifests/site.pp #/etc/puppet/manifests/site.pp file { "/tmp/0910.txt": source => "puppet:///modules/example_module/0910.txt" } cat /etc/puppet/modules/example_module/files/0910.txt whoo hoo, i''m 0910.txt! So you''ll notice that I''m using the generic term "modules" in the fileserver.conf file instead of specifiying the module name. I actually use this in my fileserver.conf. I''ve not ran into a reason yet where I need to specify per module access permissions. Also the "source" parameter in the file resource is called out like this "puppet:///modules/example_module/0910.txt" which alleviates the need to actually specify the server location. This notation means that the file will be retrieved from server it contacted to get the manifest. Anyhoo give this a whirl. I just tested it on my workstation and spun up a new puppetmaster and client and it worked. HTH. Derek.> [root@puppet ~]# cat /etc/puppet/manifests/site.pp > # site.pp > file { "/tmp/0910.txt": > source => "puppet://puppet.test.123.com/modules/configuration/ > 0910.txt" > > } > > [root@puppet ~]# cat /etc/puppet/fileserver.conf > [configuration] > path /etc/puppet/manifests/configuration > allow * > > [root@puppet ~]# ls -lR /etc/puppet/manifests/configuration/ > /etc/puppet/manifests/configuration/: > total 8 > drw-r--r-- 2 root root 4096 Sep 10 09:51 files > > /etc/puppet/manifests/configuration/files: > total 8 > -rw-r--r-- 1 root root 4 Sep 10 09:51 0910.txt > > [root@node1 ~]# cat /etc/sysconfig/puppet > # The puppetmaster server > PUPPET_SERVER=192.168.6.13 > > # If you wish to specify the port to connect to do so here > PUPPET_PORT=8140 > > # Where to log to. Specify syslog to send log messages to the system > log. > PUPPET_LOG=/var/log/puppet/puppet.log > > # You may specify other parameters to the puppet client here > #PUPPET_EXTRA_OPTS=--waitforcert=500 > > Both 8140:tcp and 8140:udp are open on both the client and the server. > ACCEPT udp -- anywhere anywhere state NEW > udp dpt:8140 > ACCEPT tcp -- anywhere anywhere state NEW > tcp dpt:8140 > > The client and the server are rebooted as well. > > Here''s the error message: > err: //File[/tmp/0910.txt]: Failed to retrieve current state of > resource: Could not retrieve information from source(s) > puppet://puppet.test.123.com/modules/configuration/0910.txt at /etc/ > puppet/manifests/site.pp:4-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
2ead3bcd
2010-Sep-10 21:03 UTC
[Puppet Users] Re: Having trouble configuring puppet for file serving
After I did the following, it works. Thanks. chmod 0665 -R /etc/puppet/modules -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
2ead3bcd
2010-Sep-10 22:07 UTC
[Puppet Users] Re: Having trouble configuring puppet for file serving
The reason I wasn''t able to get it to work was because I didn''t know I have to modify modulepath in /etc/puppet/puppet.conf [puppetmasterd] modulepath = /etc/puppet/modules:/usr/share/puppet/modules:/tmp/ puppet/modules -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.