Re: [Puppet Users] exec resource not refreshed when subscribed resource changes

2013-03-14 Thread Keith Burdis
Perhaps try:

1) Adding a notify = Exec['unpack_archive'] to the file resource.

2) Adding refreshonly = true to the exec.

3) Remove the creates and subscribe  from the exec.

That way the exec will only be called when the file changes.

- Keith
On 14 Mar 2013 07:56, dirk.heinri...@altum.de wrote:

 Hello,

 I've created a little class which should unpack a 7z archive on Windows.
 The class has a parameter for passing in the archive version, so that I can
 trigger an update when a new version of the archive is available. A
 simplyfied version looks like this (requires 7z):

 class my_archive ($version = undef) {
 file { 'version':
 path = 'C:/the_version',
 content = $version,
 ensure = present,
 mode = 0666,
 }

 # Extracting archive creates C:/some/dir
 exec { 'unpack_archive':
 command = cmd /c rmdir /S /Q C:\some/dir  7z x -oC:/some
 C:/path/to/archive-${version}.7z,
 creates = 'C:/some/dir/a_file',
 require = File['version'],
 path = $::path,
 subscribe = File['version'],
 }
 }

 I trigger this from site.pp like so:

   class { 'my_archive':
 version = '1.2.3'
   }

 The initial unpacking of (an older version of) the archive works fine, but
 when I change the version, I see that this change is recognized by the
 agent and a refresh is triggered, but the command isn't executed:

 Info: /Stage[main]/My_archive/File[version]: Filebucketed C:/the_version
 to puppet with sum 185910a1e94c599dc6541266286675bc
 Notice: /Stage[main]/My_archive/File[version]/content: content changed
 '{md5}185910a1e94c599dc6541266286675bc' to
 '{md5}d0cdd9a6594750ea1063643fcda90d3b'
 Debug: /Stage[main]/My_archive/File[version]: The container
 Class[My_archive] will propagate my refresh event
 Info: /Stage[main]/My_archive/File[version]: Scheduling refresh of
 Exec[unpack_archive]
 Debug: /Schedule[weekly]: Skipping device resources because running on a
 host
 Debug: Prefetching windows resources for package
 Notice: /Stage[main]/My_archive/Exec[unpack_archive]: Triggered 'refresh'
 from 1 events
 Debug: /Stage[main]/My_archive/Exec[unpack_archive]: The container
 Class[My_archive] will propagate my refresh event
 Debug: Class[My_archive]: The container Stage[main] will propagate my
 refresh event
 Debug: /Schedule[puppet]: Skipping device resources because running on a
 host
 Debug: Finishing transaction 144533424
 Debug: Storing state
 Debug: Stored state in 0.06 seconds
 Notice: Finished catalog run in 0.75 seconds

 I tried to omit creates = ..., but this only makes the agent run the
 resource every time. I also tried adding refreshonly = true, but this
 doesn't help. I even tried adding refresh = ... with the exact same
 command without any change in behaviour.

 Any hints what could be wrong?

 Puppet Agent version on Windows is 3.1.0.

 Thanks...

 Dirk

 --
 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.




-- 
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] Re: exec resource not refreshed when subscribed resource changes

2013-03-14 Thread dirk . heinrichs


Am Donnerstag, 14. März 2013 08:56:31 UTC+1 schrieb dirk.he...@altum.de:

 Hello,

 I've created a little class which should unpack a 7z archive on Windows. 
 The class has a parameter for passing in the archive version, so that I can 
 trigger an update when a new version of the archive is available. A 
 simplyfied version looks like this (requires 7z):

 class my_archive ($version = undef) {
 file { 'version':
 path = 'C:/the_version',
 content = $version,
 ensure = present,
 mode = 0666,
 }

 # Extracting archive creates C:/some/dir
 exec { 'unpack_archive':
 command = cmd /c rmdir /S /Q C:\some/dir  7z x -oC:/some 
 C:/path/to/archive-${version}.7z,
 creates = 'C:/some/dir/a_file',
 require = File['version'],
 path = $::path,
 subscribe = File['version'],
 }
 }

 I trigger this from site.pp like so:

   class { 'my_archive':
 version = '1.2.3'
   }

 The initial unpacking of (an older version of) the archive works fine, but 
 when I change the version, I see that this change is recognized by the 
 agent and a refresh is triggered, but the command isn't executed:

 Info: /Stage[main]/My_archive/File[version]: Filebucketed C:/the_version 
 to puppet with sum 185910a1e94c599dc6541266286675bc
 Notice: /Stage[main]/My_archive/File[version]/content: content changed 
 '{md5}185910a1e94c599dc6541266286675bc' to 
 '{md5}d0cdd9a6594750ea1063643fcda90d3b'
 Debug: /Stage[main]/My_archive/File[version]: The container 
 Class[My_archive] will propagate my refresh event
 Info: /Stage[main]/My_archive/File[version]: Scheduling refresh of 
 Exec[unpack_archive]
 Debug: /Schedule[weekly]: Skipping device resources because running on a 
 host
 Debug: Prefetching windows resources for package
 Notice: /Stage[main]/My_archive/Exec[unpack_archive]: Triggered 'refresh' 
 from 1 events
 Debug: /Stage[main]/My_archive/Exec[unpack_archive]: The container 
 Class[My_archive] will propagate my refresh event
 Debug: Class[My_archive]: The container Stage[main] will propagate my 
 refresh event
 Debug: /Schedule[puppet]: Skipping device resources because running on a 
 host
 Debug: Finishing transaction 144533424
 Debug: Storing state
 Debug: Stored state in 0.06 seconds
 Notice: Finished catalog run in 0.75 seconds

 I tried to omit creates = ..., but this only makes the agent run the 
 resource every time. I also tried adding refreshonly = true, but this 
 doesn't help. I even tried adding refresh = ... with the exact same 
 command without any change in behaviour.

 Any hints what could be wrong?

 Puppet Agent version on Windows is 3.1.0.


Got it: Omitting creates AND adding refreshonly = true makes the class 
work as desired.

Bye...

Dirk

-- 
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.




Re: [Puppet Users] Re: Windows Remote Desktop Services (Could not find a suitable provider for dism)

2013-03-14 Thread jim
Good Morning Vladimir

I think discovered what the problem is but not an experienced coder to be 
able to change the code to reflect my discovery.

Now the issue only happens when installing Remote Desktop Services, either 
by DISM or powershell, I finally worked ou,t that when the host reboots, it 
boots into a Terminal Server mode and doesn't allow user e.g. puppet 
agent to install anything via dism!

because the host is in terminal server mode, you need to run the following 
commands before and after dism for it to work.

change user /install
run puppet (works fine no error)

i've run puppet multiple times and no error, no trying to reinstall Remote 
Desktop Services - works fine

as soon as you run this command to close install mode

change user /execute

we start getting the error again

*Could not find a suitable provider for dism*

so Vladimir, what I think need to happen within the dism code 

when running dism, if feature equals AppServer run this command before 
change user /install
run dism part
then change mode back to execute
change user /execute
complete successful

Hope this make sense, and is possible

Kind Regards

Jim




On Wednesday, 13 March 2013 15:06:18 UTC, Vladimir Rutsky wrote:

 James,


 On Wed, Mar 13, 2013 at 6:42 PM, jim str...@gmail.com javascript: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[**
 AppServer-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

Re: [Puppet Users] Re: PuppetDB queue problem

2013-03-14 Thread ak0ska
Hello Ken,

I really appreciate you guys looking into this problem, and I'm happy to 
provide you with the data you ask for. However, I feel like I should ask, 
whether you think this problem is worth your efforts, if rebuilding the 
database might solve the issue?

Cheers,

ak0ska

On Thursday, March 14, 2013 8:05:59 AM UTC+1, Ken Barber wrote:

 Hi ak0ska, 

 So I've been spending the last 2 days trying all kinds of things to 
 replicate your constraint violation problem and I still am getting 
 nowhere with it. I've been speaking to all kinds of smart people and 
 we believe its some sort of lock and/or transactional mode problem but 
 none of my testing can replicate it. 

 My latest test was something like: 

 https://gist.github.com/kbarber/5157836 

 But with all that preparation and load simulation I still couldn't 
 replicate it :-(. 

 I think I need more data from you ... in this case, a statement log. 
 Now a statement log can be pretty heavy, so if we can get the data 
 surrounding a GC only that should be enough - however I anticipate it 
 might reduce some performance so if you're apprehensive about doing it 
 in production I fully understand. I'm just running out of ideas, and 
 without more data I may have trouble coming to a conclusion. 

 Anyway, if at all possible the instructions for enabling this are as 
 follows: 

 * Go to your postgresql.conf file (On RHEL 6 this is usually located 
 in /var/lib/pgsql/data) 
 * Add/modify the entries: 
 log_statement = 'all' 
 log_line_prefix = '%m PID[%p] SID[%c] VTID[%v] TID[%x] ' 
 * Restart postgresql 
 * Logs should go to: /var/lib/pgsql/data/pg_log 

 The closer you can do this to being set _just before_ a GC run the 
 better, as it will reduce the amount of time this setting needs to be 
 on. Once you have a GC run and a subsequent constraint logged you 
 should be able to turn it off. Don't worry about PuppetDB during these 
 cases, it retries the database so if you can take the small hit with 
 queries the outage should be quick while you switch off/on the setting 
 (and be mindful that catalogs/facts/reports submissions will get 
 queued, queries of course will fail during that short time during DB 
 restart). 

 Now the data itself is going to obviously contain private items, so if 
 you prefer to send it to me privately thats fine (contact me off this 
 list if so). Otherwise, it might need some scrubbing. 

 So the concern I have with your issue, even though it doesn't stop a 
 catalog from being submitted - is that you're seeing a 'block' when 
 those two catalogs get submitted which makes me fear that data doesn't 
 get populated until _after_ the GC is complete. This is a concern 
 because we don't want data to be delayed like this. If this wasn't the 
 case we could happily let it fail and retry, ultimately the data isn't 
 lost, but we should be able to process data within reasonable time 
 limits without you have to worry about database GC slowing things 
 down. 

 Now in regards to your performance, we are going to keep looking into 
 the results you gave us. Looking at your settings Deepak and I think 
 you probably need to increase at least work_mem to 16MB and 
 maintenance_work_mem to 32MB (this is used during vacuum) the main 
 item being work_mem here really. These are reasonable changes we've 
 seen other users apply with success, but alone they probably won't 
 solve your issue - it would be good to just get you working using 
 higher values for these. 

 I'm very curious to understand the disk IO for your systems also. What 
 are the nature of the disks where your database is located? Are they 
 SCSI/SATA/FC or otherwise? What filesystem type are you using? Can you 
 give me any other details you might find interesting? 

 What are the results of the command: 

 iostat -k 5 

 A few samples of the run would be useful to see, so we can understand 
 the average disk IO going on here. 

 FYI To give you an idea of what we _should_ be seeing for say, just 
 one of your queries, here is a query on a Centos 5.8 box (running just 
 postgresql 8.1 actually): 

 puppetdb=# EXPLAIN ANALYZE SELECT COUNT(*) AS c FROM (SELECT DISTINCT 
 resource FROM catalog_resources cr, certname_catalogs cc, certnames c 
 WHERE cr.catalog=cc.catalog AND cc.certname=c.name AND c.deactivated 
 IS NULL) r; 
  QUERY 
 PLAN 

 -
  

 --- 
  Aggregate  (cost=91792.54..91792.55 rows=1 width=0) (actual 
 time=2611.872..2611.872 rows=1 loops 
 =1) 
-  HashAggregate  (cost=91737.14..91761.76 rows=2462 width=41) 
 (actual time=2606.507..2609.48 
 9 rows=5478 loops=1) 
  -  Hash Join  (cost=184.36..90322.32 rows=565926 width=41) 
 (actual time=7.060..2072.000 
  rows=867847 loops=1) 
Hash Cond: ((cr.catalog)::text = 

Re: [Puppet Users] Re: Copying a 900 mb file to Windows !!!

2013-03-14 Thread Rich Siegel
I do it with an exec resource using PowerShell provider and get-webfile. Works 
well and fast.  If interested I can post the implementation details. 

-- 
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.




Re: [Puppet Users] Re: Windows Remote Desktop Services (Could not find a suitable provider for dism)

2013-03-14 Thread Vladimir Rutsky
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 stra...@gmail.com 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\Administratorset
 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[**
 AppServer-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[**
 

Re: [Puppet Users] Re: Copying a 900 mb file to Windows !!!

2013-03-14 Thread Rakesh Kathpal
That will be really great.

Awaiting the implementation details from your side.

Thanks  Regards,

Rakesh K.

On Thu, Mar 14, 2013 at 6:08 PM, Rich Siegel rismo...@gmail.com wrote:

 I do it with an exec resource using PowerShell provider and get-webfile.
 Works well and fast.  If interested I can post the implementation details.

 --
 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.




-- 
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] Re: Custom ensure instead of ensurable in type provider

2013-03-14 Thread jcbollinger


On Thursday, March 14, 2013 2:28:13 AM UTC-5, dirk.he...@altum.de wrote:

 Am Mittwoch, 13. März 2013 17:00:18 UTC+1 schrieb jcbollinger:



 My problem now is that I don't know how to implement ensure for this 
 case, as I cannot use ensurable in the type.


 Your problem is that you are conflating distinct (for your purposes) 
 aspects of your resource's state.  If you care at times whether the 
 variable is declared at all or not, and at other times what its value is, 
 then those should be separate properties.  Your resource declarations will 
 then look like this:

 env_var { 'AWESOMENESS':
   value = 'meh',
   # optional:
   ensure = present
 }

 or

 env_var { 'AWESOMENESS':
   ensure = absent
 }


 I've changed the logic of exists? a bit to reflect this, and it works. 
 However, one has to remember not to provide a value if ensure = absent 
 was specified.



That's under your control.  Were I you, I would probably implement flushing 
for this resource type instead of applying changes directly in response to 
property changes.  See 
http://docs.puppetlabs.com/guides/provider_development.html#flushing.  That 
way your provider can act based on all of its properties together, instead 
of acting separately on each one.

Alternatively, your provider's value=() method could condition its behavior 
on its resource's should(:ensure) value (and perhaps vise versa, too), so 
that it does not perform needless operations.

 

 Or is there a way to check this in the provider?



There are validation and munging hooks for resource parameters, but they 
only work on a parameter-by-parameter basis.  As far as I know, there is no 
whole-resource validation hook built into the framework.


John

-- 
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.




Re: [Puppet Users] How to add a new line at a particular place in a file..

2013-03-14 Thread Evan Hisey
On Wed, Mar 13, 2013 at 4:06 AM, yarlagadda ramya rams.15...@gmail.com wrote:
 Hi all,

 How can i write a puppet code such that..it adds a line of content that i
 want..at a desired place in a file..

 if [ x$JAVA_OPTS = x ]; then
JAVA_OPTS=-Xms64m -Xmx512m -XX:MaxPermSize=256m
 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true
 -Dsun.rmi.dgc.client.gcInterval=360
 -Dsun.rmi.dgc.server.gcInterval=360
JAVA_OPTS=$JAVA_OPTS
 -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS
 -Djava.awt.headless=true
JAVA_OPTS=$JAVA_OPTS -Djboss.server.default.config=standalone.xml

 This a part of file and i want to add --
 -Djboss.socket.binding.port-offset=900 -- after 360 in the 3rd
 line..through puppet ode..how can i do that??
n some one please help me??

 Regards
 Ramya Y
Ramya-
  Have you looked at
Augeas,http://projects.puppetlabs.com/projects/1/wiki/puppet_augeas ?
It is designed to solve just this problem.

Evan

-- 
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.




Re: [Puppet Users] Re: Windows Remote Desktop Services (Could not find a suitable provider for dism)

2013-03-14 Thread jim
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

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 str...@gmail.com javascript: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\Administratorset
 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 

[Puppet Users] Re: Need help with apt::source and stages

2013-03-14 Thread jcbollinger


On Wednesday, March 13, 2013 8:46:42 AM UTC-5, Cosmin Luță wrote:

 Hi,

 I have a local Puppet installation on which I've done:

 # puppet module install puppetlabs/apt  
 Preparing to install into /etc/puppet/modules ...
 Downloading from http://forge.puppetlabs.com ... 
 Installing -- do not interrupt ...   
 /etc/puppet/modules  
 └─┬ puppetlabs-apt (v1.1.0)  
   └── puppetlabs-stdlib (v3.2.0) 


 I also have the following nodes.pp which I want to apply:

 node default {  
 include stdlib  

 class {'apt':
 always_apt_update = true,
 disable_keys = true,
 stage = 'setup'
 }
 -
 apt::source { cassandra:
 location = http://debian.datastax.com/community;,
 release = stable,
 repos = main,
 key = B999A372,
 key_source = http://debian.datastax.com/debian/repo_key;, 
 include_src = false
 }
 }


 When I try to apply it, I get:

 # puppet apply nodes.pp
 err: Could not apply complete catalog: Found 1 dependency cycle:
 (Anchor[apt::key B999A372 present] = Apt::Key[Add key: B999A372 from 
 Apt::Source cassandra] = File[cassandra.list] = Exec[apt_update] = 
 Class[Apt::Update] = Stage[setup] = Stage[main] = Class[Main] = 
 Node[default] = Apt::Source[cassandra] = File[cassandra.list])
 Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle 
 or GraphViz
 notice: Finished catalog run in 0.12 seconds


 The problem seems to be in the stage = 'setup' parameter, but I'd like 
 to understand what's going on and what can I do to solve this issue (this 
 is just a proof of concept of what's going on in the larger puppet codebase 
 I've inherited). 

 I'm using Puppet 2.7.20.



I'd need to see the code of your class apt to be sure, but you are 
probably running into http://projects.puppetlabs.com/issues/8263.  If 
that's so, then the solution is to either use ordinary relationships 
instead of run stages, or to update your class(es) to propagate the run 
stage assigned to them to classes they themselves declare (where it is 
appropriate to do so).  The $stage magic variable can help you do that.


John

-- 
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] Re: hiera_hash lookups for included classes?

2013-03-14 Thread jcbollinger


On Wednesday, March 13, 2013 8:51:04 PM UTC-5, Ellison Marks wrote:

 You can just call hiera_hash() from within your manifest, no?



No.  The OP wants hash merging, and hiera_hash() doesn't do that (as far as 
I understand).  It will instead return a hash whose keys are hierarchy 
levels, and whose values are those associated with the requested key at the 
corresponding level.  Hash merging is supposedly included in Hiera 1.2, 
which is now at release candidate stage, but I don't know what the API for 
it looks like.

With older hiera, you can use hiera_array() to get the component hashes in 
hierarchy order, and then merge them manually.  The puppetlabs-stdlib 
module provides a merge function that does almost what the OP wants, but 
although it will merge an arbitrary number of hashes, I don't think it will 
accept them in array-of-hashes form.


John

-- 
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.




Re: [Puppet Users] How to add a new line at a particular place in a file..

2013-03-14 Thread Erick Ocrospoma Lazo
Puppetlabs provides a module - puppet-concat -  with it you can concatenate
static text in any file.



---
sı ɯǝ1qoɹd ɹnoʎ ʇɐɥʍ ǝǝs ı ʞuıɥʇ ı


http://www.utpinux.org
http://zipper.utpinux.org
http://twitter.com/zerick

---




On 13 March 2013 04:06, yarlagadda ramya rams.15...@gmail.com wrote:

 Hi all,

 How can i write a puppet code such that..it adds a line of content that i
 want..at a desired place in a file..

 if [ x$JAVA_OPTS = x ]; then
JAVA_OPTS=-Xms64m -Xmx512m -XX:MaxPermSize=256m
 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true
 -Dsun.rmi.dgc.client.gcInterval=360
 -Dsun.rmi.dgc.server.gcInterval=360
JAVA_OPTS=$JAVA_OPTS
 -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS
 -Djava.awt.headless=true
JAVA_OPTS=$JAVA_OPTS -Djboss.server.default.config=standalone.xml

 This a part of file and i want to add --
 -Djboss.socket.binding.port-offset=900 -- after 360 in the 3rd
 line..through puppet ode..how can i do that??


 Can some one please help me??

 Regards
 Ramya Y

  --
 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.




-- 
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.




Re: [Puppet Users] enabling AD authentication on Puppet Enterprise 2.7 evaluation

2013-03-14 Thread Jill Burrows
Hi Jeff,

When you say that it looks just like the above file, does that mean it
doesn't have the CASServer::Authenticators::SQLEncrypted authenticator
section that is supplied by default? It should have a section at the top:

  - class: CASServer::Authenticators::SQLEncrypted
database:
  adapter: mysql
  database: console_auth
  username: console_auth
  password: console_auth
  server: localhost
user_table: users
username_column: username


The values specified should be the ones generated/specified during
installation. There's also a possibility of the YAML being malformed,
there's more detail here:
https://ask.puppetlabs.com/question/428/error-starting-pe-puppet-dashboard-workers-script/We're
using the compact nested mapping format. The spec for the is here:
http://www.yaml.org/spec/1.2/spec.html#id2760821

I hope this helps!

-Jill


On Wed, Mar 13, 2013 at 7:34 AM, Jeff quainta...@gmail.com wrote:

 Hi All, I'm testing a Puppet install and running into a problem enabling
 AD authentication:

 http://docs.puppetlabs.com/pe/2.7/console_auth.html#using-third-party-authentication-services

 I've followed the instructions in there and the end result is either only
 AD auth or only local auth, once I turn on activedirectoryldap inside the
 cas_client_config.yml file I get invalid credentials given for my local
 user in the console-auth logs.. if i disable activedirectory i can locally
 authenticate again.

 furthermore, when I do log in with the local account I see queries going
 to my AD server with tcpdump, it appears at least that puppet console isn't
 even attempting a local check.

 my cas_client_config.yml file looks exactly like the example in the above
 URL with both local and activedirectory uncommented.



 --
 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.




-- 
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.




Re: [Puppet Users] Can't get past Permission denied error

2013-03-14 Thread Aaron Grewell
Do you have selinux in enforcing mode? If so, try setting it to permissive
mode and see if it starts working.
On Mar 14, 2013 8:09 AM, Mike Canty cantyma...@yahoo.com wrote:

 I am running Centos 6 and was able to install Puppet 3.1.1.  However, when
 trying to run puppet, as root, for the first time, I get the following
 message:

 # puppet master --nodaemonize --verbose --debug

 Could not prepare for exection: Permission denied -
 /etc/puppet/ssl/ca/ca_key.pem

 I'm not sure what the next steps are to troubleshoot this.  Could anyone
 please provide insight and help?

 --
 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.




-- 
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] Help me wrap my head around Yaml/Hiera with erwbgy/system

2013-03-14 Thread Byron Miller
Trying to figure out the erwbgy/system plugin and just getting stuck.. 
first run it did some changes, but it ignored parameters for ntp and now 
its not refreshing if I update the yaml at all, Im slightly lost at what I 
may be missing :)
 
hiera.yaml
---
:hierarchy:
- %{certname}
- %{environment}
- global
- %{environment}/common
:backends:
  - yaml
:yaml:
  :datadir: '/etc/puppet/hieradata'
 
 
common.yaml
 
system::packages::schedule:  'never'
system::yumgroups::schedule: 'never'
system::augeas:
  'ntp':
context: '/files/etc/ntp.conf'
changes:
  - 'set server[0] 0.vmware.pool.ntp.org'
  - 'set server[1] 1.vmware.pool.ntp.org'
  - 'set server[2] 2.vmware.pool.ntp.org'
 
first run, it updated to 0.pool.ntp.org and its still doing that, so I 
missed something important here.
 
Puppet 3.1.1
 
I noticed all the hiera examples on the site for puppet all say coming 
soon.  
 
 
 
 

-- 
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.




Re: [Puppet Users] Automatic puppet agent upgrade based on server upgrade?

2013-03-14 Thread Matthaus Owens
I'm CCing pe-users as this is a PE specific question.

Adrien wrote a module called pe_upgrade [
http://forge.puppetlabs.com/adrien/pe_upgrade ] that can be used to do
what you're looking for. It isn't quite the same as `puppet node
upgrade...` but it's in the same ballpark.

On Wed, Mar 13, 2013 at 4:09 PM, Erik Dalén erik.gustav.da...@gmail.com wrote:
 I just do something like: package { 'puppet': ensure = '3.1.1-puppetlabs1'
 }

 Not sure how to do it with PE though.


 On 13 March 2013 23:30, Josh Harrison hij...@gmail.com wrote:

 I'm running a test environment of PE and it of course just went from 2.7.1
 to 2.7.2. It seems like there must be a way to push the agent upgrades out
 via puppet, and not have to touch each machine. Even if it isn't an
 automatic thing, being able to issue puppet node upgrade certname from
 the server or something would be pretty handy.
 I've searched around as I'm certain this has been a question for others
 but I'm not finding any good results. Perhaps I'm just not making the right
 searches?
 Anyhow, I thought I'd ask here!
 Thanks

 --
 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.






 --
 Erik Dalén

 --
 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.





--
Matthaus Owens
Release Manager, Puppet Labs

-- 
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] Re: Help me wrap my head around Yaml/Hiera with erwbgy/system

2013-03-14 Thread windowsrefund
plugin aside, I strongly suggest not settling for YAML as a backend for 
Hiera since you're basically ending up with the same problem you were 
probably trying to solve; managing data in files. Sure, they're different 
files but still files. You may as well keep the data in your Puppet 
manifests and manage the data there...



-- 
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] Installing a tarball using Puppet

2013-03-14 Thread ridha gadhgadhi
Hi all,

I want to install opensaf from a tar file. Below, the content of my script 
shell:

---
tar -xvf opensaf
cd opensaf 
./configure --disable-tipc
make
make install


Any help will be much appreciated !

Regards,

--Ridha

-- 
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] Re: Ubuntu 12.04 adding user with password

2013-03-14 Thread Vivek Gupta
Hi , I am facing the same error, were you able to get it working ?

cheers.

On Monday, August 6, 2012 11:33:05 PM UTC+5:30, Aaron Masino wrote:

 Hi All,

 I am trying to using Puppet to add a user with a password on an Ubuntu 
 12.04 system with Ruby 1.8.7. I have tried this in the two ways as detailed 
 below. In both cases, the attempt fails with the message Provider useradd 
 does not support features manages_passwords; not managing attribute 
 password. I have read various posts about the requirement for libshadow. 
 In both the approaches I tried, I *think* I am satisfying this but perhaps 
 not. Any help is appreciated. 

 1. Install libshadow at the command line and then run my puppet script
 $sudo apt-get update
 $sudo apt-get install libshadow-ruby1.8
 $puppet apply myuserscript
  
 2. Install libshadow as part of my manifest setup. The relevant code from 
 my classes is:
  
 class hadoop::usr ($usr_name = 'hadoop', $hashed_pw = undef) {
 
 include ruby::libshadow
  group { $usr_name:
 ensure = present,
 }
  user { $usr_name:
 ensure = present,
 gid = $usr_name,
 home   = /home/${usr_name},
 password = $hashed_pw,
 managehome = true,
 }
Class['ruby::libshadow'] - Group[$usr_name] - User[$usr_name]
 }

 class ruby::libshadow {
 package {'libshadow-ruby1.8':
 ensure = installed,
 }
 }


-- 
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] Re: Help me wrap my head around Yaml/Hiera with erwbgy/system

2013-03-14 Thread Byron Miller

On Thursday, March 14, 2013 3:10:01 PM UTC-5, windowsrefund wrote:

 plugin aside, I strongly suggest not settling for YAML as a backend for 
 Hiera since you're basically ending up with the same problem you were 
 probably trying to solve; managing data in files. Sure, they're different 
 files but still files. You may as well keep the data in your Puppet 
 manifests and manage the data there...



  
thanks, that's what i'm discovering..  while the plugin ads some nice 
functionality, my resources aren't as flat as the YAML / plugin schema is 
designed for.

-- 
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] Re: hiera_hash lookups for included classes?

2013-03-14 Thread Ellison Marks
I'm pretty sure it does do merging, in the yaml backend at least.

case resolution_type
...
when :hash
raise Exception, Hiera type mismatch: expected Hash and got 
#{new_answer.class} unless new_answer.kind_of? Hash
answer ||= {}
answer = new_answer.merge answer

On Thursday, March 14, 2013 7:26:59 AM UTC-7, jcbollinger wrote:



 On Wednesday, March 13, 2013 8:51:04 PM UTC-5, Ellison Marks wrote:

 You can just call hiera_hash() from within your manifest, no?



 No.  The OP wants hash merging, and hiera_hash() doesn't do that (as far 
 as I understand).  It will instead return a hash whose keys are hierarchy 
 levels, and whose values are those associated with the requested key at the 
 corresponding level.  Hash merging is supposedly included in Hiera 1.2, 
 which is now at release candidate stage, but I don't know what the API for 
 it looks like.

 With older hiera, you can use hiera_array() to get the component hashes in 
 hierarchy order, and then merge them manually.  The puppetlabs-stdlib 
 module provides a merge function that does almost what the OP wants, but 
 although it will merge an arbitrary number of hashes, I don't think it will 
 accept them in array-of-hashes form.


 John



-- 
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.




Re: [Puppet Users] Re: PuppetDB queue problem

2013-03-14 Thread Ken Barber
So I have this sinking feeling that all of your problems (including
the constraint side-effect) are related to general performance issues
on your database 'for some reason we are yet to determine'. This could
be related to IO contention, it could be a bad index (although you've
rebuilt them all right?) or something else. What continues to bother
me is the fact you have only managed to reduce your DB size to 30GB,
this is far larger than I expect and I it screams 'problem' to me. It
should be less than 5 GB, at least based on my rough calculations from
other DBs I've seen in the wild.

It could very well be that something still isn't sufficiently
organised (index, tablespace data) for optimal performance. A
recreation of the database is by all means a very fast way to recreate
everything, its like heaving an axe though. Having said that, it is
fast and would eradicate a lot of back  forth between us to try and
solve this problem.

A dump, drop, recreate and restore is also another way, not 100% the
same thing, but close to it.

Its entirely up to you - if you want to try either option then go
ahead. It would be a fast step to achieving a lot of small steps. If
it works, we may have lost some clarity on the issue however, so might
be good to keep the original DB backup. If it doesn't work, at least
we have ruled out a lot of possibilities in one quick action. So yeah,
I wouldn't be upset if you take this action - there is a reason why I
suggested this earlier, and that is it performs a lot of actions in
one single step ... and I still think this is a viable action, but
since you were keen on trying other things I was happy to go along
:-). At the end of the day your time and your risk assessment is up to
you. If it was me, yeah, I would try it. Esp. considering the amount
of time already spent with very little final result.

Thanks for being patient with me on this btw ... :-).

ken.

On Thu, Mar 14, 2013 at 3:36 AM, ak0ska akos.he...@gmail.com wrote:
 Hello Ken,

 I really appreciate you guys looking into this problem, and I'm happy to
 provide you with the data you ask for. However, I feel like I should ask,
 whether you think this problem is worth your efforts, if rebuilding the
 database might solve the issue?

 Cheers,

 ak0ska


 On Thursday, March 14, 2013 8:05:59 AM UTC+1, Ken Barber wrote:

 Hi ak0ska,

 So I've been spending the last 2 days trying all kinds of things to
 replicate your constraint violation problem and I still am getting
 nowhere with it. I've been speaking to all kinds of smart people and
 we believe its some sort of lock and/or transactional mode problem but
 none of my testing can replicate it.

 My latest test was something like:

 https://gist.github.com/kbarber/5157836

 But with all that preparation and load simulation I still couldn't
 replicate it :-(.

 I think I need more data from you ... in this case, a statement log.
 Now a statement log can be pretty heavy, so if we can get the data
 surrounding a GC only that should be enough - however I anticipate it
 might reduce some performance so if you're apprehensive about doing it
 in production I fully understand. I'm just running out of ideas, and
 without more data I may have trouble coming to a conclusion.

 Anyway, if at all possible the instructions for enabling this are as
 follows:

 * Go to your postgresql.conf file (On RHEL 6 this is usually located
 in /var/lib/pgsql/data)
 * Add/modify the entries:
 log_statement = 'all'
 log_line_prefix = '%m PID[%p] SID[%c] VTID[%v] TID[%x] '
 * Restart postgresql
 * Logs should go to: /var/lib/pgsql/data/pg_log

 The closer you can do this to being set _just before_ a GC run the
 better, as it will reduce the amount of time this setting needs to be
 on. Once you have a GC run and a subsequent constraint logged you
 should be able to turn it off. Don't worry about PuppetDB during these
 cases, it retries the database so if you can take the small hit with
 queries the outage should be quick while you switch off/on the setting
 (and be mindful that catalogs/facts/reports submissions will get
 queued, queries of course will fail during that short time during DB
 restart).

 Now the data itself is going to obviously contain private items, so if
 you prefer to send it to me privately thats fine (contact me off this
 list if so). Otherwise, it might need some scrubbing.

 So the concern I have with your issue, even though it doesn't stop a
 catalog from being submitted - is that you're seeing a 'block' when
 those two catalogs get submitted which makes me fear that data doesn't
 get populated until _after_ the GC is complete. This is a concern
 because we don't want data to be delayed like this. If this wasn't the
 case we could happily let it fail and retry, ultimately the data isn't
 lost, but we should be able to process data within reasonable time
 limits without you have to worry about database GC slowing things
 down.

 Now in regards to your performance, we are going to keep 

[Puppet Users] Re: Installing a tarball using Puppet

2013-03-14 Thread llowder


On Thursday, March 14, 2013 1:20:39 PM UTC-5, ridha gadhgadhi wrote:

 Hi all,

 I want to install opensaf from a tar file. Below, the content of my script 
 shell:

 ---
 tar -xvf opensaf
 cd opensaf 
 ./configure --disable-tipc
 make
 make install

 

 Any help will be much appreciated !


You have 2 options. You can put what you did above in a shell script, and 
thenuse a file to push the tarball and the shell script, then exec to run 
the script.

The BETTER option is to use fom or whatever and build a package (rpm, deb, 
whatever) and then install that using a package resource from a local repo.
 

 Regards,

 --Ridha


-- 
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] PuppetDB Constraint error

2013-03-14 Thread Ken Barber
Hey all,

I'm hoping I can get some information from other users on the list in
relationship ak0ska's problem listed below. I thought I would start a
new thread so more users would see this message and not loose it in
the original thread which is already pretty long:

https://groups.google.com/forum/?fromgroups=#!topic/puppet-users/yRMI1J_y6Ps

Basically I want to see if anyone is seeing the same constraint errors
at all in your postgresql log:

[2013-03-12 05:51:19 CET]DETAIL:  Key
(catalog)=(c93825c7157cba8c10641b54d9dce17eb0ce618b) is not present in
table catalogs.
[2013-03-12 05:51:19 CET]STATEMENT:  INSERT INTO certname_catalogs
(certname,catalog,timestamp) VALUES ($1,$2,$3) RETURNING *

It seems to me this problem is enacted under heavy load or an
attenuated scenario like 'load', but I'm having trouble trying to
reproduce. I'm curious basically if this is happening the wild to
anyone else other than ak0ska.

This is specifically happening during database garbage collection.

If anyone sees this, or does not see it - I'd like to know, I'm just
interested to see how prolific or non-prolific this problem is so I
can get an understanding of impact. I guess I'd be also interested in
rough understand what load your PuppetDB is under either way - # of
nodes and frequency of 'replace catalog' actions - if this is
something you can release publicly that is :-). If someone is seeing
it I may have follow up questions, but for now I'm really interested
in seeing if this is an isolated scenario (therefore potentially
'environmental') or if its prolific and therefore something we need to
be more worried about.

Thanks in advance all :-).

ken.

-- 
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] Re: PuppetDB Constraint error

2013-03-14 Thread llowder


On Thursday, March 14, 2013 4:51:25 PM UTC-5, Ken Barber wrote:

 Hey all, 

 I'm hoping I can get some information from other users on the list in 
 relationship ak0ska's problem listed below. I thought I would start a 
 new thread so more users would see this message and not loose it in 
 the original thread which is already pretty long: 


 https://groups.google.com/forum/?fromgroups=#!topic/puppet-users/yRMI1J_y6Ps 

 Basically I want to see if anyone is seeing the same constraint errors 
 at all in your postgresql log: 

 [2013-03-12 05:51:19 CET]DETAIL:  Key 
 (catalog)=(c93825c7157cba8c10641b54d9dce17eb0ce618b) is not present in 
 table catalogs. 
 [2013-03-12 05:51:19 CET]STATEMENT:  INSERT INTO certname_catalogs 
 (certname,catalog,timestamp) VALUES ($1,$2,$3) RETURNING * 

 It seems to me this problem is enacted under heavy load or an 
 attenuated scenario like 'load', but I'm having trouble trying to 
 reproduce. I'm curious basically if this is happening the wild to 
 anyone else other than ak0ska. 

 This is specifically happening during database garbage collection. 

 If anyone sees this, or does not see it - I'd like to know, I'm just 
 interested to see how prolific or non-prolific this problem is so I 
 can get an understanding of impact. I guess I'd be also interested in 
 rough understand what load your PuppetDB is under either way - # of 
 nodes and frequency of 'replace catalog' actions - if this is 
 something you can release publicly that is :-). If someone is seeing 
 it I may have follow up questions, but for now I'm really interested 
 in seeing if this is an isolated scenario (therefore potentially 
 'environmental') or if its prolific and therefore something we need to 
 be more worried about. 

 Thanks in advance all :-). 


Not seeing the problem here, still on 1.0.1 (but hoping to upgrade monday)

48 nodes, default 30 min run interval

command processing sec/command: 0.129
command processing command/sec 0.0147
enqueing: 0.0371
collection queries: 0.0106


 

 ken. 


-- 
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] Re: Installing a tarball using Puppet

2013-03-14 Thread joe
What llowder said. But he meant fpm, not fom:

https://github.com/jordansissel/fpm

On Thursday, March 14, 2013 3:40:20 PM UTC-6, llowder wrote:



 On Thursday, March 14, 2013 1:20:39 PM UTC-5, ridha gadhgadhi wrote:

 Hi all,

 I want to install opensaf from a tar file. Below, the content of my 
 script shell:


 ---
 tar -xvf opensaf
 cd opensaf 
 ./configure --disable-tipc
 make
 make install

 

 Any help will be much appreciated !


 You have 2 options. You can put what you did above in a shell script, and 
 thenuse a file to push the tarball and the shell script, then exec to run 
 the script.

 The BETTER option is to use fom or whatever and build a package (rpm, deb, 
 whatever) and then install that using a package resource from a local repo.
  

 Regards,

 --Ridha



-- 
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.




Re: [Puppet Users] PuppetDB Constraint error

2013-03-14 Thread Deepak Giridharagopal
On Thu, Mar 14, 2013 at 3:51 PM, Ken Barber k...@puppetlabs.com wrote:

 Hey all,

 I'm hoping I can get some information from other users on the list in
 relationship ak0ska's problem listed below. I thought I would start a
 new thread so more users would see this message and not loose it in
 the original thread which is already pretty long:


 https://groups.google.com/forum/?fromgroups=#!topic/puppet-users/yRMI1J_y6Ps

 Basically I want to see if anyone is seeing the same constraint errors
 at all in your postgresql log:

 [2013-03-12 05:51:19 CET]DETAIL:  Key
 (catalog)=(c93825c7157cba8c10641b54d9dce17eb0ce618b) is not present in
 table catalogs.
 [2013-03-12 05:51:19 CET]STATEMENT:  INSERT INTO certname_catalogs
 (certname,catalog,timestamp) VALUES ($1,$2,$3) RETURNING *

 It seems to me this problem is enacted under heavy load or an
 attenuated scenario like 'load', but I'm having trouble trying to
 reproduce. I'm curious basically if this is happening the wild to
 anyone else other than ak0ska.

 This is specifically happening during database garbage collection.

 If anyone sees this, or does not see it - I'd like to know, I'm just
 interested to see how prolific or non-prolific this problem is so I
 can get an understanding of impact. I guess I'd be also interested in
 rough understand what load your PuppetDB is under either way - # of
 nodes and frequency of 'replace catalog' actions - if this is
 something you can release publicly that is :-). If someone is seeing
 it I may have follow up questions, but for now I'm really interested
 in seeing if this is an isolated scenario (therefore potentially
 'environmental') or if its prolific and therefore something we need to
 be more worried about.

 Thanks in advance all :-).



Worth mentioning that this issue isn't related to correctness...PuppetDB
has built-in retry w/exponential backoff for all incoming commands, so
unless the discard/failure counters in your puppetdb dashboard are
continually ticking upwards, these errors aren't a concern in terms of
correctness or data loss. :)

But as Ken says, it would be interesting to see just how often we run into
these kinds of things in the wild!

deepak

-- 
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] Announce: Puppet Dashboard 1.2.23-rc3 Available

2013-03-14 Thread Moses Mendoza
Puppet Dashboard 1.2.23-rc3 is a maintenance release candidate of the
1.2 series of Puppet Dashboard with bug fixes and minor features.

This release is available for download at:
https://downloads.puppetlabs.com/dashboard/puppet-dashboard-1.2.23-rc3.tar.gz

Available in native package format in the pre-release repositories at:
http://yum.puppetlabs.com and http://apt.puppetlabs.com

For information on how to enable the Puppet Labs pre-release repos, see:
http://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html#enabling-the-prerelease-repos

Please report feedback via the Puppet Labs Redmine site, using an
affected version of 1.2.23-rc3:
http://projects.puppetlabs.com/projects/dashboard

Documentation is available at: http://docs.puppetlabs.com/dashboard/index.html

Contributors:
Aaron Stone

=
## Puppet Dashboard 1.2.23-rc2 Release Notes ##
=
Comment out specific gem rack version in our vendored Rails

* addresses http://projects.puppetlabs.com/issues/11669

==
## Puppet Dashboard 1.2.23-rc3 Changelog ##
==
Aaron Stone (1):
  7753bc5 Comment out specific gem rack version in our vendored Rails

Moses Mendoza (1):
  c577d39 Update VERSION for 1.2.23-rc3

-- 
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 iterate over a string to construct nagios_service check as exported resource?

2013-03-14 Thread Sans
Dear all,

I wrote a custom fact, which returns a comma separated list of addr:port, 
like this: 


 sb_intl_conn = 
 sbcms-t:22,sbsql05-wvuk-inst5:1434,sborc07-uk-t:1533,..,..,..


The number of elements in the string varies from node to node. I need to do 
a Nagios tcp-port-check on each of them. I think sb_intl_conn.split(,)will 
turn this string into an array and then how can I iterate over it to 
do something like this? 


@@nagios_service { check_stat_${::fqdn}_${addr}_${port}:
 use = 'generic-service',
 check_command   = remote-nrpe-tcp-check!${addr}!${port},
 service_description = V2::CON: ${addr} [Palms],
 display_name= Connection check: ${addr}:${port},
 servicegroups   = 'batch-worker',
 hostgroup_name  = 'batch-job',
 }


Any help would be greatly appreciated. Cheers!!  

-- 
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] Re: randomly changing template (hiera backed)

2013-03-14 Thread Ellison Marks
each_pair, so that a hash structure, yes? Ruby hashes are unordered in 1.8. 
Iterating like that isn't guaranteed to be the same every time. You can 
iterate over the sorted keys, then get the params variable by lookup using 
the key.

%
cachebins.keys.sort.each do |bin|
  params = cachebins[bin]
%
[stuff...]
% end -%

On Thursday, March 14, 2013 5:24:50 PM UTC-7, jc.listmail wrote:

 I have a template that I'm using to build Memcache configs from.  The 
 template looks like this:

 USER=memcached
 MAXCONN=1024
 OPTIONS=
 PIDDIR=/var/run/memcached

 % cachebins.each_pair do |bin, params| %
 %= bin.upcase %_PORT=%= params['port'] %
 %= bin.upcase %_CACHESIZE=%= params['cachesize'] %
 %= bin.upcase %_PIDFILE=$PIDDIR/%= bin %.pid
 % end -%

 The hiera config looks like this:

 memcache:
   default:
 port: 11211
 cachesize: 64
   session:
 port: 11212
 cachesize: 128
   menu:
 port: 11213
 cachesize: 64
   views:
 port: 11214
 cachesize: 64
   filter:
 port: 11215
 cachesize: 32
   users:
 port: 11216
 cachesize: 32
   page:
 port: 11217
 cachesize: 32

 and init.pp looks like this:

 $cachebins = hiera('memcache')
   
  file { memcache_conf:
 path = /etc/sysconfig/memcached,
 owner = root,
 group = root,
 mode = 644,
 notify = Service[memcached],
 content = template(memcache/memcached.conf.erb),
 }

 The issue is that when the template is compiled, it periodically (and 
 randomly) gets recompiled in a different order, which causes my notify 
 statement to fire and restart memcache.

 The actual contents don't change, just the order in which the bins are 
 listed in the template.  I was expecting the layout to follow my hiera data 
 structure, but it seems to glob them in an unordered (and maybe random) 
 manner when it parses out into the template.

 Maybe I'm going about this in the wrong way in terms of importing my hiera 
 data, but is there a way I can force the template to be built in the same 
 order every time so that I don't have the file randomly updating and 
 causing a restart from my notify?




-- 
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] pluginsync trouble over SRV lookups

2013-03-14 Thread Ashwin N
Hi folks,

When using SRV lookups (over 2 puppetv3.1.1/RHEL6 masters), does anyone
know why the pluginsync fails to sync at irregular intervals ?

I am using pluginsync = true and pluginsource=puppet:///plugins on my
puppet-clients(3.1.1/RHEL6).

Yet I get failures such  as Error: Could not set 'file' on ensure: Error
404 on SERVER: Could not find file_content
plugins/puppet/parser/functions/.

This occurs both over passenger and over the over the built in webrick?
services.

If I stop either of masters, everything proceeds fine !

thanks for any help,

Ash

-- 
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.




Re: [Puppet Users] Re: randomly changing template (hiera backed)

2013-03-14 Thread Jay Christopherson
Yep, a hash structure.  I didn't even think to check whether Ruby hashes
were ordered (I just assumed they would be), which should have been the
first thing to check when I noticed that my results were unordered.  Thanks
for the info!

On Thu, Mar 14, 2013 at 6:36 PM, Ellison Marks gty...@gmail.com wrote:

 each_pair, so that a hash structure, yes? Ruby hashes are unordered in
 1.8. Iterating like that isn't guaranteed to be the same every time. You
 can iterate over the sorted keys, then get the params variable by lookup
 using the key.

 %
 cachebins.keys.sort.each do |bin|
   params = cachebins[bin]
 %
 [stuff...]
 % end -%


 On Thursday, March 14, 2013 5:24:50 PM UTC-7, jc.listmail wrote:

 I have a template that I'm using to build Memcache configs from.  The
 template looks like this:

 USER=memcached
 MAXCONN=1024
 OPTIONS=
 PIDDIR=/var/run/memcached

 % cachebins.each_pair do |bin, params| %
 %= bin.upcase %_PORT=%= params['port'] %
 %= bin.upcase %_CACHESIZE=%= params['cachesize'] %
 %= bin.upcase %_PIDFILE=$PIDDIR/%= bin %.pid
 % end -%

 The hiera config looks like this:

 memcache:
   default:
 port: 11211
 cachesize: 64
   session:
 port: 11212
 cachesize: 128
   menu:
 port: 11213
 cachesize: 64
   views:
 port: 11214
 cachesize: 64
   filter:
 port: 11215
 cachesize: 32
   users:
 port: 11216
 cachesize: 32
   page:
 port: 11217
 cachesize: 32

 and init.pp looks like this:

 $cachebins = hiera('memcache')

  file { memcache_conf:
 path = /etc/sysconfig/memcached,
 owner = root,
 group = root,
 mode = 644,
 notify = Service[memcached],
 content = template(memcache/memcached.**conf.erb),
 }

 The issue is that when the template is compiled, it periodically (and
 randomly) gets recompiled in a different order, which causes my notify
 statement to fire and restart memcache.

 The actual contents don't change, just the order in which the bins are
 listed in the template.  I was expecting the layout to follow my hiera data
 structure, but it seems to glob them in an unordered (and maybe random)
 manner when it parses out into the template.

 Maybe I'm going about this in the wrong way in terms of importing my
 hiera data, but is there a way I can force the template to be built in the
 same order every time so that I don't have the file randomly updating and
 causing a restart from my notify?


  --
 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.




-- 
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.




Re: [Puppet Users] Re: PuppetDB queue problem

2013-03-14 Thread Ken Barber
Hi ak0ska,

FWIW - with the help of some of my colleagues we've managed to
replicate your constraint issue in a lab style environment now:

https://gist.github.com/kbarber/5157836

Which is a start. It requires a unique precondition to replicate, and
I've been unable however to replicate it in any way with PuppetDB
directly, so the statement log will still be helpful if you can supply
it.

ken.

On Thu, Mar 14, 2013 at 2:12 PM, Ken Barber k...@puppetlabs.com wrote:
 So I have this sinking feeling that all of your problems (including
 the constraint side-effect) are related to general performance issues
 on your database 'for some reason we are yet to determine'. This could
 be related to IO contention, it could be a bad index (although you've
 rebuilt them all right?) or something else. What continues to bother
 me is the fact you have only managed to reduce your DB size to 30GB,
 this is far larger than I expect and I it screams 'problem' to me. It
 should be less than 5 GB, at least based on my rough calculations from
 other DBs I've seen in the wild.

 It could very well be that something still isn't sufficiently
 organised (index, tablespace data) for optimal performance. A
 recreation of the database is by all means a very fast way to recreate
 everything, its like heaving an axe though. Having said that, it is
 fast and would eradicate a lot of back  forth between us to try and
 solve this problem.

 A dump, drop, recreate and restore is also another way, not 100% the
 same thing, but close to it.

 Its entirely up to you - if you want to try either option then go
 ahead. It would be a fast step to achieving a lot of small steps. If
 it works, we may have lost some clarity on the issue however, so might
 be good to keep the original DB backup. If it doesn't work, at least
 we have ruled out a lot of possibilities in one quick action. So yeah,
 I wouldn't be upset if you take this action - there is a reason why I
 suggested this earlier, and that is it performs a lot of actions in
 one single step ... and I still think this is a viable action, but
 since you were keen on trying other things I was happy to go along
 :-). At the end of the day your time and your risk assessment is up to
 you. If it was me, yeah, I would try it. Esp. considering the amount
 of time already spent with very little final result.

 Thanks for being patient with me on this btw ... :-).

 ken.

 On Thu, Mar 14, 2013 at 3:36 AM, ak0ska akos.he...@gmail.com wrote:
 Hello Ken,

 I really appreciate you guys looking into this problem, and I'm happy to
 provide you with the data you ask for. However, I feel like I should ask,
 whether you think this problem is worth your efforts, if rebuilding the
 database might solve the issue?

 Cheers,

 ak0ska


 On Thursday, March 14, 2013 8:05:59 AM UTC+1, Ken Barber wrote:

 Hi ak0ska,

 So I've been spending the last 2 days trying all kinds of things to
 replicate your constraint violation problem and I still am getting
 nowhere with it. I've been speaking to all kinds of smart people and
 we believe its some sort of lock and/or transactional mode problem but
 none of my testing can replicate it.

 My latest test was something like:

 https://gist.github.com/kbarber/5157836

 But with all that preparation and load simulation I still couldn't
 replicate it :-(.

 I think I need more data from you ... in this case, a statement log.
 Now a statement log can be pretty heavy, so if we can get the data
 surrounding a GC only that should be enough - however I anticipate it
 might reduce some performance so if you're apprehensive about doing it
 in production I fully understand. I'm just running out of ideas, and
 without more data I may have trouble coming to a conclusion.

 Anyway, if at all possible the instructions for enabling this are as
 follows:

 * Go to your postgresql.conf file (On RHEL 6 this is usually located
 in /var/lib/pgsql/data)
 * Add/modify the entries:
 log_statement = 'all'
 log_line_prefix = '%m PID[%p] SID[%c] VTID[%v] TID[%x] '
 * Restart postgresql
 * Logs should go to: /var/lib/pgsql/data/pg_log

 The closer you can do this to being set _just before_ a GC run the
 better, as it will reduce the amount of time this setting needs to be
 on. Once you have a GC run and a subsequent constraint logged you
 should be able to turn it off. Don't worry about PuppetDB during these
 cases, it retries the database so if you can take the small hit with
 queries the outage should be quick while you switch off/on the setting
 (and be mindful that catalogs/facts/reports submissions will get
 queued, queries of course will fail during that short time during DB
 restart).

 Now the data itself is going to obviously contain private items, so if
 you prefer to send it to me privately thats fine (contact me off this
 list if so). Otherwise, it might need some scrubbing.

 So the concern I have with your issue, even though it doesn't stop a
 catalog from being submitted - is that you're 

Re: [Puppet Users] How to iterate over a string to construct nagios_service check as exported resource?

2013-03-14 Thread Peter Brown
It's pretty tricky to program puppet like your usual programming language.

Given the nature of how puppet does things you will have to write a define
that accepts the array you have split and then split the $title variable on
,

That looks like a very complex way of generating nagios services.

I am going to hope that the services you are monitoring aren't managed by
puppet at all and that's the only way to do it.





On 15 March 2013 09:35, Sans r.santanu@gmail.com wrote:

 Dear all,

 I wrote a custom fact, which returns a comma separated list of addr:port,
 like this:


 sb_intl_conn =
 sbcms-t:22,sbsql05-wvuk-inst5:1434,sborc07-uk-t:1533,..,..,..


 The number of elements in the string varies from node to node. I need to
 do a Nagios tcp-port-check on each of them. I think
 sb_intl_conn.split(,) will turn this string into an array and then how
 can I iterate over it to do something like this?


 @@nagios_service { check_stat_${::fqdn}_${addr}_${port}:
 use = 'generic-service',
 check_command   = remote-nrpe-tcp-check!${addr}!${port},
 service_description = V2::CON: ${addr} [Palms],
 display_name= Connection check: ${addr}:${port},
 servicegroups   = 'batch-worker',
 hostgroup_name  = 'batch-job',
 }


 Any help would be greatly appreciated. Cheers!!

  --
 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.




-- 
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.