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

Allow explicit type selection in hiera values #11

Open
oxc opened this issue Feb 4, 2021 · 2 comments
Open

Allow explicit type selection in hiera values #11

oxc opened this issue Feb 4, 2021 · 2 comments
Assignees

Comments

@oxc
Copy link
Collaborator

oxc commented Feb 4, 2021

Allow specifying an explicit type instead of auto when specifying keys in hiera, e.g.

domain:
  example.com:
    path: /var/lib/rspamd/dkim/$domain.$selector.key
    'selector: string': 20200822

When this is possible, allow arrays to be printed as config-arrays:

    rates:
      some_limit:
        selector: 'user.lower'
        'bucket: array':
          - burst: 100
            rate: "10 / 1min"
          - burst: 10
            rate: "100 / 1min"

this should result in:

rates {
  some_limit {
    selector = "user.lower";
    bucket = [
    {
      burst = 100;
      rate = "10 / 1min";
    },
    {
      burst = 10;
      rate = "100 / 1min";
    }
    ]
  }
}

The exact syntax has still TBD, but I believe key: type should have the least potential for clashing with future keys/features, while being a common way to specify types in many langauges.

@oxc oxc self-assigned this Feb 4, 2021
@oxc
Copy link
Collaborator Author

oxc commented Feb 4, 2021

This would fix #6 and the selector use-case mentioned in #6 (comment)

@kienanstewart
Copy link

I think this would also help with the following use case: set a string value of YES in a configuration value. Since YES gets interpreted via the auto type as boolean, it's output without string quoting. Unless I'm mistaken, there's not a way to get the the output as a string without going through some hoops and creating rspamd::config resources in another way.

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

2 participants