Skip to content

additional separator for ipset #1257

Open
@horizonline123

Description

@horizonline123

Use Case

I'm trying to resolve the following issue:

Error: /Stage[main]/Profile::Firewall::Pre/Firewallchain[INPUT:filter:IPv4]: Failed to generate additional resources using 'generate': Provider returned data that does not match the Type Schema for `firewall[9003 ac630a553e8a81cc104783ce577db1d6edfb0fb54cd1476453dcb5f338d7fc31]`
 Value type mismatch:
    * ipset: i360.ipv4.no-redirect-port dst (expects a value of type Undef, Pattern[/^(?:!\s)?[\w\-:_]+\s(?:src|dst)(?:,src|,dst)?$/], or Array[Pattern[/^(?:!\s)?[\w\-:_]+\s(?:src|dst)(?:,src|,dst)?$/]], got String)

It has error because name for ipset does not match a pattern due to "." sign (dot/point) in the name of ipset.
"i360.ipv4.no-redirect-port dst" does not match Pattern[/^(?:!\s)?[\w-:_]+\s(?:src|dst)(?:,src|,dst)?$/]

Describe the Solution You Would Like

Could you please add sign "." as an additional separator here ./lib/puppet/type/firewall.rb +951 ?

ipset: {
-->      type: 'Optional[Variant[Pattern[/^(?:!\s)?[\w\-:._]+\s(?:src|dst)(?:,src|,dst)?$/], Array[Pattern[/^(?:!\s)?[\w\-:._]+\s(?:src|dst)(?:,src|,dst)?$/]]]]',
      desc: <<-DESC

When I change type from this:
type: 'Optional[Variant[Pattern[/^(?:!\s)?[\w\-:_]+\s(?:src|dst)(?:,src|,dst)?$/], Array[Pattern[/^(?:!\s)?[\w\-:_]+\s(?:src|dst)(?:,src|,dst)?$/]]]]',
to this:
type: 'Optional[Variant[Pattern[/^(?:!\s)?[\w\-:._]+\s(?:src|dst)(?:,src|,dst)?$/], Array[Pattern[/^(?:!\s)?[\w\-:._]+\s(?:src|dst)(?:,src|,dst)?$/]]]]',
everything works fine.

Describe Alternatives You've Considered

I haven't found alternative right solution... Would be glad for any advises

Additional Context

First time create tickets like this. Sorry if I did something wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions