Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions inventory/any.cf
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,11 @@ bundle agent cfe_autorun_inventory_packages
fileexists("$(sys.workdir)/state/software_packages.csv"),
};

"use_package_module_for_inventory" or => { "redhat", "debian", "suse", "sles", "alpinelinux", "windows" };
"use_package_module_for_inventory" -> { "ENT-13525" }
expression => some (".*", "@(default:control_common.package_inventory)"),
comment => concat( "If body common control defines package_inventory then the system",
" is using package modules for inventory");

"use_package_method_for_inventory" or => { "gentoo", "aix" };
"use_package_method_generic_for_inventory"
not => "use_package_module_for_inventory|use_package_method_for_inventory";
Expand Down Expand Up @@ -1151,7 +1155,6 @@ bundle agent cfe_autorun_inventory_packages
"DEBUG $(this.bundle): we don't have the inventory files."
if => "!have_inventory";
}

bundle agent cfe_autorun_inventory_policy_servers
# @brief Inventory policy servers
{
Expand Down
17 changes: 15 additions & 2 deletions tests/acceptance/17_packages/11_old/unsafe/12_packagesmatching.cf
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,31 @@ body common control

bundle agent init
{
vars:

# if we have the patches, 7 days; otherwise keep trying
"refresh" string => ifelse("have_inventory", "10080",
"0");
classes:
"have_patches" or => { "community_edition", # not in Community
fileexists("$(sys.workdir)/state/software_patches_avail.csv") };

"have_inventory" and => { "have_patches",
fileexists("$(sys.workdir)/state/software_packages.csv"),
};

packages:
# Old way of forcing package updates, for the legacy packages promise.
debian::
"cfe_internal_non_existing_package"
package_policy => "add",
package_method => inventory_apt_get($(cfe_autorun_inventory_packages.refresh)),
package_method => inventory_apt_get($(refresh)),
action => if_elapsed_day;

redhat::
"cfe_internal_non_existing_package"
package_policy => "add",
package_method => inventory_yum_rpm($(cfe_autorun_inventory_packages.refresh)),
package_method => inventory_yum_rpm($(refresh)),
action => if_elapsed_day;

vars:
Expand Down
17 changes: 15 additions & 2 deletions tests/acceptance/17_packages/11_old/unsafe/package-inventory.cf
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,31 @@ bundle agent init

bundle agent test
{
vars:

# if we have the patches, 7 days; otherwise keep trying
"refresh" string => ifelse("have_inventory", "10080",
"0");
classes:
"have_patches" or => { "community_edition", # not in Community
fileexists("$(sys.workdir)/state/software_patches_avail.csv") };

"have_inventory" and => { "have_patches",
fileexists("$(sys.workdir)/state/software_packages.csv"),
};

packages:
# Old way of forcing package updates, for the legacy packages promise.
debian::
"cfe_internal_non_existing_package"
package_policy => "add",
package_method => inventory_apt_get($(cfe_autorun_inventory_packages.refresh)),
package_method => inventory_apt_get($(refresh)),
action => if_elapsed_day;

redhat::
"cfe_internal_non_existing_package"
package_policy => "add",
package_method => inventory_yum_rpm($(cfe_autorun_inventory_packages.refresh)),
package_method => inventory_yum_rpm($(refresh)),
action => if_elapsed_day;

methods:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,31 @@ body common control

bundle agent init
{
vars:

# if we have the patches, 7 days; otherwise keep trying
"refresh" string => ifelse("have_inventory", "10080",
"0");
classes:
"have_patches" or => { "community_edition", # not in Community
fileexists("$(sys.workdir)/state/software_patches_avail.csv") };

"have_inventory" and => { "have_patches",
fileexists("$(sys.workdir)/state/software_packages.csv"),
};

packages:
# Old way of forcing package updates, for the legacy packages promise.
debian::
"cfe_internal_non_existing_package"
package_policy => "add",
package_method => inventory_apt_get($(cfe_autorun_inventory_packages.refresh)),
package_method => inventory_apt_get($(refresh)),
action => if_elapsed_day;

redhat::
"cfe_internal_non_existing_package"
package_policy => "add",
package_method => inventory_yum_rpm($(cfe_autorun_inventory_packages.refresh)),
package_method => inventory_yum_rpm($(refresh)),
action => if_elapsed_day;
}

Expand Down