Skip to content

firewall.toports expects an undef value or a match for Pattern[/^\d+(?:-\d+)?$/], got Integer #1186

Closed
@chrisongthb

Description

@chrisongthb

Describe the Bug

With param toports (--to-ports) one might want to redirect to a single port. Not only to a range of ports. We currently get this error:
Failed to apply catalog: Parameter toports failed on Firewall[233 redirect traffic on port 5432 to 5433]: firewall.toports expects an undef value or a match for Pattern[/^\d+(?:-\d+)?$/], got Integer

Expected Behavior

The module should accept the single port as Integer.

Steps to Reproduce

@firewall { "233 redirect traffic on port 5432 to 5433":
  chain    => 'PREROUTING',
  jump     => 'REDIRECT',
  iniface  => 'bond0',
  toports  => 5433,
  table    => 'nat',
  dport    => 5432,
  protocol => 'iptables',
  tag      => 'virtual',
}

Environment

  • Module version v7.0.2
  • Puppet Agent version 7.26.0
  • Puppet Server version 7.13.0
  • Platform Ubuntu 20.04, 22.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions