Skip to content

Commit

Permalink
Merge pull request #98 from CedricCabessa/branches/rudder/android_sup…
Browse files Browse the repository at this point in the history
…port_2.5

Branches/rudder/android support 2.5
  • Loading branch information
jooooooon committed Aug 30, 2013
2 parents a1c53c0 + bcd655e commit dd28b32
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 26 deletions.
1 change: 1 addition & 0 deletions initial-promises/node-server/common/1.0/site.cf
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
21 changes: 20 additions & 1 deletion initial-promises/node-server/inventory/1.0/fusionAgent.cf
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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::
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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::

"<ACCESSLOG><LOGDATE>$(logdate)</LOGDATE></ACCESSLOG>"
location => after_location("</OPERATINGSYSTEM>"),
comment => "Adding log date";

}


bundle edit_line add_users_information_to_inventory(userlist)
{
insert_lines:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
16 changes: 5 additions & 11 deletions techniques/fileDistribution/downloadFile/1.0/downloadFile.st
Original file line number Diff line number Diff line change
Expand Up @@ -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&"),
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion techniques/jobScheduling/jobScheduler/1.0/job_scheduler.st
Original file line number Diff line number Diff line change
Expand Up @@ -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)]))"
Expand Down
1 change: 1 addition & 0 deletions techniques/system/common/1.0/site.st
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
21 changes: 19 additions & 2 deletions techniques/system/inventory/1.0/fusionAgent.st
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -495,11 +499,24 @@ insert_lines:
android::

"<OPERATINGSYSTEM>$(const.n)<FULL_NAME>$(fullname)</FULL_NAME>$(const.n)<KERNEL_NAME>$(kernelname)</KERNEL_NAME>$(const.n)<KERNEL_VERSION>$(kernelversion)</KERNEL_VERSION>$(const.n)<NAME>$(name)</NAME>$(const.n)<VERSION>$(version)</VERSION>$(const.n)</OPERATINGSYSTEM>"
location => after_location("<CONTENTS>"),
location => after_location("<CONTENT>"),
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::

"<ACCESSLOG><LOGDATE>$(logdate)</LOGDATE></ACCESSLOG>"
location => after_location("</OPERATINGSYSTEM>"),
comment => "Adding log date";

}

bundle edit_line add_users_information_to_inventory(userlist)
{
insert_lines:
Expand Down

0 comments on commit dd28b32

Please sign in to comment.