Project

General

Profile

Actions

Bug #22535

closed

Mustache template is not capable to render technique parameters on windows nodes

Added by Félix DALLIDET about 1 year ago. Updated 12 months ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
I hate Rudder for that
User visibility:
Getting started - demo | first install | Technique editor and level 1 Techniques
Effort required:
Small
Priority:
157
Name check:
To do
Fix check:
Checked
Regression:
No

Description

The current windows technique generated by the webapp does not register the technique parameters as a global variable for the technique run, it should.

function Super-Technique-To-Test-Everything {
  [CmdletBinding()]
  param (
      [parameter(Mandatory=$true)]
      [string]$reportId,
      [parameter(Mandatory=$true)]
      [string]$techniqueName,
      [parameter(Mandatory=$true)]
      [string]$one_params,
      [parameter(Mandatory=$true)]
      [string]$two_params,
      [Rudder.PolicyMode]$policyMode
  )
  BeginTechniqueCall -Name $techniqueName
.....
  EndTechniqueCall -Name $techniqueName
}

Should be:

function Super-Technique-To-Test-Everything {
  [CmdletBinding()]
  param (
      [parameter(Mandatory=$true)]
      [string]$reportId,
      [parameter(Mandatory=$true)]
      [string]$techniqueName,
      [parameter(Mandatory=$true)]
      [string]$one_params,
      [parameter(Mandatory=$true)]
      [string]$two_params,
      [Rudder.PolicyMode]$policyMode
  )

  $techniqueParams = @{
    "one_params" = $one_params
    "two_params" = $two_params
  }
  BeginTechniqueCall -Name $techniqueName -Parameters $techniqueParams
  .....
  EndTechniqueCall -Name $techniqueName

Where BeginTechniqueCall will have an additional code looking like this:

  Add-PolicyRudderVar -Name $techniqueName -Value $techniqueParams

The Add-PolicyRudderVar is named Rudder-Var in 7.3+ and is present in the agent modules. But for 7.2 compatibility we will most likely have to backport it in ncf.


Subtasks 3 (0 open3 closed)

Bug #22536: Add two functions to ncf to manage rudder policy variablesReleasedVincent MEMBRÉActions
Bug #22537: 7.3 version of parent ticketReleasedVincent MEMBRÉActions
Bug #22567: Add-RudderVar is not packaged anymore in the agent on ci buildsReleasedAlexis MoussetActions
Actions #1

Updated by Félix DALLIDET about 1 year ago

  • Subtask #22536 added
Actions #2

Updated by Félix DALLIDET about 1 year ago

  • Subtask #22567 added
Actions #3

Updated by Vincent MEMBRÉ about 1 year ago

  • Project changed from 78 to Rudder
  • Category changed from Techniques to Techniques
  • Target version changed from 7.2-next to 7.2.6
Actions #4

Updated by Vincent MEMBRÉ about 1 year ago

  • Status changed from New to In progress
  • Assignee set to Vincent MEMBRÉ
Actions #5

Updated by Vincent MEMBRÉ about 1 year ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Vincent MEMBRÉ to François ARMAND
  • Pull Request set to https://github.com/Normation/rudder/pull/4730
Actions #6

Updated by Félix DALLIDET about 1 year ago

  • Subtask #22574 added
Actions #7

Updated by Vincent MEMBRÉ about 1 year ago

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

Updated by Félix DALLIDET 12 months ago

  • Subject changed from Mustache template is not capable to render technique parameters to Mustache template is not capable to render technique parameters on windows nodes
Actions #9

Updated by Félix DALLIDET 12 months ago

  • Fix check changed from To do to Checked
Actions #10

Updated by Vincent MEMBRÉ 12 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 7.2.6 and 7.3.1 which were released today.

Actions

Also available in: Atom PDF