-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ust_11174/add_new_method_to_get_file_from_rudder_shared…
…_folder_pr'
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
##################################################################################### | ||
# Copyright 2013 Normation SAS | ||
##################################################################################### | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, Version 3. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
##################################################################################### | ||
|
||
# @name File copy from Rudder shared folder | ||
# @description Ensure that a file or directory is copied from Rudder shared folder (/var/rudder/configuration-repository/shared-files) | ||
# | ||
# @parameter source Source file (path relative to Rudder shared folder) | ||
# @parameter destination Destination file (absolute path on the target node) | ||
# @parameter hash_type Hash algorithm used to check if file is updated | ||
# | ||
# @class_prefix file_from_shared_folder | ||
# @class_parameter destination | ||
|
||
bundle agent file_from_shared_folder(source, destination, hash_type) | ||
{ | ||
vars: | ||
"promisers" slist => { @{this.callers_promisers}, cf_null }, policy => "ifdefined"; | ||
"class_prefix" string => canonify(join("_", "promisers")); | ||
"args" slist => { "${source}", "${destination}" }; | ||
|
||
methods: | ||
"copy without recursion" usebundle => file_copy_from_remote_source_recursion("/var/rudder/configuration-repository/shared-files/${source}", "${destination}", "0"); | ||
"new result classes" usebundle => _classes_copy("${class_prefix}_copy_without_recursion", "${class_prefix}"); | ||
|
||
"report" usebundle => _log("Copying ${destination} from ${source}", "", "${class_prefix}", @{args}); | ||
} |