FAQ
Trying to run this exec in one of our manifests. When the resource is run
during a puppet run, it returns a error code 87. But when I execute the
same command on command prompt, it returns 3010. Is there any way to dig
and and find out why the return codes are different. FYI, I am using the
sysnative path to avoid the file system redirection on windows.

Platform: Windows 2008R2 64 bit
Running PE 2.6 agent and PE 2.6 master.

Exec statement(It's horrendous I know....) :

$AILogFile='C:\\Program Files\\HELLO_WORLD\\log\\IIS7.log'



exec { 'install_iis':

command => "c:\\Windows\\sysnative\\dism.exe /online /norestart
/logpath:\"C:\\temp\\log.etw.txt\" /enable-feature /ignorecheck
/featurename:\"IIS-ApplicationDevelopment\" /featurename:\"IIS-ASP\"
/featurename:\"IIS-ASPNET\" /featurename:\"IIS-BasicAuthentication\"
/featurename:\"IIS-CGI\"
/featurename:\"IIS-ClientCertificateMappingAuthentication\"
/featurename:\"IIS-CommonHttpFeatures\" /featurename:\"IIS-CustomLogging\"
/featurename:\"IIS-DefaultDocument\"
/featurename:\"IIS-DigestAuthentication\"
/featurename:\"IIS-DirectoryBrowsing\"
/featurename:\"IIS-HealthAndDiagnostics\"
/featurename:\"IIS-HostableWebCore\"
/featurename:\"IIS-HttpCompressionDynamic\"
/featurename:\"IIS-HttpCompressionStatic\" /featurename:\"IIS-HttpErrors\"
/featurename:\"IIS-HttpLogging\" /featurename:\"IIS-HttpRedirect\"
/featurename:\"IIS-HttpTracing\"
/featurename:\"IIS-IIS6ManagementCompatibility\"
/featurename:\"IIS-IISCertificateMappingAuthentication\"
/featurename:\"IIS-IPSecurity\" /featurename:\"IIS-ISAPIExtensions\"
/featurename:\"IIS-ISAPIFilter\" /featurename:\"IIS-LegacyScripts\"
/featurename:\"IIS-LegacySnapIn\" /featurename:\"IIS-LoggingLibraries\"
/featurename:\"IIS-ManagementConsole\"
/featurename:\"IIS-ManagementScriptingTools\"
/featurename:\"IIS-ManagementService\" /featurename:\"IIS-Metabase\"
/featurename:\"IIS-NetFxExtensibility\" /featurename:\"IIS-Performance\"
/featurename:\"IIS-RequestFiltering\" /featurename:\"IIS-RequestMonitor\"
/featurename:\"IIS-Security\" /featurename:\"IIS-ServerSideIncludes\"
/featurename:\"IIS-StaticContent\" /featurename:\"IIS-URLAuthorization\"
/featurename:\"IIS-WebDAV\" /featurename:\"IIS-WebServer\"
/featurename:\"IIS-WebServerManagementTools\"
/featurename:\"IIS-WebServerRole\"
/featurename:\"IIS-WindowsAuthentication\"
/featurename:\"IIS-WMICompatibility\" /featurename:\"NetFx3\"
/featurename:\"WAS-ConfigurationAPI\" /featurename:\"WAS-NetFxEnvironment\"
/featurename:\"WAS-ProcessModel\"
/featurename:\"WAS-WindowsActivationService\"
/featurename:\"WCF-HTTP-Activation\"
/featurename:\"WCF-NonHTTP-Activation\" >> \"${param::AILogFile}\" 2>&1",

returns => ['0','1003', '3010'],

unless => 'REG QUERY
\"HKLM\SOFTWARE\HELLO_WORLD\AutoInstall\IISSubTypes\" /v IIS /t REG_DWORD
/d /f 1',

require => Exec['echo Install_IIS']
}

Output if I do a puppet agent --debug --test:

debug: Executing 'c:\Windows\sysnative\dism.exe /online /norestart
/logpath:"C:\temp\log.etw.txt" /enable-feature /ignor

echeck /featurename:"IIS-ApplicationDevelopment" /featurename:"IIS-ASP"
/featurename:"IIS-ASPNET" /featurename:"IIS-Basi

cAuthentication" /featurename:"IIS-CGI"
/featurename:"IIS-ClientCertificateMappingAuthentication"
/featurename:"IIS-Comm

onHttpFeatures" /featurename:"IIS-CustomLogging"
/featurename:"IIS-DefaultDocument" /featurename:"IIS-DigestAuthenticati

on" /featurename:"IIS-DirectoryBrowsing"
/featurename:"IIS-HealthAndDiagnostics" /featurename:"IIS-HostableWebCore"
/fea

turename:"IIS-HttpCompressionDynamic"
/featurename:"IIS-HttpCompressionStatic" /featurename:"IIS-HttpErrors"
/featurenam

e:"IIS-HttpLogging" /featurename:"IIS-HttpRedirect"
/featurename:"IIS-HttpTracing" /featurename:"IIS-IIS6ManagementCompa

tibility" /featurename:"IIS-IISCertificateMappingAuthentication"
/featurename:"IIS-IPSecurity" /featurename:"IIS-ISAPIEx

tensions" /featurename:"IIS-ISAPIFilter" /featurename:"IIS-LegacyScripts"
/featurename:"IIS-LegacySnapIn" /featurename:"

IIS-LoggingLibraries" /featurename:"IIS-ManagementConsole"
/featurename:"IIS-ManagementScriptingTools" /featurename:"IIS

-ManagementService" /featurename:"IIS-Metabase"
/featurename:"IIS-NetFxExtensibility" /featurename:"IIS-Performance" /fe

aturename:"IIS-RequestFiltering" /featurename:"IIS-RequestMonitor"
/featurename:"IIS-Security" /featurename:"IIS-ServerS

ideIncludes" /featurename:"IIS-StaticContent"
/featurename:"IIS-URLAuthorization" /featurename:"IIS-WebDAV" /featurename

:"IIS-WebServer" /featurename:"IIS-WebServerManagementTools"
/featurename:"IIS-WebServerRole" /featurename:"IIS-WindowsA

uthentication" /featurename:"IIS-WMICompatibility" /featurename:"NetFx3"
/featurename:"WAS-ConfigurationAPI" /featurenam

e:"WAS-NetFxEnvironment" /featurename:"WAS-ProcessModel"
/featurename:"WAS-WindowsActivationService" /featurename:"WCF-H

TTP-Activation" /featurename:"WCF-NonHTTP-Activation" >> "C:\\Program
Files\\HELLO_WORLD\\log\\IIS7.log" 2>&1'

err: /Stage[main]/Win-iis-install::Iis-config/Exec[install_iis]/returns:
change from notrun to 0 1003 3010 failed:

c:\Windows\sysnative\dism.exe /online /norestart
/logpath:"C:\temp\log.etw.txt" /enable-feature /ignorecheck /featurena

me:"IIS-ApplicationDevelopment" /featurename:"IIS-ASP"
/featurename:"IIS-ASPNET" /featurename:"IIS-BasicAuthentication"

/featurename:"IIS-CGI"
/featurename:"IIS-ClientCertificateMappingAuthentication"
/featurename:"IIS-CommonHttpFeatures" /

featurename:"IIS-CustomLogging" /featurename:"IIS-DefaultDocument"
/featurename:"IIS-DigestAuthentication" /featurename:

"IIS-DirectoryBrowsing" /featurename:"IIS-HealthAndDiagnostics"
/featurename:"IIS-HostableWebCore" /featurename:"IIS-Htt

pCompressionDynamic" /featurename:"IIS-HttpCompressionStatic"
/featurename:"IIS-HttpErrors" /featurename:"IIS-HttpLoggin

g" /featurename:"IIS-HttpRedirect" /featurename:"IIS-HttpTracing"
/featurename:"IIS-IIS6ManagementCompatibility" /featur

ename:"IIS-IISCertificateMappingAuthentication"
/featurename:"IIS-IPSecurity" /featurename:"IIS-ISAPIExtensions" /featur

ename:"IIS-ISAPIFilter" /featurename:"IIS-LegacyScripts"
/featurename:"IIS-LegacySnapIn" /featurename:"IIS-LoggingLibrar

ies" /featurename:"IIS-ManagementConsole"
/featurename:"IIS-ManagementScriptingTools"
/featurename:"IIS-ManagementServic

e" /featurename:"IIS-Metabase" /featurename:"IIS-NetFxExtensibility"
/featurename:"IIS-Performance" /featurename:"IIS-Re

questFiltering" /featurename:"IIS-RequestMonitor"
/featurename:"IIS-Security" /featurename:"IIS-ServerSideIncludes" /fea

turename:"IIS-StaticContent" /featurename:"IIS-URLAuthorization"
/featurename:"IIS-WebDAV" /featurename:"IIS-WebServer"

/featurename:"IIS-WebServerManagementTools"
/featurename:"IIS-WebServerRole" /featurename:"IIS-WindowsAuthentication" /f

eaturename:"IIS-WMICompatibility" /featurename:"NetFx3"
/featurename:"WAS-ConfigurationAPI" /featurename:"WAS-NetFxEnvir

onment" /featurename:"WAS-ProcessModel"
/featurename:"WAS-WindowsActivationService"
/featurename:"WCF-HTTP-Activation" /

featurename:"WCF-NonHTTP-Activation" >> "C:\\Program
Files\\HELLO_WORLD\\log\\IIS7.log" 2>&1 returned 87 instead of
one of [0,1003,3010] at
/etc/puppetlabs/puppet/modules/win-iis-install/manifests/iis-config.pp:15


But if I run on command line I get the below:

C:\Program Files (x86)\Puppet Labs\Puppet
Enterprise\bin>c:\Windows\sysnative\dism.exe /online /norestart
/logpath:"C:\t

emp\log.etw.txt" /enable-feature /ignorecheck
/featurename:"IIS-ApplicationDevelopment" /featurename:"IIS-ASP" /featuren

ame:"IIS-ASPNET" /featurename:"IIS-BasicAuthentication"
/featurename:"IIS-CGI" /featurename:"IIS-ClientCertificateMappin

gAuthentication" /featurename:"IIS-CommonHttpFeatures"
/featurename:"IIS-CustomLogging" /featurename:"IIS-DefaultDocumen

t" /featurename:"IIS-DigestAuthentication"
/featurename:"IIS-DirectoryBrowsing" /featurename:"IIS-HealthAndDiagnostics"

/featurename:"IIS-HostableWebCore"
/featurename:"IIS-HttpCompressionDynamic"
/featurename:"IIS-HttpCompressionStatic" /f

eaturename:"IIS-HttpErrors" /featurename:"IIS-HttpLogging"
/featurename:"IIS-HttpRedirect" /featurename:"IIS-HttpTracing

" /featurename:"IIS-IIS6ManagementCompatibility"
/featurename:"IIS-IISCertificateMappingAuthentication" /featurename:"II

S-IPSecurity" /featurename:"IIS-ISAPIExtensions"
/featurename:"IIS-ISAPIFilter" /featurename:"IIS-LegacyScripts" /featur

ename:"IIS-LegacySnapIn" /featurename:"IIS-LoggingLibraries"
/featurename:"IIS-ManagementConsole" /featurename:"IIS-Mana

gementScriptingTools" /featurename:"IIS-ManagementService"
/featurename:"IIS-Metabase" /featurename:"IIS-NetFxExtensibil

ity" /featurename:"IIS-Performance" /featurename:"IIS-RequestFiltering"
/featurename:"IIS-RequestMonitor" /featurename:"

IIS-Security" /featurename:"IIS-ServerSideIncludes"
/featurename:"IIS-StaticContent" /featurename:"IIS-URLAuthorization"

/featurename:"IIS-WebDAV" /featurename:"IIS-WebServer"
/featurename:"IIS-WebServerManagementTools" /featurename:"IIS-We

bServerRole" /featurename:"IIS-WindowsAuthentication"
/featurename:"IIS-WMICompatibility" /featurename:"NetFx3" /feature

name:"WAS-ConfigurationAPI" /featurename:"WAS-NetFxEnvironment"
/featurename:"WAS-ProcessModel" /featurename:"WAS-Window

sActivationService" /featurename:"WCF-HTTP-Activation"
/featurename:"WCF-NonHTTP-Activation" >> "C:\Program
Files\HELLO_WORLD\log\IIS7.log" 2>&1



C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\bin>echo %errorlevel%
3010



Any help? This has me completely stumped since I'm running puppet and
running the command from exactly the same command shell window on the
server. I ran:

whoami /groups

and confirmed I am in the BUILTIN\Administrators group on this command
prompt window. I tried wrapping it inside a cmd.exe but it still came back
with different return codes compared to when I run it manually on the same
command prompt.

Regards,
Ben

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/DgtO3rZlXLUJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Jcbollinger at Oct 18, 2012 at 1:06 pm

    On Wednesday, October 17, 2012 9:59:54 PM UTC-5, Beeny wrote:
    Trying to run this exec in one of our manifests. When the resource is run
    during a puppet run, it returns a error code 87. But when I execute the
    same command on command prompt, it returns 3010. Is there any way to dig
    and and find out why the return codes are different. FYI, I am using the
    sysnative path to avoid the file system redirection on windows.

    Platform: Windows 2008R2 64 bit
    Running PE 2.6 agent and PE 2.6 master.

    Exec statement(It's horrendous I know....) :

    $AILogFile='C:\\Program Files\\HELLO_WORLD\\log\\IIS7.log'



    exec { 'install_iis':

    [...]

    returns => ['0','1003', '3010'],

    unless => 'REG QUERY
    \"HKLM\SOFTWARE\HELLO_WORLD\AutoInstall\IISSubTypes\" /v IIS /t REG_DWORD
    /d /f 1',

    require => Exec['echo Install_IIS']
    }

    Output if I do a puppet agent --debug --test:

    debug: Executing 'c:\Windows\sysnative\dism.exe /online /norestart
    /logpath:"C:\temp\log.etw.txt" /enable-feature /ignor
    [...]

    featurename:"WCF-NonHTTP-Activation" >> "C:\\Program
    Files\\HELLO_WORLD\\log\\IIS7.log" 2>&1 returned 87 instead of
    one of [0,1003,3010] at
    /etc/puppetlabs/puppet/modules/win-iis-install/manifests/iis-config.pp:15


    But if I run on command line I get the below:

    C:\Program Files (x86)\Puppet Labs\Puppet
    Enterprise\bin>c:\Windows\sysnative\dism.exe /online /norestart /logpath:
    [...]



    C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\bin>echo %errorlevel%
    3010



    Any help? This has me completely stumped since I'm running puppet and
    running the command from exactly the same command shell window on the
    server. I ran:
    I'm not well versed on Windows-specific aspects of Puppet, but in a more
    general context problems such as you describe are usually the result of
    differences in execution environment. In particular, Puppet does not
    forward its own environment variables -- not even the PATH -- to processes
    it launches. If the command you are trying to run requires anything in
    particular in its environment then you need to set those variables
    specifically in the Exec resource. This behavior is intentional: it
    fosters consistent and (more) secure behavior when applying Execs.

    Also, it might be worthwhile to investigate the meaning of exit code 87 for
    the command you are running. If it's documented then that may help you in
    your troubleshooting.


    John

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/7LtaQ6a1qaUJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Josh Cooper at Oct 18, 2012 at 4:52 pm
    Hi Ben,
    On Wed, Oct 17, 2012 at 7:59 PM, Beeny wrote:
    Trying to run this exec in one of our manifests. When the resource is run
    during a puppet run, it returns a error code 87. But when I execute the same
    command on command prompt, it returns 3010. Is there any way to dig and and
    find out why the return codes are different. FYI, I am using the sysnative
    path to avoid the file system redirection on windows.

    Platform: Windows 2008R2 64 bit
    Running PE 2.6 agent and PE 2.6 master.

    Exec statement(It's horrendous I know....) :

    $AILogFile='C:\\Program Files\\HELLO_WORLD\\log\\IIS7.log'



    exec { 'install_iis':

    command => "c:\\Windows\\sysnative\\dism.exe /online /norestart
    /logpath:\"C:\\temp\\log.etw.txt\" /enable-feature /ignorecheck
    /featurename:\"IIS-ApplicationDevelopment\" /featurename:\"IIS-ASP\"
    /featurename:\"IIS-ASPNET\" /featurename:\"IIS-BasicAuthentication\"
    /featurename:\"IIS-CGI\"
    /featurename:\"IIS-ClientCertificateMappingAuthentication\"
    /featurename:\"IIS-CommonHttpFeatures\" /featurename:\"IIS-CustomLogging\"
    /featurename:\"IIS-DefaultDocument\"
    /featurename:\"IIS-DigestAuthentication\"
    /featurename:\"IIS-DirectoryBrowsing\"
    /featurename:\"IIS-HealthAndDiagnostics\"
    /featurename:\"IIS-HostableWebCore\"
    /featurename:\"IIS-HttpCompressionDynamic\"
    /featurename:\"IIS-HttpCompressionStatic\" /featurename:\"IIS-HttpErrors\"
    /featurename:\"IIS-HttpLogging\" /featurename:\"IIS-HttpRedirect\"
    /featurename:\"IIS-HttpTracing\"
    /featurename:\"IIS-IIS6ManagementCompatibility\"
    /featurename:\"IIS-IISCertificateMappingAuthentication\"
    /featurename:\"IIS-IPSecurity\" /featurename:\"IIS-ISAPIExtensions\"
    /featurename:\"IIS-ISAPIFilter\" /featurename:\"IIS-LegacyScripts\"
    /featurename:\"IIS-LegacySnapIn\" /featurename:\"IIS-LoggingLibraries\"
    /featurename:\"IIS-ManagementConsole\"
    /featurename:\"IIS-ManagementScriptingTools\"
    /featurename:\"IIS-ManagementService\" /featurename:\"IIS-Metabase\"
    /featurename:\"IIS-NetFxExtensibility\" /featurename:\"IIS-Performance\"
    /featurename:\"IIS-RequestFiltering\" /featurename:\"IIS-RequestMonitor\"
    /featurename:\"IIS-Security\" /featurename:\"IIS-ServerSideIncludes\"
    /featurename:\"IIS-StaticContent\" /featurename:\"IIS-URLAuthorization\"
    /featurename:\"IIS-WebDAV\" /featurename:\"IIS-WebServer\"
    /featurename:\"IIS-WebServerManagementTools\"
    /featurename:\"IIS-WebServerRole\"
    /featurename:\"IIS-WindowsAuthentication\"
    /featurename:\"IIS-WMICompatibility\" /featurename:\"NetFx3\"
    /featurename:\"WAS-ConfigurationAPI\" /featurename:\"WAS-NetFxEnvironment\"
    /featurename:\"WAS-ProcessModel\"
    /featurename:\"WAS-WindowsActivationService\"
    /featurename:\"WCF-HTTP-Activation\" /featurename:\"WCF-NonHTTP-Activation\"
    \"${param::AILogFile}\" 2>&1",
    returns => ['0','1003', '3010'],

    unless => 'REG QUERY
    \"HKLM\SOFTWARE\HELLO_WORLD\AutoInstall\IISSubTypes\" /v IIS /t REG_DWORD /d
    /f 1',

    require => Exec['echo Install_IIS']

    }

    Output if I do a puppet agent --debug --test:

    debug: Executing 'c:\Windows\sysnative\dism.exe /online /norestart
    /logpath:"C:\temp\log.etw.txt" /enable-feature /ignor

    echeck /featurename:"IIS-ApplicationDevelopment" /featurename:"IIS-ASP"
    /featurename:"IIS-ASPNET" /featurename:"IIS-Basi

    cAuthentication" /featurename:"IIS-CGI"
    /featurename:"IIS-ClientCertificateMappingAuthentication"
    /featurename:"IIS-Comm

    onHttpFeatures" /featurename:"IIS-CustomLogging"
    /featurename:"IIS-DefaultDocument" /featurename:"IIS-DigestAuthenticati

    on" /featurename:"IIS-DirectoryBrowsing"
    /featurename:"IIS-HealthAndDiagnostics" /featurename:"IIS-HostableWebCore"
    /fea

    turename:"IIS-HttpCompressionDynamic"
    /featurename:"IIS-HttpCompressionStatic" /featurename:"IIS-HttpErrors"
    /featurenam

    e:"IIS-HttpLogging" /featurename:"IIS-HttpRedirect"
    /featurename:"IIS-HttpTracing" /featurename:"IIS-IIS6ManagementCompa

    tibility" /featurename:"IIS-IISCertificateMappingAuthentication"
    /featurename:"IIS-IPSecurity" /featurename:"IIS-ISAPIEx

    tensions" /featurename:"IIS-ISAPIFilter" /featurename:"IIS-LegacyScripts"
    /featurename:"IIS-LegacySnapIn" /featurename:"

    IIS-LoggingLibraries" /featurename:"IIS-ManagementConsole"
    /featurename:"IIS-ManagementScriptingTools" /featurename:"IIS

    -ManagementService" /featurename:"IIS-Metabase"
    /featurename:"IIS-NetFxExtensibility" /featurename:"IIS-Performance" /fe

    aturename:"IIS-RequestFiltering" /featurename:"IIS-RequestMonitor"
    /featurename:"IIS-Security" /featurename:"IIS-ServerS

    ideIncludes" /featurename:"IIS-StaticContent"
    /featurename:"IIS-URLAuthorization" /featurename:"IIS-WebDAV" /featurename

    :"IIS-WebServer" /featurename:"IIS-WebServerManagementTools"
    /featurename:"IIS-WebServerRole" /featurename:"IIS-WindowsA

    uthentication" /featurename:"IIS-WMICompatibility" /featurename:"NetFx3"
    /featurename:"WAS-ConfigurationAPI" /featurenam

    e:"WAS-NetFxEnvironment" /featurename:"WAS-ProcessModel"
    /featurename:"WAS-WindowsActivationService" /featurename:"WCF-H

    TTP-Activation" /featurename:"WCF-NonHTTP-Activation" >> "C:\\Program
    Files\\HELLO_WORLD\\log\\IIS7.log" 2>&1'

    err: /Stage[main]/Win-iis-install::Iis-config/Exec[install_iis]/returns:
    change from notrun to 0 1003 3010 failed:

    c:\Windows\sysnative\dism.exe /online /norestart
    /logpath:"C:\temp\log.etw.txt" /enable-feature /ignorecheck /featurena

    me:"IIS-ApplicationDevelopment" /featurename:"IIS-ASP"
    /featurename:"IIS-ASPNET" /featurename:"IIS-BasicAuthentication"

    /featurename:"IIS-CGI"
    /featurename:"IIS-ClientCertificateMappingAuthentication"
    /featurename:"IIS-CommonHttpFeatures" /

    featurename:"IIS-CustomLogging" /featurename:"IIS-DefaultDocument"
    /featurename:"IIS-DigestAuthentication" /featurename:

    "IIS-DirectoryBrowsing" /featurename:"IIS-HealthAndDiagnostics"
    /featurename:"IIS-HostableWebCore" /featurename:"IIS-Htt

    pCompressionDynamic" /featurename:"IIS-HttpCompressionStatic"
    /featurename:"IIS-HttpErrors" /featurename:"IIS-HttpLoggin

    g" /featurename:"IIS-HttpRedirect" /featurename:"IIS-HttpTracing"
    /featurename:"IIS-IIS6ManagementCompatibility" /featur

    ename:"IIS-IISCertificateMappingAuthentication"
    /featurename:"IIS-IPSecurity" /featurename:"IIS-ISAPIExtensions" /featur

    ename:"IIS-ISAPIFilter" /featurename:"IIS-LegacyScripts"
    /featurename:"IIS-LegacySnapIn" /featurename:"IIS-LoggingLibrar

    ies" /featurename:"IIS-ManagementConsole"
    /featurename:"IIS-ManagementScriptingTools"
    /featurename:"IIS-ManagementServic

    e" /featurename:"IIS-Metabase" /featurename:"IIS-NetFxExtensibility"
    /featurename:"IIS-Performance" /featurename:"IIS-Re

    questFiltering" /featurename:"IIS-RequestMonitor"
    /featurename:"IIS-Security" /featurename:"IIS-ServerSideIncludes" /fea

    turename:"IIS-StaticContent" /featurename:"IIS-URLAuthorization"
    /featurename:"IIS-WebDAV" /featurename:"IIS-WebServer"

    /featurename:"IIS-WebServerManagementTools" /featurename:"IIS-WebServerRole"
    /featurename:"IIS-WindowsAuthentication" /f

    eaturename:"IIS-WMICompatibility" /featurename:"NetFx3"
    /featurename:"WAS-ConfigurationAPI" /featurename:"WAS-NetFxEnvir

    onment" /featurename:"WAS-ProcessModel"
    /featurename:"WAS-WindowsActivationService"
    /featurename:"WCF-HTTP-Activation" /

    featurename:"WCF-NonHTTP-Activation" >> "C:\\Program
    Files\\HELLO_WORLD\\log\\IIS7.log" 2>&1 returned 87 instead of

    one of [0,1003,3010] at
    /etc/puppetlabs/puppet/modules/win-iis-install/manifests/iis-config.pp:15


    But if I run on command line I get the below:

    C:\Program Files (x86)\Puppet Labs\Puppet
    Enterprise\bin>c:\Windows\sysnative\dism.exe /online /norestart
    /logpath:"C:\t

    emp\log.etw.txt" /enable-feature /ignorecheck
    /featurename:"IIS-ApplicationDevelopment" /featurename:"IIS-ASP" /featuren

    ame:"IIS-ASPNET" /featurename:"IIS-BasicAuthentication"
    /featurename:"IIS-CGI" /featurename:"IIS-ClientCertificateMappin

    gAuthentication" /featurename:"IIS-CommonHttpFeatures"
    /featurename:"IIS-CustomLogging" /featurename:"IIS-DefaultDocumen

    t" /featurename:"IIS-DigestAuthentication"
    /featurename:"IIS-DirectoryBrowsing" /featurename:"IIS-HealthAndDiagnostics"

    /featurename:"IIS-HostableWebCore" /featurename:"IIS-HttpCompressionDynamic"
    /featurename:"IIS-HttpCompressionStatic" /f

    eaturename:"IIS-HttpErrors" /featurename:"IIS-HttpLogging"
    /featurename:"IIS-HttpRedirect" /featurename:"IIS-HttpTracing

    " /featurename:"IIS-IIS6ManagementCompatibility"
    /featurename:"IIS-IISCertificateMappingAuthentication" /featurename:"II

    S-IPSecurity" /featurename:"IIS-ISAPIExtensions"
    /featurename:"IIS-ISAPIFilter" /featurename:"IIS-LegacyScripts" /featur

    ename:"IIS-LegacySnapIn" /featurename:"IIS-LoggingLibraries"
    /featurename:"IIS-ManagementConsole" /featurename:"IIS-Mana

    gementScriptingTools" /featurename:"IIS-ManagementService"
    /featurename:"IIS-Metabase" /featurename:"IIS-NetFxExtensibil

    ity" /featurename:"IIS-Performance" /featurename:"IIS-RequestFiltering"
    /featurename:"IIS-RequestMonitor" /featurename:"

    IIS-Security" /featurename:"IIS-ServerSideIncludes"
    /featurename:"IIS-StaticContent" /featurename:"IIS-URLAuthorization"

    /featurename:"IIS-WebDAV" /featurename:"IIS-WebServer"
    /featurename:"IIS-WebServerManagementTools" /featurename:"IIS-We

    bServerRole" /featurename:"IIS-WindowsAuthentication"
    /featurename:"IIS-WMICompatibility" /featurename:"NetFx3" /feature

    name:"WAS-ConfigurationAPI" /featurename:"WAS-NetFxEnvironment"
    /featurename:"WAS-ProcessModel" /featurename:"WAS-Window

    sActivationService" /featurename:"WCF-HTTP-Activation"
    /featurename:"WCF-NonHTTP-Activation" >> "C:\Program
    Files\HELLO_WORLD\log\IIS7.log" 2>&1



    C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\bin>echo %errorlevel%

    3010



    Any help? This has me completely stumped since I'm running puppet and
    running the command from exactly the same command shell window on the
    server. I ran:

    whoami /groups

    and confirmed I am in the BUILTIN\Administrators group on this command
    prompt window. I tried wrapping it inside a cmd.exe but it still came back
    with different return codes compared to when I run it manually on the same
    command prompt.

    Regards,
    Ben

    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/puppet-users/-/DgtO3rZlXLUJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/puppet-users?hl=en.
    The issue is that on Windows we don't have a shell provider
    (currently), but you are trying to redirect the output of the command
    to a log file. So puppet is effectively trying to call

    CreateProcess('.... >> log.txt 2>&1')

    which results in error code 87 (The parameter is incorrect). To debug
    these sorts of issues I highly recommend Process Monitor, sort of like
    truss for Win32 APIs.

    To do stdout/stderr redirection, you'd have to wrap the command in a
    cmd process:

    command => 'cmd /c "dism.exe >> log.txt"'

    With that said, have you looked at the dism module on the forge?
    http://forge.puppetlabs.com/puppetlabs/dism I don't think, it captures
    the output of the dism commands, but we'd be happy to accept pull
    requests.

    Josh

    --
    Josh Cooper
    Developer, Puppet Labs

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedOct 18, '12 at 8:13a
activeOct 18, '12 at 4:52p
posts3
users3
websitepuppetlabs.com

3 users in discussion

Jcbollinger: 1 post Josh Cooper: 1 post Beeny: 1 post

People

Translate

site design / logo © 2022 Grokbase