-
-
Notifications
You must be signed in to change notification settings - Fork 59
Types redesign #82
Copy link
Copy link
Open
Description
Hello @bastelfreak and @mcrauwel!
I am now looking at types design and I think that it wasn't such a good idea to wrap everything in arrays, because right now all configurations files are looking a bit ugly.
Let me show my thoughts using examples.
Right now in order to configure multiples users in hiera we need to write an array of hashes, like:
"proxysql::mysql_users": [
{ "user1": {
"password": "*92C74DFBDA5D60ABD41EFD7EB0DAE389F4646ABB",
"default_hostgroup": 1,
"transaction_persistent": false }
},
{ "user2": {
"password": "*86935F2843252CFAAC4CE713C0D5FF80CF444F3B",
"default_hostgroup": 2 }
},
{ "user3": {
"password": "*86935F2843252CFAAC4CE713C0D5FF80CF444F3B",
"default_hostgroup": 2 }
},
{ "user4": {
"password": "*86935F2843252CFAAC4CE713C0D5FF80CF444F3B",
"default_hostgroup": 2 }
}
]but actually this arrays brackets just make reading in case of many users harder.
So my proposal is to get rid of arrays and use pure hashes (so it will be more ruby way).
So we will have this configuration parameter like:
"proxysql::mysql_users": {
"user1": {
"password": "*92C74DFBDA5D60ABD41EFD7EB0DAE389F4646ABB",
"default_hostgroup": 1,
"transaction_persistent": false
},
"user2": {
"password": "*86935F2843252CFAAC4CE713C0D5FF80CF444F3B",
"default_hostgroup": 2
},
"user3": {
"password": "*86935F2843252CFAAC4CE713C0D5FF80CF444F3B",
"default_hostgroup": 2
},
"user4": {
"password": "*86935F2843252CFAAC4CE713C0D5FF80CF444F3B",
"default_hostgroup": 2
}
}And the same thing for other types. As you see, this will be backward incompatible change, but it will make code an configuration more cleaner.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels