vchepkov
01/12/2023, 8:45 PMbastelfreak
01/12/2023, 8:46 PMcsharpsteen
01/12/2023, 8:49 PMcsharpsteen
01/12/2023, 8:51 PMcsharpsteen
01/12/2023, 9:06 PMDr Bunsen Honeydew
01/12/2023, 9:45 PMSlackbot
01/13/2023, 7:51 AMSlackbot
01/13/2023, 8:55 AMSlackbot
01/13/2023, 9:58 AMDavid Sandilands
01/13/2023, 10:15 AMDavid Sandilands
01/13/2023, 10:15 AMSlackbot
01/13/2023, 1:19 PMNeeloj
01/13/2023, 1:19 PMinit.pp and I want access those variables in mytestclass.pp, I tried like this : $package_name it doesnt work. or notify {"${package_name} is package name": } it doesnt work either.
but the vairables in init.pp are in a case of osfamily. maybe thats why the mytestclass.pp cannot access it ? thank you allNeeloj
01/13/2023, 1:19 PMinit.pp and I want access those variables in mytestclass.pp, I tried like this : $package_name it doesnt work. or notify {"${package_name} is package name": } it doesnt work either. or $::package_name
but the vairables in init.pp are in a case of osfamily. maybe thats why the mytestclass.pp cannot access it ? thank you allNeeloj
01/13/2023, 1:19 PMinit.pp and I want access those variables in mytestclass.pp, I tried like this : $package_name it doesnt work. or notify {"${package_name} is package name": } it doesnt work either. or $::package_name
but the vairables in init.pp are in a case of osfamily. maybe thats why the mytestclass.pp cannot access it ? thank you allNeeloj
01/13/2023, 1:27 PM$classname::package_name in mytestclass.pp
Question: ask further are init.pp and mytestclass.pp both in a module?
Answer: yes both are in a moduleSlackbot
01/13/2023, 2:17 PMcruelsmith
01/13/2023, 2:18 PMmatch function. I try to parse a loaded file (file()) via the match function and capture every block that matches my regex. The regex itself works but my problem is that match stops after the first match.
Is there a flag that i did not found yet or a alternative function that allows a global matching of my regex?Slackbot
01/13/2023, 2:20 PMBrian Schonecker
01/13/2023, 2:21 PMBrian Schonecker
01/13/2023, 2:22 PMvchepkov
01/13/2023, 2:22 PMvchepkov
01/13/2023, 2:22 PMvchepkov
01/13/2023, 2:22 PMSlackbot
01/13/2023, 2:23 PMBrian Schonecker
01/13/2023, 2:23 PMvchepkov
01/13/2023, 2:24 PMvchepkov
01/13/2023, 2:24 PMSlackbot
01/13/2023, 2:25 PMcruelsmith
01/13/2023, 4:03 PMscan() function and wrote now my own puppet function in ruby:
# Matches a pattern against a string and returns an array containing
# every match.
# If the pattern contains no groups, each individual result consists of the
# matched string. If the pattern contains groups, each individual result is
# itself an array containing one entry per group.
#
# @see <https://apidock.com/ruby/String/scan>
#
Puppet::Functions.create_function(:scan) do
dispatch :scan do
param 'String', :string
param 'Variant[String,Regexp]', :Pattern
return_type 'Array'
end
def scan(string, pattern)
string.scan(pattern)
end
end