krishna kant mishra
02/09/2023, 3:31 PMvchepkov
02/09/2023, 3:31 PMkrishna kant mishra
02/09/2023, 3:41 PMvchepkov
02/09/2023, 3:43 PMvchepkov
02/09/2023, 3:43 PMkrishna kant mishra
02/09/2023, 3:45 PMvchepkov
02/09/2023, 3:46 PMtutelacool
02/09/2023, 4:28 PMmy $version_re = qr/(\d+\.?\d)/;
to :
my $version_re = qr/(\d+\.?\d+)/;
I am using that piece of code on puppet. but no success.
Does anyone have experience with puppet regexes that could give me a boost?
This is the output of the dpkg-query that I am using on the onlyif part.
$ dpkg-query -W -f='${Version}' foo-common
244.rla20.04+1
here the code:
$foo_common_ver = '^244\.rla20\.04\+1$'
exec { 'replace_foo_ctl':
command => "sed -i 's|my \$version_re = qr/(\\d+\\.?\\d)/;|my \$version_re = qr/(\\d+\\.?\\d+)/;|g' /usr/bin/foo_ctl",
onlyif => "dpkg-query -W -f='\${Version}' foo-common | grep -Eq '$foo_common_ver' ",
path => '/bin:/usr/bin:/sbin:/usr/sbin',
refreshonly => true,
}
and my sed seems working here:
# echo "my \$version_re = qr/(\d+\.?\d)/;" | sed -e 's|my \$version_re = qr/(\\d+\\.?\\d)/;|my \$version_re = qr/(\\d+\\.?\\d+)/;|g'
my $version_re = qr/(\d+\.?\d+)/;Slackbot
02/09/2023, 4:29 PMSlackbot
02/09/2023, 4:30 PMtutelacool
02/09/2023, 4:33 PMSkylar Thompson
02/09/2023, 5:01 PMfile_line instead of sed? I have a suspicion that you're running into some problems with escaping of control characters from all of the nested interpolations, and file_line would avoid that, though I certainly agree that it still isn't a great permanent fixLumiere
02/09/2023, 5:10 PMSkylar Thompson
02/09/2023, 5:16 PMSkylar Thompson
02/09/2023, 5:18 PMpatch, which would have the advantage of failing if the target file has drifted from the original targetspin
02/09/2023, 8:11 PMspin
02/09/2023, 8:13 PMKen
02/09/2023, 8:18 PMramindk
02/09/2023, 8:21 PMSlackbot
02/09/2023, 8:23 PMspin
02/09/2023, 8:23 PMKen
02/09/2023, 8:24 PMspin
02/09/2023, 8:26 PMDr Bunsen Honeydew
02/09/2023, 9:45 PMSlackbot
02/09/2023, 9:59 PMSlackbot
02/09/2023, 10:02 PMMassimiliano (Max)
02/09/2023, 11:10 PMCorporate Gadfly
02/10/2023, 12:21 AMfacter -p dmi.manufacturer?
I get Microsoft Corporation.
Full disclosure. None of my azure assets run puppet, at the moment, and I simply installed facter to run this command.binford2k
02/10/2023, 11:01 AMSlackbot
02/10/2023, 12:15 PM