Tyler Maclean
09/22/2022, 4:11 PMfile { "a": owner => 'Alice'}
and file {'b': owner => 'Bob'}
, can I get an array of ['Alice', 'Bob']
? I want to conditionally create some resources based on the unique set of params from another set of resources. I found a way to do it using ensure_resource from stdlib but it feels clunky and wrong.hbui
09/22/2022, 4:22 PMhbui
09/22/2022, 4:23 PMRobert Vincent
09/22/2022, 4:34 PMDr Bunsen Honeydew
09/22/2022, 4:34 PMRobert Vincent
09/22/2022, 4:35 PMRobert Vincent
09/22/2022, 4:35 PMDr Bunsen Honeydew
09/22/2022, 4:35 PMRobert Vincent
09/22/2022, 4:35 PMhbui
09/22/2022, 4:38 PMTyler Maclean
09/22/2022, 4:43 PMSlackbot
09/22/2022, 5:44 PMDr Bunsen Honeydew
09/22/2022, 5:45 PMSlackbot
09/22/2022, 8:23 PMnate
09/22/2022, 8:23 PMnate
09/22/2022, 8:24 PMRobert Vincent
09/22/2022, 8:42 PM:option => 1
instead of option: 1
?Dr Bunsen Honeydew
09/22/2022, 8:45 PMsmortex
09/22/2022, 9:18 PMn3snah
09/23/2022, 12:45 AMn3snah
09/23/2022, 12:45 AMnatemccurdy
09/23/2022, 12:51 AMnatemccurdy
09/23/2022, 12:52 AMlet(:pre_condition) { 'user { "nate": }' }
n3snah
09/23/2022, 12:53 AMn3snah
09/23/2022, 1:13 AMn3snah
09/23/2022, 1:27 AMexpected that the catalogue would contain Package[powershell-yaml] with require set to "Psrepository['PSGallery']" but it is set to Psrepository[PSGallery]{:name=>"PSGallery"}
I don't understand what this is trying to say and how to fix it. It should be the same.
spec file
it do
<http://is_expected.to|is_expected.to> contain_package('powershell-yaml').with(
'ensure' => '0.4.3',
'provider' => 'windowspowershell',
'source' => 'PSGallery',
'require' => "Psrepository['PSGallery']",
)
end
Manifest
package { 'powershell-yaml':
ensure => '0.4.3',
provider => 'windowspowershell',
source => 'PSGallery',
require => Psrepository['PSGallery']
}
natemccurdy
09/23/2022, 1:28 AMnatemccurdy
09/23/2022, 1:29 AM.that_requires('Psrepository[PSGallery]')
rather than putting require
in the with()
statement.n3snah
09/23/2022, 1:29 AMnatemccurdy
09/23/2022, 1:30 AM.that_requires()
is a helper that extracts the name of the resource into a more easily referencable thing.