Project

General

Profile

Actions

Bug #21502

open

Adapt webapp policy generation to 7.2 technique syntax

Added by François ARMAND 14 days ago. Updated 7 days ago.

Status:
Pending release
Priority:
N/A
Category:
Web - Technique editor
Target version:
-
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Regression:
No

Description

The new syntax is:

function My-Technique {
  [CmdletBinding()]
  param (
    [Parameter(Mandatory=$True)]
    [String]$ReportId,
    [Parameter(Mandatory=$True)]
    [String]$TechniqueName,
    [Rudder.PolicyMode]$PolicyMode
  )

  $ReportIdBase = $reportId.Substring(0,$reportId.Length-1)
  $localContext = [Rudder.Context]::new()
  $localContext.Merge($system_classes)
  $resourcesDir = $PSScriptRoot + "\resources" 

  # --------------Method Call 1------------- #
  $ReportId = $ReportIdBase+"8b575191-0ab0-4851-b05c-e7cde3726f05" 
  $common_params = @{
    ClassPrefix = "pwd" 
    ComponentKey = "pwd" 
    ComponentName = "Command execution" 
    PolicyMode = $PolicyMode
    ReportId = $ReportId
    TechniqueName = $TechniqueName
  }
  if ($localContext.Evaluate("sles_12")) {
    $call_params = @{
      Command = "pwd" 
      PolicyMode = $PolicyMode
    }
    $call = Command-Execution @call_params
    $compute_params = $common_params + @{
      MethodCall = $call
    }
    $context = Compute-Method-Call @compute_params
    $localContext.merge($context)
  } else {
    Rudder-Report-NA @common_params
  }

  # --------------Method Call 2------------- #
  # ...
}

Subtasks 1 (1 open0 closed)

Bug #21551: Adapt (more) technique writing to rudder dsc agent 7.2Pending releaseFélix DALLIDETActions
Actions #1

Updated by François ARMAND 14 days ago

  • Status changed from New to In progress
Actions #2

Updated by François ARMAND 13 days ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Félix DALLIDET
  • Pull Request set to https://github.com/Normation/rudder/pull/4406
Actions #3

Updated by Anonymous 9 days ago

  • Status changed from Pending technical review to Pending release
Actions #4

Updated by François ARMAND 7 days ago

  • Subtask #21551 added
Actions #5

Updated by François ARMAND 7 days ago

  • Project changed from 78 to Rudder
  • Category changed from Rudder web app to Web - Technique editor
  • Target version deleted (7.2-next)
  • Regression set to No

All the code is in rudder, not the plugin (which is certainly not what we want)

Actions

Also available in: Atom PDF