Closed logicminds closed 6 years ago
Install_hash parameter should accept arrays. I would expect that when I use hieradata to specify multiple apps I want installed that I can easily supply an array.
Example:
tp::install_hash: - redis - bash - iotop
install_hash is limited to just hashes.
tp::install_hash: redis: ensure: present bash: ensure: present iotop: ensure: present
If we change the datatype to Variant[Hash,Array[String]] we can at least accept both hashes and arrays.
Variant[Hash,Array[String]]
Furthermore, we would also have to do something like:
if $install_hash =~ Array { $installables = $install_hash.map | $name| { tp_install($name, {ensure => present}) } } else { $installables = $install_hash.map | $name, $options| { tp_install($name, $options) } }
+1 for me, PR welcomed. I suppose you mean .each instead of .map when the variables is not an Array.
I did mean map but only for debugging purposes. We probably don't need an array of what was processed.
Expected Behavior
Install_hash parameter should accept arrays. I would expect that when I use hieradata to specify multiple apps I want installed that I can easily supply an array.
Example:
Actual Behavior
install_hash is limited to just hashes.
Possible Fix
If we change the datatype to
Variant[Hash,Array[String]]
we can at least accept both hashes and arrays.Furthermore, we would also have to do something like: