diff options
author | Julien Dessaux | 2018-05-04 15:19:35 +0200 |
---|---|---|
committer | Julien Dessaux | 2018-05-04 15:19:35 +0200 |
commit | 1bf5f37d28094fc5a929c4072fe0600c1f24eb20 (patch) | |
tree | 44e76c214899d215d631fd785c3feccc32e43b69 | |
parent | Bootstrapped inventory system (diff) | |
download | masterfiles-1bf5f37d28094fc5a929c4072fe0600c1f24eb20.tar.gz masterfiles-1bf5f37d28094fc5a929c4072fe0600c1f24eb20.tar.bz2 masterfiles-1bf5f37d28094fc5a929c4072fe0600c1f24eb20.zip |
Added inventory collection back to policy hub
-rw-r--r-- | services/inventory.cf | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/services/inventory.cf b/services/inventory.cf index 93bd580..933f689 100644 --- a/services/inventory.cf +++ b/services/inventory.cf @@ -1,17 +1,42 @@ 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:: - "$(sys.workdir)/inventory/." + "$(inventory_dir)/." create => "true", perms => system_owned("700"), classes => if_repaired("inventory_folder_repaired"); - "$(sys.workdir)/inventory/host_info_report" + "$(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): $(sys.workdir)/inventory folder repaired" ifvarclass => "inventory_folder_repaired"; + "$(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"); } |