Revision dd6f7dc3
Added by Benoît PECCATTE over 6 years ago
techniques/fileDistribution/fileTemplate/1.0/fileTemplate.ps1.st | ||
---|---|---|
function fileTemplate {
|
||
function fileTemplate_RudderUniqueID {
|
||
[CmdletBinding()]
|
||
param (
|
||
[parameter(Mandatory=$true)] [string]$reportId,
|
techniques/fileDistribution/fileTemplate/1.0/fileTemplate.st | ||
---|---|---|
# -Take options in considerations(like perms)
|
||
# -Reporting
|
||
|
||
bundle agent fileTemplate {
|
||
bundle agent fileTemplate_RudderUniqueID {
|
||
vars:
|
||
#Tracking key
|
||
&TRACKINGKEY:{key | "trackingkey[&i&]" string => "&key&";}&
|
||
... | ... | |
|
||
#Cancel persistent classes
|
||
"cancel" string => "cancel persistence",
|
||
classes => cancel_all_classes("posthook_rerun_${index}"),
|
||
classes => cancel_all_classes("posthook_rerun_${index}_RudderUniqueID"),
|
||
ifvarclass => "command_execution_${posthook_canon[${index}]}_ok";
|
||
|
||
classes:
|
||
... | ... | |
"posthook_persistent_${index}" expression => strcmp("${persist[${index}]}", "true");
|
||
|
||
#Check if the posthook is persistent and in error, set up a class for 10000 minutes => about 1 week
|
||
"posthook_rerun_${index}" expression => "posthook_persistent_${index}.command_execution_${posthook_canon[${index}]}_failed",
|
||
scope => "namespace",
|
||
persistence => "10000";
|
||
"posthook_rerun_${index}_RudderUniqueID" expression => "posthook_persistent_${index}.command_execution_${posthook_canon[${index}]}_failed",
|
||
scope => "namespace",
|
||
persistence => "10000";
|
||
|
||
methods:
|
||
#Ensure the templates are in a safe place
|
||
... | ... | |
usebundle => command_execution(
|
||
"${posthook[${index}]}"
|
||
),
|
||
ifvarclass => "posthook_launch_${index}|posthook_rerun_${index}";
|
||
ifvarclass => "posthook_launch_${index}|posthook_rerun_${index}_RudderUniqueID";
|
||
|
||
################################################################################
|
||
# REPORTING #
|
techniques/fileDistribution/fileTemplate/1.0/metadata.xml | ||
---|---|---|
A limit of 16.383 characters is set for the "template from text" case.
|
||
</DESCRIPTION>
|
||
<MULTIINSTANCE>true</MULTIINSTANCE>
|
||
<POLICYGENERATION>separated</POLICYGENERATION>
|
||
|
||
<AGENT type="dsc">
|
||
<BUNDLES>
|
||
... | ... | |
|
||
<AGENT type="cfengine-community">
|
||
<BUNDLES>
|
||
<NAME>fileTemplate</NAME>
|
||
<NAME>fileTemplate_RudderUniqueID</NAME>
|
||
</BUNDLES>
|
||
<TMLS>
|
||
<TML name="fileTemplate"/>
|
Also available in: Unified diff
Fixes #11687: Create a first implementation of multiversion technique