William Myers
10/12/2022, 11:50 PMsmortex
10/13/2022, 1:12 AM$x = "foo\nDebian\nbar"
$x =~ /^Debian$/ #=> true
So you really want:
$x =~ /\ADebian\z/ #=> false
š for @natemccurdy opinion of avoiding Regexp if not necessary š§Slackbot
10/13/2022, 8:57 AMbastelfreak
10/13/2022, 9:08 AMAlex Fisher
10/13/2022, 9:09 AMSlackbot
10/13/2022, 11:03 AMNeeloj
10/13/2022, 11:40 AMcontent => to_json_pretty({
param_one => 'value',
param_two => ['value1'],
}, true),Dr Bunsen Honeydew
10/13/2022, 11:45 AMNeeloj
10/13/2022, 11:45 AM$new_value1= split($value1, ',')Slackbot
10/13/2022, 12:02 PMBrian Schonecker
10/13/2022, 12:04 PMIan CB
10/13/2022, 3:04 PMhelindbe
10/13/2022, 3:34 PMhelindbe
10/13/2022, 3:40 PMSlackbot
10/13/2022, 3:59 PMbastelfreak
10/13/2022, 4:00 PM$facts or fact() to access factsSlackbot
10/13/2022, 4:00 PMtutelacool
10/13/2022, 4:02 PMnatemccurdy
10/13/2022, 4:02 PMjhoblitt
10/13/2022, 4:28 PMjhoblitt
10/13/2022, 4:28 PMjhoblitt
10/13/2022, 4:36 PM[puppetserver] Puppet Evaluation Error: Error while evaluating a Function Call, Duplicate declaration: File[/home/rke] is already declared at (file: /etc/puppetlabs/code/environments/IT_3057_el8/site/profile/manifests/core/rke.pp, line: 38); cannot redeclare (file: /etc/puppetlabs/code/environments/IT_3057_el8/manifests/site.pp, line: 11) (file: /etc/puppetlabs/code/environments/IT_3057_el8/manifests/site.pp, line: 11, column: 3) on node
One is declared in a profile and the other is "supposedly" coming from hiera (via site.pp). However, if I do puppet lookup on the test node, the conflicting file isn't there. There are however files which are below /home/rke.jhoblitt
10/13/2022, 4:38 PM[root@foreman ~]# puppet lookup --node <foo> --facts facts.yaml files | grep "home/rke"
Warning: Undefined variable 'cluster';
(file & line not available)
Warning: Undefined variable '::cluster';
(file & line not available)
"/home/rke/.bash_profile":
"/home/rke/.bashrc":
"/home/rke/.bashrc.d":
"/home/rke/.bashrc.d/vimode.sh":
"/home/rke/.bashrc.d/10_k8s-cookbook-path.sh":
"/home/rke/.bashrc.d/kubeconfig.sh":
"/home/rke/.bashrc.d/etc_bashrc.sh":
"/home/rke/.bashrc.d/kubectl.sh":
"/home/rke/.bashrc.d/git-prompt.sh":natemccurdy
10/13/2022, 4:40 PMmanifests/site.pp?
Fileās donāt just come from hiera⦠there has to be some Puppet code that instantiates those file resources based on data from Hiera. So whatās that Puppet code doing exactly?jhoblitt
10/13/2022, 4:40 PMlookup('classes', Array[String], 'unique').include
$files = lookup(
name => 'files',
value_type => Variant[Hash[String, Hash], Undef],
merge => 'deep',
default_value => undef,
)
#if ($files) {
# ensure_resources('file', $files)
#}
$packages = lookup(
name => 'packages',
value_type => Variant[Array[String], Undef],
merge => 'unique',
default_value => undef,
)
if ($packages) {
ensure_packages($packages)
}jhoblitt
10/13/2022, 4:41 PMnatemccurdy
10/13/2022, 4:41 PMpuppet lookup on the command line is not. Thatās why thereās a discrepency.natemccurdy
10/13/2022, 4:42 PMpuppet lookup --node <foo> --facts facts.yaml --merge deep files | grep "home/rke"natemccurdy
10/13/2022, 4:42 PMpuppet lookup on the command line is not. Thatās why thereās a discrepency.