Skip to content

Commit 8d00528

Browse files
committed
Removed cfe_autorun_inventory_packages
Prior to the introduction of package promise modules CFEngine would This bundle was originally introduced to ensure that CFEngine Enterprise had software inventory reported immediately after initial install using the default policy set. With the package_module implementation mature, there is no longer need to have a packages promise for a fake package to trigger software inventory data to be reported so it has been removed. Unsupported platforms that do not have a default package module for inventory supplied will no longer have software inventory and will not be able to leverage the packagesmatching() functions unless there is an explicit package promise made. Ticket: ENT-13525 Changelog: Commit
1 parent 5f14be4 commit 8d00528

4 files changed

Lines changed: 45 additions & 69 deletions

File tree

inventory/any.cf

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ bundle agent inventory_autorun
4040
"LLDP" usebundle => cfe_autorun_inventory_LLDP(),
4141
handle => "cfe_internal_autorun_inventory_LLDP";
4242

43-
!disable_inventory_package_refresh::
44-
"packages_refresh" usebundle => cfe_autorun_inventory_packages(),
45-
handle => "cfe_internal_autorun_inventory_packages";
46-
4743
!disable_inventory_policy_servers::
4844
"Inventory Policy Servers"
4945
handle => "cfe_internal_autorun_inventory_policy_servers",
@@ -1093,65 +1089,6 @@ bundle agent cfe_autorun_inventory_LLDP
10931089
lldpctl is customized via augments";
10941090
}
10951091

1096-
bundle agent cfe_autorun_inventory_packages
1097-
# @brief Package inventory auto-refresh
1098-
#
1099-
# This bundle is for refreshing the package inventory. It runs on
1100-
# startup, unless disabled. Other package methods can be added below.
1101-
{
1102-
classes:
1103-
"have_patches" or => { "community_edition", # not in Community
1104-
fileexists("$(sys.workdir)/state/software_patches_avail.csv") };
1105-
1106-
"have_inventory" and => { "have_patches",
1107-
fileexists("$(sys.workdir)/state/software_packages.csv"),
1108-
};
1109-
1110-
"use_package_module_for_inventory" or => { "redhat", "debian", "suse", "sles", "alpinelinux", "windows" };
1111-
"use_package_method_for_inventory" or => { "gentoo", "aix" };
1112-
"use_package_method_generic_for_inventory"
1113-
not => "use_package_module_for_inventory|use_package_method_for_inventory";
1114-
1115-
vars:
1116-
# if we have the patches, 7 days; otherwise keep trying
1117-
"refresh" string => ifelse("have_inventory", "10080",
1118-
"0");
1119-
1120-
packages:
1121-
1122-
# The legacy implementation (package_method) of the packages type promise
1123-
# requires a packages promise to be triggered in order to generate package
1124-
# inventory. The following promises ensure that package inventory data
1125-
# exists. As package modules become available the package_methods should be
1126-
# removed.
1127-
1128-
aix::
1129-
"cfe_internal_non_existing_package"
1130-
package_policy => "add",
1131-
package_method => inventory_lslpp($(refresh)),
1132-
action => if_elapsed_day;
1133-
1134-
gentoo::
1135-
"cfe_internal_non_existing_package"
1136-
package_policy => "add",
1137-
package_method => emerge,
1138-
action => if_elapsed_day;
1139-
1140-
use_package_method_generic_for_inventory::
1141-
"cfe_internal_non_existing_package"
1142-
package_policy => "add",
1143-
package_method => generic,
1144-
action => if_elapsed_day;
1145-
1146-
reports:
1147-
DEBUG|DEBUG_cfe_autorun_inventory_packages::
1148-
"DEBUG $(this.bundle): refresh interval is $(refresh)";
1149-
"DEBUG $(this.bundle): we have the inventory files."
1150-
if => "have_inventory";
1151-
"DEBUG $(this.bundle): we don't have the inventory files."
1152-
if => "!have_inventory";
1153-
}
1154-
11551092
bundle agent cfe_autorun_inventory_policy_servers
11561093
# @brief Inventory policy servers
11571094
{

tests/acceptance/17_packages/11_old/unsafe/12_packagesmatching.cf

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,31 @@ body common control
3131

3232
bundle agent init
3333
{
34+
vars:
35+
36+
# if we have the patches, 7 days; otherwise keep trying
37+
"refresh" string => ifelse("have_inventory", "10080",
38+
"0");
39+
classes:
40+
"have_patches" or => { "community_edition", # not in Community
41+
fileexists("$(sys.workdir)/state/software_patches_avail.csv") };
42+
43+
"have_inventory" and => { "have_patches",
44+
fileexists("$(sys.workdir)/state/software_packages.csv"),
45+
};
46+
3447
packages:
3548
# Old way of forcing package updates, for the legacy packages promise.
3649
debian::
3750
"cfe_internal_non_existing_package"
3851
package_policy => "add",
39-
package_method => inventory_apt_get($(cfe_autorun_inventory_packages.refresh)),
52+
package_method => inventory_apt_get($(refresh)),
4053
action => if_elapsed_day;
4154

4255
redhat::
4356
"cfe_internal_non_existing_package"
4457
package_policy => "add",
45-
package_method => inventory_yum_rpm($(cfe_autorun_inventory_packages.refresh)),
58+
package_method => inventory_yum_rpm($(refresh)),
4659
action => if_elapsed_day;
4760

4861
vars:

tests/acceptance/17_packages/11_old/unsafe/package-inventory.cf

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,31 @@ bundle agent init
2828

2929
bundle agent test
3030
{
31+
vars:
32+
33+
# if we have the patches, 7 days; otherwise keep trying
34+
"refresh" string => ifelse("have_inventory", "10080",
35+
"0");
36+
classes:
37+
"have_patches" or => { "community_edition", # not in Community
38+
fileexists("$(sys.workdir)/state/software_patches_avail.csv") };
39+
40+
"have_inventory" and => { "have_patches",
41+
fileexists("$(sys.workdir)/state/software_packages.csv"),
42+
};
43+
3144
packages:
3245
# Old way of forcing package updates, for the legacy packages promise.
3346
debian::
3447
"cfe_internal_non_existing_package"
3548
package_policy => "add",
36-
package_method => inventory_apt_get($(cfe_autorun_inventory_packages.refresh)),
49+
package_method => inventory_apt_get($(refresh)),
3750
action => if_elapsed_day;
3851

3952
redhat::
4053
"cfe_internal_non_existing_package"
4154
package_policy => "add",
42-
package_method => inventory_yum_rpm($(cfe_autorun_inventory_packages.refresh)),
55+
package_method => inventory_yum_rpm($(refresh)),
4356
action => if_elapsed_day;
4457

4558
methods:

tests/acceptance/17_packages/11_old/unsafe/timed/inventory_packages_update_frequency.cf

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,31 @@ body common control
1313

1414
bundle agent init
1515
{
16+
vars:
17+
18+
# if we have the patches, 7 days; otherwise keep trying
19+
"refresh" string => ifelse("have_inventory", "10080",
20+
"0");
21+
classes:
22+
"have_patches" or => { "community_edition", # not in Community
23+
fileexists("$(sys.workdir)/state/software_patches_avail.csv") };
24+
25+
"have_inventory" and => { "have_patches",
26+
fileexists("$(sys.workdir)/state/software_packages.csv"),
27+
};
28+
1629
packages:
1730
# Old way of forcing package updates, for the legacy packages promise.
1831
debian::
1932
"cfe_internal_non_existing_package"
2033
package_policy => "add",
21-
package_method => inventory_apt_get($(cfe_autorun_inventory_packages.refresh)),
34+
package_method => inventory_apt_get($(refresh)),
2235
action => if_elapsed_day;
2336

2437
redhat::
2538
"cfe_internal_non_existing_package"
2639
package_policy => "add",
27-
package_method => inventory_yum_rpm($(cfe_autorun_inventory_packages.refresh)),
40+
package_method => inventory_yum_rpm($(refresh)),
2841
action => if_elapsed_day;
2942
}
3043

0 commit comments

Comments
 (0)