bundle agent inventory { vars: any:: "inventory_dir" string => "$(sys.workdir)/inventory"; am_policy_hub:: "data_dir" string => "$(sys.workdir)/inventory_data"; "lastseen" slist => { hostsseen( "2", "lastseen", "address" ) }; "clients" slist => { "$(sys.policy_hub)", "@(lastseen)" }; files: any:: "$(inventory_dir)/." create => "true", perms => system_owned("700"), classes => if_repaired("inventory_folder_repaired"); "$(inventory_dir)/host_info_report" create => "true", perms => system_owned("400"), edit_template => "$(sys.inputdir)/templates/inventory/host_info_report.mustache", template_method => "mustache"; am_policy_hub:: "$(data_dir)/." create => "true", perms => system_owned("700"), classes => if_repaired("inventory_data_folder_repaired"); methods: am_policy_hub:: "any" usebundle => bg_inventory_get("$(data_dir)", "$(clients)"), action => bg("5", "5"); reports: any:: "$(this.bundle): $(inventory_dir) folder repaired" ifvarclass => "inventory_folder_repaired"; "$(this.bundle): $(data_dir) folder repaired" ifvarclass => "inventory_data_folder_repaired"; } bundle agent bg_inventory_get(download_dir, clients) { files: "$(download_dir)/$(clients)" copy_from => remote_dcp("inventory", "$(clients)"), depth_search => recurse("inf"), perms => m("400"); }