From e37068d2733d8edc215a7d59ded90c18a229944c Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Tue, 11 Jun 2024 13:50:07 +0100 Subject: [PATCH] (CAT-1869) - Add dsc_timeout param to all dsc resources This commit adds the dsc_timeout param to all dsc resources generated by Puppet.Dsc. This allows the user to set a configurable amount of time, in seconds, in which puppet will wait for the dsc invocation to finish. If the timeout passes, and DSC has not returned, the powershell process defined in puppetlabs-pwshlib's dsc_base_provider, will quit the operation and move on. --- src/Puppet.Dsc/internal/functions/Get-TypeContent.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Puppet.Dsc/internal/functions/Get-TypeContent.ps1 b/src/Puppet.Dsc/internal/functions/Get-TypeContent.ps1 index bc4eb9e5..dc6e03e0 100644 --- a/src/Puppet.Dsc/internal/functions/Get-TypeContent.ps1 +++ b/src/Puppet.Dsc/internal/functions/Get-TypeContent.ps1 @@ -67,6 +67,11 @@ Puppet::ResourceApi.register_type( behaviour: :parameter, default: 'property', }, + dsc_timeout: { + type: 'Optional[Integer]', + desc: 'The maximum time in seconds to wait for the DSC resource to complete.', + behaviour: :parameter, + }, $((Get-TypeParameterContent -ParameterInfo $Resource.ParameterInfo) -join "`n") }, )