Puppet Setup Firewall Rules

@Inderpreet @KodeKloud @player001 @mmumshad
could there be a problem with the connection? I keep getting this error when i run the following command from app1

$ sudo puppet -tv

which module did you use… please paste the puppet manifest

I unstalled firewalld on master:
$ sudo yum install firewalld -y && systemctl enable firewalld && systemctl restart firewalld && firewall-cmd --state

code.pp:

node 'stapp01.stratos.xfusioncorp.com' {
  include firewall_node1 firewall_node1
}

node 'stapp02.stratos.xfusioncorp.com' {
  include firewall_node2
}

node 'stapp03.stratos.xfusioncorp.com' {
  include firewall_node3
}

ecommerce.pp:

class { 'firewalld': }

class firewall_node1 {
  firewalld_port { 'Open port 6400 in the public zone':
    ensure   => present,
    zone     => 'public',
    port     => 5000,
    protocol => 'tcp',
  }
}

class firewall_node2 {
  firewalld_port { 'Open port 6400 in the public zone':
    ensure   => present,
    zone     => 'public',
    port     => 9004,
    protocol => 'tcp',
  }
}

class firewall_node3 {
  firewalld_port { 'Open port 6400 in the public zone':
    ensure   => present,
    zone     => 'public',
    port     => 8095,
    protocol => 'tcp',
  }
}

then ran: $ puppet agent -tv; on app server1 which gave the above error.

thanks

i think you need to install firewalld puppet module

1 Like

Did you understood the module before using it?
First follow the documentation on the firewalld module and you will understand.

1 Like

yes, thanks, got it done @kleansoul @tgp