Actions
Bug #20083
closedDSC policies are generated without the conditions
Pull Request:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
User visibility:
First impressions of Rudder
Effort required:
Priority:
124
Name check:
To do
Fix check:
To do
Regression:
Description
See the tehcnique attached and its generated ps1 file:
function Dsc-Block-Test { [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 $(Service-Started -Name "sshd" -componentName "Service started" -reportId $reportId -techniqueName $techniqueName -auditOnly:$auditOnly) .get_item("classes") } else { _rudder_common_report_na -componentName "Service started" -componentKey "sshd" -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 "write-output `"bob`"" -componentName "Command execution" -reportId $reportId -techniqueName $techniqueName -auditOnly:$auditOnly).get_item("classes") } else { _rudder_common_report_na -componentName "Command execution" -componentKey "write-output `"bob`"" -message "Not applicable" -reportId $reportId -techniqueName $techniqueName -auditOnly:$au ditOnly } }
Files
Updated by Benoît PECCATTE about 3 years ago
After sub issue fixes, the output seems to be OK :
# generated by rudderc # @name dsc block test # @version 1.0 function Dsc-Block-Test { [CmdletBinding()] param ( [Parameter(Mandatory=$True)] [String]$ReportId, [Parameter(Mandatory=$True)] [String]$TechniqueName, [Switch]$AuditOnly ) $LocalClasses = New-ClassContext $ResourcesDir = $PSScriptRoot + "\resources" $LocalClasses = Merge-ClassContext $LocalClasses $(Service-Started -Name "sshd" -ComponentName "Service started" -ReportId $ReportId -TechniqueName $TechniqueName -AuditOnly:$AuditOnly).get_item("classes") $Class = "service_started_sshd_${report_data.canonified_directive_id}_kept" if (Evaluate-Class $Class $LocalClasses $SystemClasses) { $LocalClasses = Merge-ClassContext $LocalClasses $(Command-Execution -Command "write-output \"bob3\"" -ComponentName "Command execution" -ReportId $ReportId -TechniqueName $TechniqueName -AuditOnly:$AuditOnly).get_item("classes") } else { _rudder_common_report_na -ComponentName "Command execution" -ComponentKey "write-output \"bob3\"" -Message "Not applicable" -ReportId $ReportId -TechniqueName $TechniqueName -AuditOnly:$AuditOnly } }
Updated by Benoît PECCATTE about 3 years ago
- Status changed from New to In progress
- Assignee set to Benoît PECCATTE
Updated by Benoît PECCATTE about 3 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Benoît PECCATTE to Félix DALLIDET
- Pull Request set to https://github.com/Normation/rudder/pull/3954
Updated by Benoît PECCATTE about 3 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|801c539f212dc57ae1d86024c7205809adda5ab3.
Updated by Vincent MEMBRÉ about 3 years ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 7.0.0~beta2 which was released today.
Actions