Ansible Variable | What it it? Why is it?

Hello everyone! It was with high anticipation that I followed the latest releases which involve ansible variables. Although I can observe that this variables are correctly detected by the parser, and I seem to be able to add validation to it; it’s not entirely clear what is expected from here on?

I always assumed that the variable information provided would be used in the UI to create form-elements, like drop-downs, calendars, numeric input fields, etc. mixed with auto-validation, in case somebody entered something “silly”.

However, I don’t see any of that? Let alone notice any difference when using garbage data or not :frowning:

PS: Even worse, when I try to edit these “variables”, the system complains: " Oops, we’re sorry but something went wrong wrong number of arguments (given 3, expected 1…2)"

If somebody could shed some light on the purpose and what we might expect in the future, that would be great :slight_smile: (unless there’s a bi-weekly demo that explains this; which i must’ve overlooked)

Thanks everyone! :slight_smile:

Hi, regarding the error when editing variables, I think you are hitting Bug #26436: Ansible 2.3.2 is not compatbile with Foreman 1.21 - Ansible - Foreman which is fixed in later releases.

Variables will allow you to change defaults, add overrides/specify matchers and apply different values to your hosts.

It is impossible for Foreman alone to determine whether variable input is garbage or not - the Ansible roles do not provide any type information about variables, though we do some basic type inference on import and detect basic types such as boolean, array, string, integer, float or hash.

Having specialized form elements could work, though for drop-downs it would require users to define a list of acceptable values and for calendar a desired date formatting.

If you need the values to be validated, the optional input validator should do the job. If not, we’d be happy to hear how we can improve it :slight_smile: