thias / puppet-fooacl

Puppet POSIX ACLs module
Other
9 stars 20 forks source link

failed to parse 20.erb #8

Closed grbailey66 closed 9 years ago

grbailey66 commented 10 years ago

New to puppet so this could be simple -- I missed something obvious...

Downloaded fooacl as tar ball, untarred and renamed fooacl in my modulepath.

touched /tmp/foobar for test file on puppet agent system

used puppet module generate to create module named try init.pp: class try { include fooacl fooacl::conf { "/tmp/foobar": permissions => [ 'user::splunk:r--', ], } }

included try in test node in site.pp

Got the following error: ??

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template fooacl/20.erb: Filepath: /etc/puppetlabs/puppet/environments/dsade/modules/fooacl/templates/20.erb Line: 1 Detail: undefined method `each' for "/tmp/foobar":String at /etc/puppetlabs/puppet/environments/dsade/modules/fooacl/manifests/conf.pp:16 on node ess0840x.dre.dev.int Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

thias commented 10 years ago

Could you tell me which version of the module you're using, as well as which version of puppet? I can see how this could happen, but not why it would affect you and not me :-)

grbailey66 commented 10 years ago

fooacl 0.1.3 puppet enterprise 3.3.1 puppet agent 3.6

grbailey66 commented 10 years ago

class try { include fooacl

fooacl::conf { "/tmp/foobar": permissions => [ 'user::splunk:r--', ], }

fooacl::conf { "/tmp/foobar2": permissions => [ 'user::splunk:r--', ], }

}

sinansari commented 10 years ago

Hi thias,

I have the same issue. I installed module by directly puppetforge. Then edited site.pp as below;

fooacl::conf { '/var/log/messages': permissions => [ 'user:logstash:rwx', ], }

Then got error on agent as below;

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template fooacl/20.erb: Filepath: /etc/puppetlabs/puppet/environments/development/modules/fooacl/templates/20.erb Line: 1 Detail: undefined method `each' for "/var/log/messages":String at /etc/puppetlabs/puppet/environments/development/modules/fooacl/manifests/conf.pp:16 on node pcent01.dev Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run


After I changed foacl conf.pp under its manifests directory for content section from 20.erb to 30.erb error has been cleaned.

But my site site.pp didn't do anything on /var/log/messages file as I mentioned.

Can you clerify if seeting acl in common site.pp as I did is true or not.

Regards,

thias commented 10 years ago

Hi! Could you try with this simple change?

--- a/manifests/conf.pp
+++ b/manifests/conf.pp
@@ -3,7 +3,7 @@
 # Configure the Posix ACLs set by the script from the fooacl class.
 #
 define fooacl::conf (
-  $target      = $name,
+  $target      = [ $name ],
   $order       = 20,
   $permissions,
 ) {
thias commented 10 years ago

Actually, I think I've fixed this in a much cleaner way in commit a8c804f87933e92d45ea1416aab17d09fdf6210c. Could you please check by updating to the latest git master code, or just copying the latest 20.erb file?

thias commented 9 years ago

No reply in a loooong time. Assuming this was indeed fixed :-)

grbailey66 commented 9 years ago

yes, your original suggestion worked for me.

Glenn

On Wed, Feb 25, 2015 at 12:49 PM, Matthias Saou notifications@github.com wrote:

No reply in a loooong time. Assuming this was indeed fixed :-)

— Reply to this email directly or view it on GitHub https://github.com/thias/puppet-fooacl/issues/8#issuecomment-76053478.