-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
dokku_config: allow list type #55
Comments
Actually, also "Foo: true" fails as well, which is pretty typical in an Ansible play. Looks like https://github.com/dokku/ansible-dokku/blob/master/library/dokku_config.py#L93 is the issue here. I think a |
The error should say |
Description here as to my reasoning. |
Hmmm, Ansible does the following regarding trying to convert bools: def to_bool(a):
''' return a bool for the arg '''
if a is None or isinstance(a, bool):
return a
if isinstance(a, string_types):
a = a.lower()
if a in ('yes', 'on', '1', 'true', 1):
return True
return False So, we could do that to address you concern in #6 (comment). We can extend the "in" check to cover other values that you might use / expect for truthiness. I understand why it works the way it works now but it unfortunately breaks a very common expectation when writing Ansible plays that you can use integers, bools and not quote booleans. That is confusing coming from a strictly Ansible side of things. |
The problem here is that folks won't be able to specify the difference between The rule that you can use different types within Ansible only applies to when the input expects that. We do not, and the module expects a string value. Trying to coerce the value here doesn't make sense at all since you're attempting to set a literal value in your app's environment. |
Makes sense! I'll get a docs patch in to avoid this being raised up again 🌥️ |
@decentral1se Is the docs patch in? Can we close this? |
https://docs.gitea.io/en-us/config-cheat-sheet/
So, I need to add the following config:
Shall we widen up the types that are accepted?
The text was updated successfully, but these errors were encountered: