Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional separator for ipset #1257

Open
horizonline123 opened this issue Mar 4, 2025 · 0 comments
Open

additional separator for ipset #1257

horizonline123 opened this issue Mar 4, 2025 · 0 comments

Comments

@horizonline123
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant