How to save lookup_values in the DB


I want to start a discussion how we should save lookup_values to the DB.
At the moment, Foreman saves them very differently.

For example:

If you save a YAML type, it will get serialized as a string in the DB.
If you save an array type, it will get serialized as a YAML array but not as a string.
If you have ERB in it, things will get even more complicated.

Why do we not save everything as YAML(without string serialization)? AFAIK it should be possible to represent every type that is used by Foreman.

Thank you in advance for your opinions and help on this topic.

PS. this is a little bit related to my PR #5371 (, because I’m not sure which path I should take to actually solve the issue the right way.

I’m for consistency so if we can save everything as YAML without big impact on the behaviour from user point of view, I would say let’s give it a try.