I know it's bad form to reply to a thread that's a year old, but this is the top hit on Google for this issue, so I figured I'd share what I found.
You can force ruby to run in a Terminal Server compatibility mode by adding the regkey detailed here: http://support.microsoft.com/kb/186515. This will prevent Windows from changing paths from what Puppet is expecting. If that doesn't work for your environment, you can have puppet run "C:\Windows\System32\change.exe user /install", before running on the server and "change user /execute" afterwards. This may be the best option as it will follow best practices if you need to install software on the server during a puppet run. Hope that's helpful to someone! Jared On Friday, March 15, 2013 2:51:44 AM UTC-4, Vladimir Rutsky wrote: > > Hello, James! > > On Thu, Mar 14, 2013 at 6:08 PM, jim <[email protected] <javascript:>>wrote: > >> Hiya Vladimir >> >> I think the issue is, if we remove Puppet and DISM and go back to Windows >> Remote Desktop Services, also known as Terminal Server. >> >> When you install this feature, it requires a reboot for this feature to >> take effect >> >> when the host comes back online, its a fully functioning RDS / Terminal >> Server >> >> If you want to install software, you have to run this command first >> >> change user /install >> Then install software >> revert back >> change user /execute >> >> Now add puppet / DISM module onto this, it will look like this >> >> Server running puppet agent >> install feature APPServer using DISM module >> reboot host >> hosts comes back online a functioning RDS / Terminal Server >> try to run puppet agent again >> Problem -------- >> Due to RDS / Terminal Server still running in execute mode >> Puppet Run will fail. >> >> (this is an assumption, RDS / Terminal Server running in execute mode >> when applying ruby syntax for environment variables e..g >> commands :dism => "#{Dir::WINDOWS}\\sysnative\\Dism.exe" >> will default to %userprofile% path thus "*C:\Users\Administrator*\ >> WINDOWS\sysnative\Dism.exe" >> >> Now if the DISM module, could do the following, it would work for RDS / >> Terminal Server: >> >> Server running puppet agent >> install feature APPServer using DISM module >> reboot host >> hosts comes back online a functioning RDS / Terminal Server >> run puppet agent again, if feature equals "RDS / Terminal Server" >> execute "change user / install" mode >> run dism module >> execute "change user /execute" mode >> Puppet Run will run successfully >> >> >> hope this make sense >> > > I'm glad to see that you find source of problems with Terminal Server > installation automation! > I'm not familiar with Terminal Server and how it works so I'm not sure how > to deal with your situation correctly. I think running "change user / > install" in dism Puppet module is bad idea, most probably Terminal Server > breaks other Puppet modules too. Maybe you should run whole puppet client > in this "change user / install" mode? > > Do you resolved "error code 194" problem? I'm quite sure that my fixes > should help. > > > Best wishes, > > Vladimir Rutsky > > >> >> regards >> >> Jim >> >> >> >> >> On Thursday, 14 March 2013 13:32:43 UTC, Vladimir Rutsky wrote: >> >>> Hello, James! >>> >>> I tested and looks like exitcode parameter doesn't work in DISM, sorry >>> for not working example. I filled bug about this into DISM bug tracker on >>> github: https://github.com/puppetlabs/puppetlabs-dism/issues/15 and >>> commited fix for this issue in my master branch of DISM fork. >>> >>> I recommend you to get version from there: https://github.com/vrutsky/ >>> puppetlabs-dism , this should fix issue with first error "Unexpected >>> exitcode: 194". >>> >>> Source of second issue, "C:\Users\Administrator\WINDOWS\sysnative\Dism.exe >>> does not exist, not clear to me. >>> >>> -- >>> Vladimir Rutsky >>> >>> >>> >>> >>> On Wed, Mar 13, 2013 at 8:00 PM, jim <[email protected]> wrote: >>> >>>> Hi Vladimir >>>> >>>> >>>> This error: >>>> >>>> Puppet::Type::Dism::ProviderDism: file >>>> C:\Users\Administrator\WINDOWS\sysnative\Dism.exe >>>> does not exist >>>> >>>> Just thought >>>> >>>> this part of the error >>>> >>>> C:\Users\Administrator >>>> >>>> It looks like its picking up the %userprofile% and appending to the >>>> environment part in dism module >>>> >>>> >>>> USERPROFILE=C:\Users\Administrator >>>> >>>> if Puppet.features.microsoft_windows? >>>> if ENV.has_key?('ProgramFiles(x86)') >>>> commands :dism => "#{Dir::WINDOWS}\\sysnative\\Dism.exe" >>>> else >>>> commands :dism => "#{Dir::WINDOWS}\\system32\\Dism.exe" >>>> end >>>> end >>>> >>>> if that make sense >>>> >>>> On Wednesday, 13 March 2013 15:51:07 UTC, jim wrote: >>>>> >>>>> I update my DISM module with your changes and added this to my manifest >>>>> >>>>> dism { 'AppServer': >>>>> ensure => present, >>>>> exitcode => [0, 3010, 194], >>>>> } >>>>> >>>>> >>>>> Here is my SET information: >>>>> >>>>> C:\Users\Administrator>set >>>>> ALLUSERSPROFILE=C:\ProgramData >>>>> APPDATA=C:\Users\Administrator\AppData\Roaming >>>>> CLIENTNAME=UKLSQL0156 >>>>> CommonProgramFiles=C:\Program Files\Common Files >>>>> CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files >>>>> CommonProgramW6432=C:\Program Files\Common Files >>>>> COMPUTERNAME=TMS-A-TRM-01P >>>>> ComSpec=C:\Windows\system32\cmd.exe >>>>> FP_NO_HOST_CHECK=NO >>>>> HOMEDRIVE=C: >>>>> HOMEPATH=\Users\Administrator >>>>> LOCALAPPDATA=C:\Users\Administrator\AppData\Local >>>>> LOGONSERVER=\\TMS-A-TRM-01P >>>>> NUMBER_OF_PROCESSORS=2 >>>>> OS=Windows_NT >>>>> Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem >>>>> ;C:\Windows\System32 >>>>> \WindowsPowerShell\v1.0\ >>>>> PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC >>>>> PROCESSOR_ARCHITECTURE=AMD64 >>>>> PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 44 Stepping 2, GenuineIntel >>>>> PROCESSOR_LEVEL=6 >>>>> PROCESSOR_REVISION=2c02 >>>>> ProgramData=C:\ProgramData >>>>> ProgramFiles=C:\Program Files >>>>> ProgramFiles(x86)=C:\Program Files (x86) >>>>> ProgramW6432=C:\Program Files >>>>> PROMPT=$P$G >>>>> PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ >>>>> PUBLIC=C:\Users\Public >>>>> SESSIONNAME=RDP-Tcp#0 >>>>> SystemDrive=C: >>>>> SystemRoot=C:\Windows >>>>> TEMP=C:\Users\ADMINI~1\AppData\Local\Temp\2 >>>>> TMP=C:\Users\ADMINI~1\AppData\Local\Temp\2 >>>>> USERDOMAIN=TMS-A-TRM-01P >>>>> USERNAME=Administrator >>>>> USERPROFILE=C:\Users\Administrator >>>>> windir=C:\Windows >>>>> windows_tracing_flags=3 >>>>> windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log >>>>> >>>>> >>>>> I re-cloned a pc and run a fresh puppet run, and still getting this >>>>> error on initial run: >>>>> >>>>> ebug: Dism[AppServer](provider=dism): Executing >>>>> 'C:\Windows\sysnative\Dism.exe >>>>> /online /Enable-Feature /FeatureName:AppServer /NoRestart' >>>>> err: >>>>> /Stage[main]/Roles::Trm::Remote_desktop_services/Dism[AppServer]/ensure: >>>>> ch >>>>> ange from absent to present failed: Unexpected exitcode: 194 >>>>> Error: >>>>> Deployment Image Servicing and Management tool >>>>> Version: 6.1.7600.16385 >>>>> >>>>> Image Version: 6.1.7600.16385 >>>>> >>>>> Enabling feature(s) >>>>> The operation completed successfully. >>>>> >>>>> >>>>> debug: Dism[AppServer-UI](provider=dism): Executing >>>>> 'C:\Windows\sysnative\Dism.e >>>>> xe /online /Enable-Feature /FeatureName:AppServer-UI /NoRestart' >>>>> err: /Stage[main]/Roles::Trm::Remote_desktop_services/Dism[AppSer >>>>> ver-UI]/ensure: >>>>> change from absent to present failed: Unexpected exitcode: 194 >>>>> Error: >>>>> Deployment Image Servicing and Management tool >>>>> Version: 6.1.7600.16385 >>>>> >>>>> Image Version: 6.1.7600.16385 >>>>> >>>>> Enabling feature(s) >>>>> The operation completed successfully. >>>>> >>>>> >>>>> >>>>> Also after the reboot - I still get the following: >>>>> >>>>> debug: Class[Roles::Base::Powershell_remoting]: The container >>>>> Stage[main] will p >>>>> ropagate my refresh event >>>>> debug: file_metadata supports formats: b64_zlib_yaml pson raw yaml; >>>>> using pson >>>>> debug: file_metadata supports formats: b64_zlib_yaml pson raw yaml; >>>>> using pson >>>>> debug: Puppet::Type::Dism::ProviderDism: file C:\Users\Administrator\ >>>>> WINDOWS\sys >>>>> native\Dism.exe does not exist >>>>> debug: Puppet::Type::Dism::ProviderDism: file C:\Users\Administrator\ >>>>> WINDOWS\sys >>>>> native\Dism.exe does not exist >>>>> debug: Puppet::Type::Dism::ProviderDism: file C:\Users\Administrator\ >>>>> WINDOWS\sys >>>>> native\Dism.exe does not exist >>>>> debug: Puppet::Type::Dism::ProviderDism: file C:\Users\Administrator\ >>>>> WINDOWS\sys >>>>> native\Dism.exe does not exist >>>>> debug: Puppet::Type::Dism::ProviderDism: file C:\Users\Administrator\ >>>>> WINDOWS\sys >>>>> native\Dism.exe does not exist >>>>> notice: /Stage[main]/Roles::Base::Activate_windows_2008/Exec[apply_ >>>>> activate_wind >>>>> ows_2008]: Dependency Dism[NetFx3] has failures: true >>>>> warning: /Stage[main]/Roles::Base::Activate_windows_2008/Exec[apply_ >>>>> activate_win >>>>> dows_2008]: Skipping because of failed dependencies >>>>> debug: Puppet::Type::Dism::ProviderDism: file C:\Users\Administrator\ >>>>> WINDOWS\sys >>>>> native\Dism.exe does not exist >>>>> err: Could not find a suitable provider for dism >>>>> >>>>> So i'm a bit confused >>>>> >>>>> regards >>>>> >>>>> James >>>>> >>>>> >>>>> >>>>> >>>>> On Wednesday, 13 March 2013 15:26:22 UTC, jim wrote: >>>>>> >>>>>> Hi Vladimir >>>>>> >>>>>> Sorry >>>>>> >>>>>> If you use powershell and import servermanager the feature is called >>>>>> RDS-Server, if you use DISM its called APPServer >>>>>> >>>>>> regards >>>>>> >>>>>> James >>>>>> >>>>>> On Wednesday, 13 March 2013 15:06:18 UTC, Vladimir Rutsky wrote: >>>>>>> >>>>>>> James, >>>>>>> >>>>>>> >>>>>>> On Wed, Mar 13, 2013 at 6:42 PM, jim <[email protected]> wrote: >>>>>>> >>>>>>>> Hi Vladimir, >>>>>>>> >>>>>>>> I've also tried this approach >>>>>>>> >>>>>>>> >>>>>>>> exec {'dism': >>>>>>>> command => 'c:\windows\sysnative\dism.exe /online /enable-feature >>>>>>>> /featurename:RDS-RD-Server', >>>>>>>> logoutput=> true, >>>>>>>> } >>>>>>>> >>>>>>>> >>>>>>>> Here is the errors i'm getting: >>>>>>>> >>>>>>>> Exec[dism]/returns: Deployment Image Servicing and Management tool >>>>>>>> Exec[dism]/returns: Version: 6.1.7600.16385 >>>>>>>> Exec[dism]/returns: Image Version: 6.1.7600.16385 >>>>>>>> Exec[dism]/returns: Error: 0x800f080c >>>>>>>> Exec[dism]/returns: Feature name RDS-RD-Server is unknown. >>>>>>>> Exec[dism]/returns: A Windows feature name was not recognized. >>>>>>>> Exec[dism]/returns: Use the /Get-Features option to find the name >>>>>>>> of the feature in the image and try the command again. >>>>>>>> Exec[dism]/returns: The DISM log file can be found at >>>>>>>> C:\Windows\Logs\DISM\dism.log >>>>>>>> err: /Stage[main]/Exec[dism]/returns: change from notrun to 0 >>>>>>>> failed: c:\windows\sysnative\dism.exe /online >>>>>>>> /enable-feature/featurename: >>>>>>>> RDS-RD-Server returned 12 instead of one of [0] at >>>>>>>> /etc/puppetlabs/puppet/modules/roles/manifests/trm/remote_ >>>>>>>> desktop_services.pp:12 >>>>>>>> >>>>>>> >>>>>>> Looks like you don't have "RDS-RD-Server" feature in your system (I >>>>>>> don't have this feature in Windows 7 too). >>>>>>> Puppet dism modules wraps >>>>>>> >>>>>>> c:\windows\sysnative\dism.exe /online /enable-feature/featurename: >>>>>>> RDS-RD-Server >>>>>>> >>>>>>> command. Are you sure this works in administrative cmd.exe? >>>>>>> >>>>>>> c:\windows\sysnative\dism.exe /online /enable-feature/featurename: >>>>>>> RDS-RD-Server /NoRestart >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Regards >>>>>>>> >>>>>>>> James >>>>>>>> >>>>>>>> On Wednesday, 13 March 2013 14:08:54 UTC, jim wrote: >>>>>>>>> >>>>>>>>> Hi Vladimir, >>>>>>>>> >>>>>>>>> Here is the information you are after: >>>>>>>>> >>>>>>>>> debug: Dism[AppServer](provider=dism): Executing >>>>>>>>> 'C:\Windows\sysnative\Dism.exe >>>>>>>>> /online /Enable-Feature /FeatureName:AppServer /NoRestart' >>>>>>>>> err: >>>>>>>>> /Stage[main]/Roles::Trm::Remote_desktop_services/Dism[AppServer]/ensure: >>>>>>>>> >>>>>>>>> ch >>>>>>>>> ange from absent to present failed: Unexpected exitcode: 194 >>>>>>>>> Error: >>>>>>>>> Deployment Image Servicing and Management tool >>>>>>>>> Version: 6.1.7600.16385 >>>>>>>>> >>>>>>>>> Image Version: 6.1.7600.16385 >>>>>>>>> >>>>>>>>> Enabling feature(s) >>>>>>>>> The operation completed successfully. >>>>>>>>> >>>>>>>>> >>>>>>>>> debug: Dism[AppServer-UI](provider=dism): Executing >>>>>>>>> 'C:\Windows\sysnative\Dism.e >>>>>>>>> xe /online /Enable-Feature /FeatureName:AppServer-UI /NoRestart' >>>>>>>>> err: /Stage[main]/Roles::Trm::Remote_desktop_services/Dism[AppSer >>>>>>>>> ver-UI]/ensure: >>>>>>>>> change from absent to present failed: Unexpected exitcode: 194 >>>>>>>>> Error: >>>>>>>>> Deployment Image Servicing and Management tool >>>>>>>>> Version: 6.1.7600.16385 >>>>>>>>> >>>>>>>>> Image Version: 6.1.7600.16385 >>>>>>>>> >>>>>>>>> Enabling feature(s) >>>>>>>>> The operation completed successfully. >>>>>>>>> >>>>>>>>> >>>>>>>>> Then completes >>>>>>>>> >>>>>>>>> Machine is Rebooted >>>>>>>>> >>>>>>>>> Here is the logs after running puppet agent again >>>>>>>>> >>>>>>>>> >>>>>>>>> debug: Puppet::Type::Dism::ProviderDism: file >>>>>>>>> C:\Users\Administrator\WINDOWS\sysnative\Dism.exe does not exist >>>>>>>>> debug: Puppet::Type::Dism::ProviderDism: file >>>>>>>>> C:\Users\Administrator\WINDOWS\sysnative\Dism.exe does not exist >>>>>>>>> debug: Puppet::Type::Dism::ProviderDism: file >>>>>>>>> C:\Users\Administrator\WINDOWS\sysnative\Dism.exe does not exist >>>>>>>>> debug: Puppet::Type::Dism::ProviderDism: file >>>>>>>>> C:\Users\Administrator\WINDOWS\sysnative\Dism.exe does not exist >>>>>>>>> debug: Puppet::Type::Dism::ProviderDism: file >>>>>>>>> C:\Users\Administrator\WINDOWS\sysnative\Dism.exe does not exist >>>>>>>>> notice: /Stage[main]/Roles::Base::Activate_windows_2008/Exec[ >>>>>>>>> apply_activate_windows_2008]: Dependency Dism[NetFx3] has >>>>>>>>> failures: true >>>>>>>>> warning: /Stage[main]/Roles::Base::Activate_windows_2008/Exec[ >>>>>>>>> apply_activate_windows_2008]: Skipping because of failed >>>>>>>>> dependencies >>>>>>>>> debug: Puppet::Type::Dism::ProviderDism: file >>>>>>>>> C:\Users\Administrator\WINDOWS\sysnative\Dism.exe does not exist >>>>>>>>> err: Could not find a suitable provider for dism >>>>>>>>> debug: Finishing transaction 141366492 >>>>>>>>> >>>>>>>>> I hope this is what you are after >>>>>>>>> >>>>>>>>> regards >>>>>>>>> >>>>>>>>> James >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Wednesday, 13 March 2013 12:37:25 UTC, Vladimir Rutsky wrote: >>>>>>>>>> >>>>>>>>>> Can you provide complete log of running "puppet agent --test >>>>>>>>>> --debug" on machine where you try to install Remote Desktop Services >>>>>>>>>> using >>>>>>>>>> Puppet? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Wed, Mar 13, 2013 at 4:12 PM, jim <[email protected]> wrote: >>>>>>>>>> >>>>>>>>>>> The error is only happening when trying to install Remote >>>>>>>>>>> Desktop Services (old Terminal Server), it works fine with other >>>>>>>>>>> roles/features like IIS etc >>>>>>>>>>> >>>>>>>>>>> I updated DISM from github by overwritting both lib / spec >>>>>>>>>>> directorys >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Wednesday, 13 March 2013 12:08:17 UTC, Vladimir Rutsky wrote: >>>>>>>>>>>> >>>>>>>>>>>> Hello, >>>>>>>>>>>> >>>>>>>>>>>> How you installed dism module? >>>>>>>>>>>> >>>>>>>>>>>> I "intalled" dism by copying dism git repository contents into >>>>>>>>>>>> /etc/puppet/modules/dism/ and don't observe error that you have. >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> Vladimir Rutsky >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>> Google Groups "Puppet Users" group. >>>>>>>>>>> To unsubscribe from this group and stop receiving emails from >>>>>>>>>>> it, send an email to [email protected]. >>>>>>>>>>> To post to this group, send email to [email protected]. >>>>>>>>>>> Visit this group at http://groups.google.com/group >>>>>>>>>>> /puppet-users?hl=en. >>>>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out >>>>>>>>>>> . >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "Puppet Users" group. >>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>> send an email to [email protected]. >>>>>>>> To post to this group, send email to [email protected]. >>>>>>>> Visit this group at http://groups.google.com/group >>>>>>>> /puppet-users?hl=en. >>>>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Puppet Users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at http://groups.google.com/group/puppet-users?hl=en. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/puppet-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/2ad05cb0-56fe-4752-aee8-ad1503c59210%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
