So it seems i used [firewalld_rich_rule] instead of [firewalld_port]. This might have caused validation to fail but I dont think this was mentioned in the question.
Hey @andrescaroc
what was the issue with this class function?
class firewall_node1 {
firewalld_port { ‘Open port 6000 in the public zone’:
ensure => present,
zone => ‘public’,
port => 6000,
protocol => ‘tcp’,
}
}
I am getting similar behaviours what you got before. puppet agent get the config applied with success, but there has been no change on the ports in public zone? how did you overcome that issue?
I’m also investigating this behavior.
I think it has to do with firewalld not reloading after manifest is deployed.
After pulling the manifest on Agent, try with firewall-cmd --reload and see if the port is now opened.
This is mentioned among the lines in the doc shared by @andrzejhttps://forge.puppet.com/puppet/firewalld/readme
However, It’s not 100% clear to me the advise given there about this topic. If someone can help me to clarify it, I’d be good.
The class function does not have issue, what I learned from docs is that you must declare the class { 'firewalld': } specified in the usage section, this way:
class { 'firewalld': }
class firewall_node1 {
firewalld_port { 'Open port 6400 in the public zone':
ensure => present,
zone => 'public',
port => 6400,
protocol => 'tcp',
}
}
I hope this helps for everybody that is stuck with this task.
For sure, I think the documentation of this module could be better with an example of that “usage” statement within a code example, but this is what we have.
I have added that towards the end of my code. is that correct? or should I include it in the beginning or at a different place?
also, class { ‘firewalld’: } am I supposed to declare it three times, or declaring it once is sufficient? #separate pp file for firewall rules