diff --git a/initial-promises/node-server/common/1.0/site.cf b/initial-promises/node-server/common/1.0/site.cf index 5810cd323..948e7796c 100644 --- a/initial-promises/node-server/common/1.0/site.cf +++ b/initial-promises/node-server/common/1.0/site.cf @@ -36,6 +36,7 @@ vars: "rudder_base_sbin_arg" string => "$(sys.winprogdir)\Rudder\sbin"; # for the installer command line "rudder_dependencies" string => "$(rudder_sbin)"; "escaped_workdir" string => escape("$(sys.workdir)"); + "rudder_curl" string => "$(rudder_base_sbin)\curl\curl.exe"; # The time at which the execution started "execRun" string => execresult("\"${g.rudder_sbin}\getDate.bat\"", "noshell"); diff --git a/initial-promises/node-server/inventory/1.0/fusionAgent.cf b/initial-promises/node-server/inventory/1.0/fusionAgent.cf index 890506581..81487ec81 100644 --- a/initial-promises/node-server/inventory/1.0/fusionAgent.cf +++ b/initial-promises/node-server/inventory/1.0/fusionAgent.cf @@ -130,7 +130,7 @@ bundle agent fusionAgent { comment => "Installing xen package for extended data"; commands: - !android.linux.inventoryfoldercreated:: + (android|linux).inventoryfoldercreated:: "${g.rudder_base}/bin/run-inventory --local=${g.rudder_var_tmp}/inventory --scan-homedirs", classes => cf2_if_else("run_inventory", "inventory_failed"), comment => "Generating inventory, in the temporary folder"; @@ -331,6 +331,7 @@ bundle agent addInformationsToInventory { "android_name" string => "Android"; "android_version" string => execresult("/system/bin/getprop ro.build.version.release", "noshell"); "android_fullname" string => "Android $(android_version)"; + "logdate" string => execresult("/system/bin/date '+%Y-%m-%d %H:%M:%S'", "noshell"); classes: xen:: @@ -367,6 +368,10 @@ bundle agent addInformationsToInventory { edit_line => add_information_to_android_inventory($(android_fullname), $(android_kernelname), $(android_kernelversion), $(android_name), $(android_version)), edit_defaults => def_no_backup; + "${g.rudder_var_tmp}/inventory/.*.ocs" + edit_line => add_accesslog_to_android_inventory($(logdate)), + edit_defaults => def_no_backup; + } # Move the inventory file in the shared directory @@ -485,6 +490,20 @@ insert_lines: } +#this bundle is necessary for OCSInventory (but not for fusioninventory) +bundle edit_line add_accesslog_to_android_inventory(logdate) +{ +insert_lines: + + android:: + + "$(logdate)" + location => after_location(""), + comment => "Adding log date"; + +} + + bundle edit_line add_users_information_to_inventory(userlist) { insert_lines: diff --git a/techniques/fileConfiguration/fileManagement/1.0/manageFilesAndFolders.st b/techniques/fileConfiguration/fileManagement/1.0/manageFilesAndFolders.st index ca74d1092..91d49c4ae 100644 --- a/techniques/fileConfiguration/fileManagement/1.0/manageFilesAndFolders.st +++ b/techniques/fileConfiguration/fileManagement/1.0/manageFilesAndFolders.st @@ -174,7 +174,7 @@ bundle agent manageFilesAndFolders { reports: - (linux|windows):: + (linux|!linux):: # Reporting for directory creation "@@manageFilesAndFolders@@result_success@@$(file[$(index)][uuid])@@File@@$(file[$(index)][path])@@$(g.execRun)##$(g.uuid)@#The folder $(file[$(index)][path]) already exists" diff --git a/techniques/fileConfiguration/fileManagement/1.1/manageFilesAndFolders.st b/techniques/fileConfiguration/fileManagement/1.1/manageFilesAndFolders.st index ac6a9d346..dda0d337f 100644 --- a/techniques/fileConfiguration/fileManagement/1.1/manageFilesAndFolders.st +++ b/techniques/fileConfiguration/fileManagement/1.1/manageFilesAndFolders.st @@ -177,7 +177,7 @@ bundle agent manageFilesAndFolders { reports: - (linux|windows):: + (linux|!linux):: # Reporting for directory creation "@@manageFilesAndFolders@@result_success@@$(file[$(index)][uuid])@@File@@$(file[$(index)][path])@@$(g.execRun)##$(g.uuid)@#The folder $(file[$(index)][path]) already exists" diff --git a/techniques/fileDistribution/checkGenericFileContent/1.0/checkGenericFileContent.st b/techniques/fileDistribution/checkGenericFileContent/1.0/checkGenericFileContent.st index 4030eae1e..51104bc32 100644 --- a/techniques/fileDistribution/checkGenericFileContent/1.0/checkGenericFileContent.st +++ b/techniques/fileDistribution/checkGenericFileContent/1.0/checkGenericFileContent.st @@ -74,7 +74,7 @@ classes: ifvarclass => "content_$(index)_modified.execute_command_$(index).!content_$(index)_failed"; reports: - (linux|windows):: + (linux|!linux):: "@@checkGenericFileContent@@result_success@@$(generic_file_content_uuid[$(index)])@@File@@$(generic_file_content_path[$(index)])@@$(g.execRun)##$(g.uuid)@#The file $(generic_file_content_path[$(index)]) was already in accordance with the policy" ifvarclass => "content_$(index)_kept.!content_$(index)_modified"; diff --git a/techniques/fileDistribution/checkGenericFileContent/2.0/checkGenericFileContent.st b/techniques/fileDistribution/checkGenericFileContent/2.0/checkGenericFileContent.st index a2edac27f..6a64bad68 100644 --- a/techniques/fileDistribution/checkGenericFileContent/2.0/checkGenericFileContent.st +++ b/techniques/fileDistribution/checkGenericFileContent/2.0/checkGenericFileContent.st @@ -82,7 +82,7 @@ classes: ifvarclass => "content_$(index)_modified.execute_command_$(index).!content_$(index)_failed"; reports: - (linux|windows):: + (linux|!linux):: # Files edition "@@checkGenericFileContent@@result_success@@$(generic_file_content_uuid[$(index)])@@File@@$(generic_file_content_path[$(index)])@@$(g.execRun)##$(g.uuid)@#The file $(generic_file_content_path[$(index)]) was already in accordance with the policy" diff --git a/techniques/fileDistribution/checkGenericFileContent/2.1/checkGenericFileContent.st b/techniques/fileDistribution/checkGenericFileContent/2.1/checkGenericFileContent.st index 19e911460..afd411b7d 100644 --- a/techniques/fileDistribution/checkGenericFileContent/2.1/checkGenericFileContent.st +++ b/techniques/fileDistribution/checkGenericFileContent/2.1/checkGenericFileContent.st @@ -141,7 +141,7 @@ classes: reports: - (linux|windows).tier2:: + tier2:: # Files edition "@@checkGenericFileContent@@result_success@@$(generic_file_content_uuid[$(index)])@@File@@$(generic_file_content_path[$(index)])@@$(g.execRun)##$(g.uuid)@#The file $(generic_file_content_path[$(index)]) was already in accordance with the policy" diff --git a/techniques/fileDistribution/checkGenericFileContent/3.0/checkGenericFileContent.st b/techniques/fileDistribution/checkGenericFileContent/3.0/checkGenericFileContent.st index bcbd275e2..9f9d8262a 100644 --- a/techniques/fileDistribution/checkGenericFileContent/3.0/checkGenericFileContent.st +++ b/techniques/fileDistribution/checkGenericFileContent/3.0/checkGenericFileContent.st @@ -120,7 +120,7 @@ classes: reports: - (linux|windows).tier2:: + tier2:: # Files edition "@@checkGenericFileContent@@result_success@@$(generic_file_content_uuid[$(index)])@@File@@$(generic_file_content_path[$(index)])@@$(g.execRun)##$(g.uuid)@#The file $(generic_file_content_path[$(index)]) was already in accordance with the policy" diff --git a/techniques/fileDistribution/checkGenericFileContent/3.1/checkGenericFileContent.st b/techniques/fileDistribution/checkGenericFileContent/3.1/checkGenericFileContent.st index c35654110..062cdec9c 100644 --- a/techniques/fileDistribution/checkGenericFileContent/3.1/checkGenericFileContent.st +++ b/techniques/fileDistribution/checkGenericFileContent/3.1/checkGenericFileContent.st @@ -141,7 +141,7 @@ classes: reports: - (linux|windows).tier2:: + tier2:: # Files edition "@@checkGenericFileContent@@result_success@@$(generic_file_content_uuid[$(index)])@@File@@$(generic_file_content_path[$(index)])@@$(g.execRun)##$(g.uuid)@#The file $(generic_file_content_path[$(index)]) was already in accordance with the policy" diff --git a/techniques/fileDistribution/checkGenericFileContent/3.2/checkGenericFileContent.st b/techniques/fileDistribution/checkGenericFileContent/3.2/checkGenericFileContent.st index 793e46c4d..73dac1286 100644 --- a/techniques/fileDistribution/checkGenericFileContent/3.2/checkGenericFileContent.st +++ b/techniques/fileDistribution/checkGenericFileContent/3.2/checkGenericFileContent.st @@ -150,7 +150,7 @@ classes: reports: - (linux|windows).tier2:: + tier2:: # Files edition "@@checkGenericFileContent@@result_success@@$(generic_file_content_uuid[$(index)])@@File@@$(generic_file_content_path[$(index)])@@$(g.execRun)##$(g.uuid)@#The file $(generic_file_content_path[$(index)]) was already in accordance with the policy" diff --git a/techniques/fileDistribution/copyGitFile/1.1/copyFileFromSharedFolder.st b/techniques/fileDistribution/copyGitFile/1.1/copyFileFromSharedFolder.st index 93bdb0b19..2e0e0f40f 100644 --- a/techniques/fileDistribution/copyGitFile/1.1/copyFileFromSharedFolder.st +++ b/techniques/fileDistribution/copyGitFile/1.1/copyFileFromSharedFolder.st @@ -77,7 +77,7 @@ bundle agent download_from_shared_folder { reports: - linux|windows:: + linux|!linux:: "@@copyFile@@result_error@@$(copyfile[$(index)][uuid])@@Copy file@@$(copyfile[$(index)][name])@@$(g.execRun)##$(g.uuid)@#There is no shared folder on the Rudder Server, so it's not possible to copy a file from it" ifvarclass => "!is_valid"; diff --git a/techniques/fileDistribution/copyGitFile/1.2/copyFileFromSharedFolder.st b/techniques/fileDistribution/copyGitFile/1.2/copyFileFromSharedFolder.st index ef5e7dc39..fbf4fd229 100644 --- a/techniques/fileDistribution/copyGitFile/1.2/copyFileFromSharedFolder.st +++ b/techniques/fileDistribution/copyGitFile/1.2/copyFileFromSharedFolder.st @@ -80,7 +80,7 @@ bundle agent download_from_shared_folder { reports: - linux|windows:: + linux|!linux:: "@@copyFile@@result_error@@$(copyfile[$(index)][uuid])@@Copy file@@$(copyfile[$(index)][name])@@$(g.execRun)##$(g.uuid)@#There is no shared folder on the Rudder Server, so it's not possible to copy a file from it" ifvarclass => "!is_valid"; diff --git a/techniques/fileDistribution/copyGitFile/1.3/copyFileFromSharedFolder.st b/techniques/fileDistribution/copyGitFile/1.3/copyFileFromSharedFolder.st index 94ecd2783..2a31f045b 100644 --- a/techniques/fileDistribution/copyGitFile/1.3/copyFileFromSharedFolder.st +++ b/techniques/fileDistribution/copyGitFile/1.3/copyFileFromSharedFolder.st @@ -93,7 +93,7 @@ bundle agent download_from_shared_folder { comment => "Execute the posthook command if a file was changed"; reports: - linux|windows:: + linux|!linux:: "@@copyFile@@result_error@@$(copyfile[$(index)][uuid])@@Copy file@@$(copyfile[$(index)][name])@@$(g.execRun)##$(g.uuid)@#There is no shared folder on the Rudder Server, so it's not possible to copy a file from it" ifvarclass => "!is_valid"; diff --git a/techniques/fileDistribution/downloadFile/1.0/downloadFile.st b/techniques/fileDistribution/downloadFile/1.0/downloadFile.st index c8fa15c0f..24739109f 100644 --- a/techniques/fileDistribution/downloadFile/1.0/downloadFile.st +++ b/techniques/fileDistribution/downloadFile/1.0/downloadFile.st @@ -29,21 +29,15 @@ classes: commands: - linux.file_not_found:: - "/usr/bin/curl" - args => "-f -o \"&DOWNLOADFILE_DESTINATION&\" &DOWNLOADFILE_SOURCE&", - comment => "Getting the file from the server", - classes => kept_if_else("file_download_idle", "file_download_ok", "file_download_fail"); - - windows.file_not_found:: - "\"${g.rudder_base_sbin}\curl\curl.exe\"" - args => "-f -o \"&DOWNLOADFILE_DESTINATION&\" &DOWNLOADFILE_SOURCE&", + file_not_found:: + "\"${g.rudder_curl}\"" +args => "-f -o \"&DOWNLOADFILE_DESTINATION&\" &DOWNLOADFILE_SOURCE&", comment => "Getting the file from the server", classes => kept_if_else("file_download_idle", "file_download_ok", "file_download_fail"); files: - linux:: + (android|linux):: "&DOWNLOADFILE_DESTINATION&" pathtype => "literal", # force literal interpretation perms => mog("&DOWNLOADFILE_MODE&","&DOWNLOADFILE_USER&","&DOWNLOADFILE_GROUP&"), @@ -75,7 +69,7 @@ reports: !file_not_found.file_perms_idle:: "@@downloadFile@@result_success@@&TRACKINGKEY&@@downloadFile@@None@@$(g.execRun)##$(g.uuid)@#File &DOWNLOADFILE_SOURCE& already present with correct permissions" - ifvarclass => "linux"; + ifvarclass => "android|linux"; !file_not_found:: "@@downloadFile@@result_success@@&TRACKINGKEY&@@downloadFile@@None@@$(g.execRun)##$(g.uuid)@#File &DOWNLOADFILE_SOURCE& already present with correct permissions" diff --git a/techniques/jobScheduling/jobScheduler/1.0/job_scheduler.st b/techniques/jobScheduling/jobScheduler/1.0/job_scheduler.st index 628efadf2..f4a2a9e35 100644 --- a/techniques/jobScheduling/jobScheduler/1.0/job_scheduler.st +++ b/techniques/jobScheduling/jobScheduler/1.0/job_scheduler.st @@ -71,7 +71,7 @@ bundle agent job_scheduler { "@(job_scheduler.error_returncodes_$(iterator))"); reports: - (linux|windows).nos2:: + nos2:: # Note: if the command has not been executed (ever or since > frequency), no report will be sent until the splayclass is defined # This will cause Rudder to report an "Unknown" status, and is by design "@@jobScheduler@@result_success@@$(job_scheduler_uuids[$(iterator)])@@Job@@$(job_scheduler_command[$(iterator)])@@$(g.execRun)##$(g.uuid)@#Job returned a success return code after the last completed execution ($(job_scheduler_command[$(iterator)]))" diff --git a/techniques/system/common/1.0/site.st b/techniques/system/common/1.0/site.st index 61e7e9664..363e69201 100644 --- a/techniques/system/common/1.0/site.st +++ b/techniques/system/common/1.0/site.st @@ -36,6 +36,7 @@ vars: "rudder_base_sbin_arg" string => "$(sys.winprogdir)\Rudder\sbin"; # for the installer command line "rudder_dependencies" string => "$(rudder_sbin)"; "escaped_workdir" string => escape("$(sys.workdir)"); + "rudder_curl" string => "$(rudder_base_sbin)\curl\curl.exe"; # The time at which the execution started "execRun" string => execresult("\"${g.rudder_sbin}\getDate.bat\"", "noshell"); diff --git a/techniques/system/inventory/1.0/fusionAgent.st b/techniques/system/inventory/1.0/fusionAgent.st index c2a5bcad6..0236f3cd7 100644 --- a/techniques/system/inventory/1.0/fusionAgent.st +++ b/techniques/system/inventory/1.0/fusionAgent.st @@ -144,7 +144,7 @@ bundle agent fusionAgent { comment => "Installing xen package for extended data"; commands: - !android.linux.inventoryfoldercreated:: + (android|linux).inventoryfoldercreated:: "${g.rudder_base}/bin/run-inventory --local=${g.rudder_var_tmp}/inventory --scan-homedirs", classes => cf2_if_else("run_inventory", "inventory_failed"), comment => "Generating inventory, in the temporary folder"; @@ -345,6 +345,7 @@ bundle agent addInformationsToInventory { "android_name" string => "Android"; "android_version" string => execresult("/system/bin/getprop ro.build.version.release", "noshell"); "android_fullname" string => "Android $(android_version)"; + "logdate" string => execresult("/system/bin/date '+%Y-%m-%d %H:%M:%S'", "noshell"); classes: @@ -381,6 +382,9 @@ bundle agent addInformationsToInventory { edit_line => add_information_to_android_inventory($(android_fullname), $(android_kernelname), $(android_kernelversion), $(android_name), $(android_version)), edit_defaults => def_no_backup; + "${g.rudder_var_tmp}/inventory/.*.ocs" + edit_line => add_accesslog_to_android_inventory($(logdate)), + edit_defaults => def_no_backup; } @@ -495,11 +499,24 @@ insert_lines: android:: "$(const.n)$(fullname)$(const.n)$(kernelname)$(const.n)$(kernelversion)$(const.n)$(name)$(const.n)$(version)$(const.n)" - location => after_location(""), + location => after_location(""), comment => "Adding the list of OPERATINGSYSTEM part"; } +#this bundle is necessary for OCSInventory (but not for fusioninventory) +bundle edit_line add_accesslog_to_android_inventory(logdate) +{ +insert_lines: + + android:: + + "$(logdate)" + location => after_location(""), + comment => "Adding log date"; + +} + bundle edit_line add_users_information_to_inventory(userlist) { insert_lines: