Project

General

Profile

Bug #20520 » rudder.patch

Félix DALLIDET, 2022-01-05 16:08

View differences:

directives/ncf_techniques/abcde/5f380077-476c-4b11-a694-f1e9259e7dfd.xml
<directive fileFormat="6">
<id>5f380077-476c-4b11-a694-f1e9259e7dfd</id>
<displayName>abcde</displayName>
<techniqueName>abcde</techniqueName>
<techniqueVersion>1.0</techniqueVersion>
<section name="sections"/>
<shortDescription></shortDescription>
<longDescription></longDescription>
<priority>5</priority>
<isEnabled>true</isEnabled>
<isSystem>false</isSystem>
<policyMode>default</policyMode>
<tags/>
</directive>
directives/ncf_techniques/abcde/activeTechniqueSettings.xml
<activeTechnique fileFormat="6">
<id>abcde</id>
<techniqueName>abcde</techniqueName>
<isEnabled>true</isEnabled>
<isSystem>false</isSystem>
<versions>
<version name="1.0">2022-01-05T15:24:44.222+01:00</version>
</versions>
</activeTechnique>
rules/32377fd7-02fd-43d0-aab7-28460a91347b.xml
</targets>
<directiveIds>
<id>6dfa146c-391f-47a6-9b13-761a958d5893</id>
<id>5f380077-476c-4b11-a694-f1e9259e7dfd</id>
</directiveIds>
<shortDescription></shortDescription>
<longDescription>This Rule was created automatically when Rudder was installed. It can be used to target Directives to all nodes (including the Rudder root server itself), or deleted if you would rather create your own set of Rules (it will never be created again).</longDescription>
techniques/ncf_techniques/abcde/1.0/metadata.xml
<TECHNIQUE name="abcde">
<DESCRIPTION></DESCRIPTION>
<USEMETHODREPORTING>true</USEMETHODREPORTING>
<AGENT type="cfengine-community,cfengine-nova">
<BUNDLES>
<NAME>abcde</NAME>
</BUNDLES>
<FILES>
<FILE name="RUDDER_CONFIGURATION_REPOSITORY/techniques/ncf_techniques/abcde/1.0/technique.cf">
<INCLUDED>true</INCLUDED>
</FILE>
</FILES>
</AGENT>
<AGENT type="dsc">
<BUNDLES>
<NAME>Abcde</NAME>
</BUNDLES>
<FILES>
<FILE name="RUDDER_CONFIGURATION_REPOSITORY/techniques/ncf_techniques/abcde/1.0/technique.ps1">
<INCLUDED>true</INCLUDED>
</FILE>
</FILES>
</AGENT>
<SECTIONS>
<SECTION component="true" multivalued="true" name="Command execution">
<REPORTKEYS>
<VALUE>/bin/false</VALUE>
</REPORTKEYS>
</SECTION>
<SECTION component="true" multivalued="true" name="my command">
<REPORTKEYS>
<VALUE>/bin/false</VALUE>
</REPORTKEYS>
</SECTION>
</SECTIONS>
</TECHNIQUE>
techniques/ncf_techniques/abcde/1.0/technique.cf
# @name abcde
# @description
# @version 1.0
bundle agent abcde
{
vars:
"resources_dir" string => "${this.promise_dirname}/resources";
methods:
"40550985-aaf2-476b-a20a-8fc8a8a438a2" usebundle => _method_reporting_context("my command", "/bin/false"),
if => concat("any");
"40550985-aaf2-476b-a20a-8fc8a8a438a2" usebundle => command_execution("/bin/false"),
if => concat("any");
"e2496d49-ee7a-4c59-ae71-ccf9b53b9b64" usebundle => _method_reporting_context("Command execution", "/bin/false"),
if => concat("any");
"e2496d49-ee7a-4c59-ae71-ccf9b53b9b64" usebundle => command_execution("/bin/false"),
if => concat("any");
}
techniques/ncf_techniques/abcde/1.0/technique.json
{
"id":"abcde",
"version":"1.0",
"category":"ncf_techniques",
"description":"",
"name":"abcde",
"calls":[
{
"method":"command_execution",
"condition":"",
"disableReporting":false,
"component":"my command",
"parameters":[
{
"name":"command",
"value":"/bin/false"
}
],
"id":"40550985-aaf2-476b-a20a-8fc8a8a438a2"
},
{
"method":"command_execution",
"condition":"",
"disableReporting":false,
"component":"Command execution",
"parameters":[
{
"name":"command",
"value":"/bin/false"
}
],
"id":"e2496d49-ee7a-4c59-ae71-ccf9b53b9b64"
}
],
"parameter":[],
"resources":[],
"source":"editor"
}
techniques/ncf_techniques/abcde/1.0/technique.ps1
function Abcde {
[CmdletBinding()]
param (
[parameter(Mandatory=$true)]
[string]$reportId,
[parameter(Mandatory=$true)]
[string]$techniqueName,
[switch]$auditOnly
)
$local_classes = New-ClassContext
$resources_dir = $PSScriptRoot + "\resources"
$class = ""
if (Evaluate-Class $class $local_classes $system_classes) {
$local_classes = Merge-ClassContext $local_classes $(Command-Execution -Command "/bin/false" -componentName "my command" -reportId $reportId -techniqueName $techniqueName -auditOnly:$auditOnly).get_item("classes")
} else {
_rudder_common_report_na -componentName "my command" -componentKey "/bin/false" -message "Not applicable" -reportId $reportId -techniqueName $techniqueName -auditOnly:$auditOnly
}
$class = ""
if (Evaluate-Class $class $local_classes $system_classes) {
$local_classes = Merge-ClassContext $local_classes $(Command-Execution -Command "/bin/false" -componentName "Command execution" -reportId $reportId -techniqueName $techniqueName -auditOnly:$auditOnly).get_item("classes")
} else {
_rudder_common_report_na -componentName "Command execution" -componentKey "/bin/false" -message "Not applicable" -reportId $reportId -techniqueName $techniqueName -auditOnly:$auditOnly
}
}
techniques/ncf_techniques/abcde/1.0/technique.rd
# generated by rudderc
# Generated from json technique
@format = 0
@name = "abcde"
@description = ""
@version = "1.0"
@category = "ncf_techniques"
@parameters = []
resource technique_abcde()
technique_abcde state technique() {
@component = "my command"
@id = "40550985-aaf2-476b-a20a-8fc8a8a438a2"
command("""/bin/false""").execution() as command_execution__bin_false
@component = "Command execution"
@id = "e2496d49-ee7a-4c59-ae71-ccf9b53b9b64"
command("""/bin/false""").execution() as command_execution__bin_false
}
(2-2/2)