matt
08/31/2022, 9:27 AMmatt
08/31/2022, 9:27 AMmatt
08/31/2022, 10:30 AMmatt
08/31/2022, 10:30 AMvchepkov
08/31/2022, 1:09 PMvchepkov
08/31/2022, 1:09 PMSlackbot
08/31/2022, 3:45 PMSlackbot
08/31/2022, 5:33 PMDr Bunsen Honeydew
08/31/2022, 5:33 PMBrian Schonecker
08/31/2022, 7:11 PM$packages = lookup ("my:packages)
$packages.each | $package, $attributes| {package {$package: * => $attributes}
data/common.yaml:
my_packages:
bash:
ensure: installed
'telnet-server':
ensure: absent
if telnet installed. Unfortunately, I do have a BUNCH of servers in "barcode" profile that does require that "telnet-server" package be installed.
data/application/barcode.yaml:
my_packages:
'telnet-server':
ensure: installed
Obviously, this results in a duplicate resource definition when doing a lookup('my_packages') and Puppet complains. I'd hate to think that I need to take my package installation/removal code from the base profile and then put that package install code in every profile but I'm at a loss as to an easy way and easy-to-understand way to approach this.
Any hints or advice?Brian Schonecker
08/31/2022, 7:11 PM$packages = lookup ("my:packages)
$packages.each | $package, $attributes| {package {$package: * => $attributes}
data/common.yaml:
my_packages:
bash:
ensure: installed
'telnet-server':
ensure: absent
if telnet installed. Unfortunately, I do have a BUNCH of servers in "barcode" profile that does require that "telnet-server" package be installed.
data/application/barcode.yaml:
my_packages:
'telnet-server':
ensure: installed
Obviously, this results in a duplicate resource definition when doing a lookup('my_packages') and Puppet complains. I'd hate to think that I need to take my package installation/removal code from the base profile and then put that package install code in every profile but I'm at a loss as to an easy way and easy-to-understand way to approach this.
Any hints or advice?Brian Schonecker
08/31/2022, 7:13 PMBrian Schonecker
08/31/2022, 7:13 PMBrian Schonecker
08/31/2022, 7:15 PMpackage {'telnet-server': ensure => installed}
so I don't know how to 'filter out' the $my_packages trying to uninstall it.Brian Schonecker
08/31/2022, 7:16 PMpackage {'telnet-server': ensure => installed}
so I don't know how to 'filter out' the $my_packages trying to uninstall it.bastelfreak
08/31/2022, 7:20 PMbastelfreak
08/31/2022, 7:20 PMignore_packages: ['telnet']
in hierahelindbe
08/31/2022, 7:22 PMmy_packages
you set telnet
to install
. and then let hiera do that merge.helindbe
08/31/2022, 7:23 PMBrian Schonecker
08/31/2022, 7:34 PMbastelfreak
08/31/2022, 7:35 PMSlackbot
08/31/2022, 7:35 PMwil.rodriguez
08/31/2022, 10:42 PMif
conditional blocks that are gated by boolean class parameters. This is how we have our CIS profiles set up. Each control has its own resources surrounded by if blocks tied to a class parameter named after the control so we can easily tell at a glance just from hiera which nodes are special snowflakes that violate CIS rules. You can even just set default values for each class parameter and only override in hiera.SlyPig
08/31/2022, 11:19 PMSlackbot
09/01/2022, 4:31 AMZaeem Arshad
09/01/2022, 4:32 AMWITH inactive_nodes AS (SELECT certname FROM certnames WHERE (deactivated IS NOT NULL AND deactivated > '2022-08-18T03:44:46.855Z') OR (expired IS NOT NULL and expired > '2022-08-18T03:44:46.855Z')), not_active_nodes AS (SELECT certname FROM certnames WHERE (deactivated IS NOT NULL OR expired IS NOT NULL)) SELECT certnames.certname AS \"certname\" FROM certnames LEFT JOIN catalogs ON catalogs.certname = certnames.certname LEFT JOIN factsets fs ON certnames.certname = fs.certname LEFT JOIN reports ON (certnames.certname = reports.certname AND certnames.latest_report_id = reports.id) LEFT JOIN environments catalog_environment ON catalog_environment.id = catalogs.environment_id LEFT JOIN report_statuses ON reports.status_id = report_statuses.id LEFT JOIN environments facts_environment ON facts_environment.id = fs.environment_id LEFT JOIN environments reports_environment ON reports_environment.id = reports.environment_id WHERE ((((certnames.certname) in (SELECT certname FROM ( (SELECT fc.certname AS \"certname\" FROM (select certname, flattened.* from factsets fs left join lateral ( with recursive flattened_one (parent_path, parent_types, key, value, type) as ( select array[]::text[], '', (jsonb_each(fs.stable||fs.volatile)).*, 's' union all select parent_path || flattened_one.key, parent_types || flattened_one.type, sub_paths.key, sub_paths.value, sub_paths.type from flattened_one inner join lateral ( select (jsonb_each(value)).*, 's' as type where jsonb_typeof(value) = 'object' union all select generate_series::text as key, value->generate_series as value, 'i' as type from generate_series(0, jsonb_array_length(value) - 1) where jsonb_typeof(value) = 'array' ) as sub_paths on true ) select environment_id, parent_path || key as path, parent_types || type as types, coalesce(parent_path[1], key) as name, value from flattened_one where not jsonb_typeof(value) = any('{\"array\", \"object\"}') ) as flattened on true) fc LEFT JOIN environments env ON fc.environment_id = env.id WHERE ((fc.path = (array['bc_cluster']) and fc.types = 's') AND (jsonb_typeof(\"value\") = $1 AND (value = $2)))) ) sub)) AND ((certnames.certname) in (SELECT certname FROM ( (SELECT fc.certname AS \"certname\" FROM (select certname, flattened.* from factsets fs left join lateral ( with recursive flattened_one (parent_path, parent_types, key, value, type) as ( select array[]::text[], '', (jsonb_each(fs.stable||fs.volatile)).*, 's' union all select parent_path || flattened_one.key, parent_types || flattened_one.type, sub_paths.key, sub_paths.value, sub_paths.type from flattened_one inner join lateral ( select (jsonb_each(value)).*, 's' as type where jsonb_typeof(value) = 'object' union all select generate_series::text as key, value->generate_series as value, 'i' as type from generate_series(0, jsonb_array_length(value) - 1) where jsonb_typeof(value) = 'array' ) as sub_paths on true ) select environment_id, parent_path || key as path, parent_types || type as types, coalesce(parent_path[1], key) as name, value from flattened_one where not jsonb_typeof(value) = any('{\"array\", \"object\"}') ) as flattened on true) fc LEFT JOIN environments env ON fc.environment_id = env.id WHERE ((fc.path = (array['location']) and fc.types = 's') AND (jsonb_typeof(\"value\") = $3 AND (value = $4)))) ) sub))) AND NOT ((certnames.certname) in (SELECT certname FROM ( SELECT not_active_nodes.certname AS \"certname\" FROM not_active_nodes ) sub)))
Has anyone seen something similar before?sameer
09/01/2022, 7:31 AMsameer
09/01/2022, 8:43 AMSlackbot
09/01/2022, 8:54 AMzipkid
09/01/2022, 8:54 AMWarning: The current total number of facts: 5037 exceeds the number of facts limit: 2048