I know this is an old thread, but following this guide, I'm getting the 
following error when attempting to run puppet agent -t on the client:

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
no implicit conversion of nil into Hash at 
/etc/puppet/environments/production/modules/firewall_custom/manifests/init.pp:12
 
on node omdapps06.mil.state.or.us
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run


Gist of init.pp is here:
https://gist.github.com/joeywas/d8f0d676b9ef3beb54ae0d617ef69633



On Thursday, April 17, 2014 at 12:49:46 PM UTC-7, Race Boyer wrote:
>
> Thank you very much, this helped a great deal
>
> On Tuesday, November 5, 2013 6:58:47 PM UTC-6, Jack Watroba wrote:
>>
>> We're using the puppetlabs/firewall module and we wanted a way to pass 
>> all of our firewall data through the Foreman web UI for ease of quickly 
>> adding/deleting firewall rules. This is what we came up with, in case 
>> anyone else is interested. 
>>
>>
>> Created a new module: ex. custom_firewall (init.pp, pre.pp, post.pp)
>> *init.pp:*
>>
>> class custom_firewall($firewall_data = false) {
>>
>>   include custom_firewall::pre
>>   include custom_firewall::post
>>   include firewall
>>
>>   resources { "firewall":
>>   purge => true
>>   }
>>
>>   Firewall {
>>     before  => Class['custom_firewall::post'],
>>     require => Class['custom_firewall::pre'],
>>   }
>>
>>   if $firewall_data != false {
>>     create_resources('firewall', $firewall_data)
>>   }
>>
>> }
>>
>>
>> *pre.pp (* Include any default firewall rules you want here that will 
>> load every time regardless. ex. icmp)*:*
>>
>> class custom_firewall::pre {
>>
>>   Firewall {
>>     require => undef,
>>   }
>>
>>    firewall {'000 accept all icmp':
>>     proto   => 'icmp',
>>     action  => 'accept',
>>   }
>>
>> }
>>
>>
>> *post.pp *(final line of iptables):
>>
>> class custom_firewall::post {
>>   firewall { '999 drop all':
>>     proto   => 'all',
>>     action  => 'drop',
>>     before  => undef,
>>   }
>> }
>>
>>
>> Now, import the classes into foreman. Under the custom_firewall class, 
>> set the $firewall_data param to yaml. At this point you can pass in any 
>> additional firewall rules via yaml. 
>> ex. 
>> "007 accept tcp tomcat requests": 
>>     port: 
>>       - "8080"
>>       - "8009"
>>       - "8999"
>>     proto: tcp
>>     action: accept
>>
>>
>> Hope this helps. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to