[Puppet Users] [SC] EnumQueryServicesStatus:OpenService FAILED 123

2013-02-12 Thread Carlos Tapia
*Hi guys!*
*
*
*I'm trying to perform a service creation using SC  and if this service is 
already created, using an unless we can avoid it. *
*Sound very simple, but for any reason, when instructions are called by 
puppet they are not working instead you call directly, same instructions, 
using DOS, where works sweet.*
*
*
*Here is part of the code:*

$cmd = C:\\Windows\\System32\\cmd.exe
$scPath = C:\\Windows\\System32\\sc.exe
$findPath = C:\\Windows\\System32\\find.exe


# Create Service
  exec{'Create Service nsc-devops':
command = ${cmd} /c \${scPath} create nsc-devops binPath= 
\C:\\NSClient++\\nsclient++.exe\ DisplayName= \NSClient Devops\ Start= 
\auto\\,
path= 'c:\windows',
unless  = ${scPath} query nsc-devops | ${findPath} \nsc-devops\,
  }

# Modify Service Description
  exec{'Modify Service nsc-devops':
command = ${cmd} /c \${scPath} description nsc-devops \NSClient++ 
managed by DevOps\\,
path= 'c:\windows',
unless  = ${cmd} /c \${scPath} query nsc-devops\ | ${findPath} 
\nsc-devops\,
  }


*and below the error.*

Debug: Exec[Create Service nsc-devops](provider=windows): Executing check 
'C:\Windows\System32\cmd.exe /c C:\Windows\System32\sc.exe query 
nsc-devops | C:\Windows\System32\find.exe nsc-devops'
Debug: Executing 'C:\Windows\System32\cmd.exe /c 
C:\Windows\System32\sc.exe query nsc-devops | 
C:\Windows\System32\find.exe nsc-devops'
Debug: /Stage[main]/Nagios-devops/Exec[Create Service nsc-devops]/unless: 
[SC] EnumQueryServicesStatus:OpenService FAILED 123:
Debug: /Stage[main]/Nagios-devops/Exec[Create Service nsc-devops]/unless:
Debug: /Stage[main]/Nagios-devops/Exec[Create Service nsc-devops]/unless: 
The filename, directory name, or volume label syntax is incorrect.
Debug: Exec[Create Service nsc-devops](provider=windows): Executing 
'C:\Windows\System32\cmd.exe /c C:\Windows\System32\sc.exe create 
nsc-devops binPath= C:\NSClient++\nsclient++.exe DisplayName= NSClient 
Devops Sta
rt= auto'
Debug: Executing 'C:\Windows\System32\cmd.exe /c 
C:\Windows\System32\sc.exe create nsc-devops binPath= 
C:\NSClient++\nsclient++.exe DisplayName= NSClient Devops Start= 
auto'
Notice: /Stage[main]/Nagios-devops/Exec[Create Service nsc-devops]/returns: 
[SC] CreateService FAILED 1073:
Notice: /Stage[main]/Nagios-devops/Exec[Create Service nsc-devops]/returns:
Notice: /Stage[main]/Nagios-devops/Exec[Create Service nsc-devops]/returns: 
The specified service already exists.
Error: C:\Windows\System32\cmd.exe /c C:\Windows\System32\sc.exe create 
nsc-devops binPath= C:\NSClient++\nsclient++.exe DisplayName= NSClient 
Devops Start= auto returned 49 instead of one of [0]
C:/Program Files (x86)/Puppet 
Labs/Puppet/puppet/lib/puppet/util/errors.rb:60:in `fail'

*If I run the line that puppet marks as faulted, this is windows' answer:*
C:\C:\Windows\System32\cmd.exe /c C:\Windows\System32\sc.exe query 
nsc-devops | C:\Windows\System32\find.exe nsc-devops
SERVICE_NAME: nsc-devops

Any idea???
Thanks for your help!

BR,
Carlos!

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] How to remove warnings related to Resource references should now be capitalized when starts with number?

2012-10-05 Thread Carlos Tapia
Hi Guys!

I want to clean warning messages: *warning: Deprecation notice:  Resource 
references should now be capitalized*... 
It is related to following line:

*  - appcmd::32Bit['32BitappPool']*

If I try to change any piece of the code using caps. for the fisrt letter, 
a syntax error is displayed.

*   err: Could not parse for environment production: Syntax error at ':'; 
expected '}' *

Any suggestion?
(The main issue is that the reference values start with numbers. With the 
refers that start with letters we have no problem, 'cause we know the 
structure)

Thnx!

-- 
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/-/Oai34whey_8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.