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

Introduce dedicated case insensitive match operator #1088

Open
Crited opened this issue Nov 5, 2024 · 0 comments
Open

Introduce dedicated case insensitive match operator #1088

Crited opened this issue Nov 5, 2024 · 0 comments

Comments

@Crited
Copy link
Member

Crited commented Nov 5, 2024

Is your feature request related to a problem? Please describe.

A environment might use variables like host.vars.contacts. Logging into Icinga Web 2 via e.g. Active Directory is case-insensitive. Comparing the current username to a variable like that is possible through the use of user.local_name.

The filter of a role might look like this:

host.vars.contacts[*]~$user.local_name$

For a value of FooBar for host.vars.contacts and fooBar for user.local_name this would evaluate to false.

While one could influence the content of host.vars.contacts to be lowercase at all times and force users to use lowercase logins so user.local_name. I reckon a case insensitive match is useful in more than just this scenario.

Describe the solution you'd like

Introduce a dedicated case insensitive match operator. (Force case insensitive)
Maybe something like this? =~

host.vars.contacts[*]=~$user.local_name$

For a value of FooBar for host.vars.contacts and fooBar for user.local_name this would evaluate to true.

Describe alternatives you've considered

Make implicit case insensitive match through wildcards work for macros?

host.vars.contacts[*]~*"$user.local_name$"*
host.vars.contacts[*]~*$user.local_name$*

Additional context

Apparently this used to work with monitoring over icingadb:

_host.vars.contacts=*"$user.local_name$"*
@nilmerg nilmerg transferred this issue from Icinga/icingaweb2 Nov 5, 2024
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