Puppet Function: iptables::use_firewalld
- Defined in:
- functions/use_firewalld.pp
- Function type:
- Puppet Language
Overview
DEPRECATED Returns “true“ if the client can/should use firewalld
| 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # File 'functions/use_firewalld.pp', line 12
function iptables::use_firewalld (
  Variant[String[1], Boolean] $enable = true,
) >> Boolean {
  deprecation('iptables::use_firewalld', 'iptables::use_firewalld is deprecated')
  $_firewalld_os_list = {
    'RedHat'      => '8',
    'CentOS'      => '8',
    'OracleLinux' => '8',
    'Rocky'       => '8',
    'AlmaLinux'   => '8',
  }
  if $enable {
    $_simplib_firewalls = fact('simplib__firewalls')
    $_os_name = fact('os.name')
    $_os_maj_rel = fact('os.release.major')
    if $_simplib_firewalls and ('firewalld' in $_simplib_firewalls) {
      if ($enable == 'firewalld') or
        ($_firewalld_os_list[$_os_name] and ($_os_maj_rel >= $_firewalld_os_list[$_os_name]))
      {
        $_retval = true
      }
    }
  }
  unless defined('$_retval') {
    $_retval = false
  }
  $_retval
} |