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

Impossible to create virtual regexp map #323

Open
vasilevalex opened this issue Feb 10, 2022 · 0 comments
Open

Impossible to create virtual regexp map #323

vasilevalex opened this issue Feb 10, 2022 · 0 comments

Comments

@vasilevalex
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.26.0
  • Ruby: ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux]
  • Distribution: CentOS 7
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

Simply use example from the code:

# postfix::virtual { "/.+@.+/"

node "toto.example.com" {
  include postfix
  postfix::config { "virtual_alias_maps":
    value => "regexp:/etc/postfix/virtual_regexp"
  }
 postfix::virtual { "/.+@.+/":
   ensure      => present,
   file        => '/etc/postfix/virtual_regexp',
   destination => 'root',
  }
}

What are you seeing

Virtual map can't be created because of limitation of symbols to match pattern. Regexp map is formatted the same way as hash map, but it is impossible to build even simple regular expressions using only very limited amount of symbols: *+.0-9=@-Z\\_a-z-

What behaviour did you expect instead

Pattern should use additionally at least these symbols: ^][$/()|?}{

Output log

Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): Opening augeas with root /, lens path , flags 64
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): Augeas version 1.12.0 is installed
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): sending command 'defnode' with params ["entry", "/files/etc/postfix/virtual_regexp/pattern[. = '/.+@.+/']", "/.+@.+/"]
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): sending command 'rm' with params ["$entry/destination"]
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): sending command 'set' with params ["$entry/destination[1]", "root"]
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): Put failed on one or more files, output from /augeas//error:
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): /augeas/files/etc/postfix/virtual_regexp/error = put_failed
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): /augeas/files/etc/postfix/virtual_regexp/error/path = /files/etc/postfix/virtual_regexp/
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): /augeas/files/etc/postfix/virtual_regexp/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/postfix_virtual.aug:51.10-.47:
Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): /augeas/files/etc/postfix/virtual_regexp/error/message = Unexpected node '/files/etc/postfix/virtual_regexp/pattern[2]': can not match tree

     { "pattern" = "/.+@.+/" }

 with pattern
   (    { }
      | { /#comment/ = /[^\t\n\r ].*[^\t\n\r ]|[^\t\n\r ]/ }
      | { /pattern/ = /[*+.0-9=@-Z\\_a-z-]+/ })*

Debug: Augeas[Postfix virtual - /.+@.+/](provider=augeas): Closed the augeas connection
Error: /Stage[main]/Profile::Postfix_cfg/Postfix::Virtual[/.+@.+/]/Augeas[Postfix virtual - /.+@.+/]: Could not evaluate: Save failed, see debug output for details

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