[Puppet Users] Re: Trying to get complex data set into Puppet from ENC
I'm having the same problem. On Wednesday, 23 May 2012 02:10:21 UTC+2, Jared Ballou wrote: Hi everyone, I've been reading the groups here for a while, and have gotten a lot of things fixed by finding other people's posts, so hopefully someone will be able to set me straight. I am working on a Puppet deployment that needs to have a lot of disparate data pulled together, and as far as the ENC I created to pull it all in, everything has worked great. However, I'm running into a problem instantiating Apache virtual hosts. Here is some abridged output from my ENC: --- classes: app::lamp: appdata: sites: Some Website: id: 2 name: Some Website servername: somewebsite.com svntag_prod: trunk svntag_dev: trunk documentroot: ~ Another Website: id: 4 name: Another Website servername: anotherwebsite.com svntag_prod: 1.2.0 svntag_dev: 1.3.0-rc4 documentroot: ~ Third Website: id: 6 name: Third Website servername: thirdwebsite.com svntag_prod: trunk svntag_dev: trunk documentroot: /opt/thirdwebsite/customhtdocs So, I have some other classes that are parameterized and I can reference $appdata[$key] inside those manifests and everything works fine for strings or arrays. My issue is getting this hash of hashes in [appdata][sites] turned into vhosts. I tried using create_resources to no avail, tried dumping the ENC to YAML and using Hiera to parse that, and I have struck out in every way. And, honestly, I think there must be a better way to do this. The data is all in a single MySQL table, so I looked at hiera-mysql backend, but I think I am over my head here. Has anyone got a good example I could reference doing something like this, especially for multi-dimensional hashes? I was starting to look at just converting it to JSON or just comma delimited text and feed it to Puppet as a string to be parsed, but that just seems wrong. I've been at this 4 hours now with no luck, any help anyone can provide would be greatly appreciated. Thanks, -Jared -- 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/-/ZdBvHpmNeFAJ. 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.
Re: [Puppet Users] stages examples/advices
My 2cents, Why not use the stdlib that puppet provides. It contains the following stage presets, class stdlib::stages { stage { 'setup': before = Stage['main'] } stage { 'runtime': require = Stage['main'] } - stage { 'setup_infra': } - stage { 'deploy_infra': } - stage { 'setup_app': } - stage { 'deploy_app': } - stage { 'deploy': } } I'm going to start using this going forward. On Wednesday, 20 October 2010 12:48:47 UTC+2, David Schmitt wrote: On 10/18/2010 6:14 PM, Hunter Haugen wrote: so you could do this: class orden { stage { [ 'repos', 'os', 'gLite', 'post' ]: } Stage['repos'] - Stage['os'] - Stage['main'] - Stage['gLite'] - Stage['post'] } A style question: wouldn't it be preferable to write it like this: class orden { stage { 'repos': } - stage { 'os': } - stage { 'main': } - stage { 'gLite': } - stage { 'post': } } Best Regards, David -- dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at Klosterneuburg UID: ATU64260999 FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg -- 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/-/N8wgSj8I07AJ. 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.
[Puppet Users] Re: Hiera problem: Can't convert Symbol into String
Have you tried, --- family: prod cluster: prod compresslogs: true ? On Monday, 23 July 2012 05:15:02 UTC+2, Aaron Nichols wrote: All, I have found very few references to this error so I'm guessing I must be doing something wrong. I have just started using hiera and am trying to use it in the simplest way possible, I have a class that looks like this: class app_users2($compresslogs = hiera('compresslogs')) { #Setup Cronjob for compressing app logs if $compresslogs == true { file { /etc/cron.daily/copyLogs.cron: mode = 750, ensure = present, alias = compresslogscron, source = puppet:///modules/app_users2/copyLogs.sh } } } For the node I'm running this on, hiera returns 'true' for that value when I test it out: $ hiera -c hiera.yaml compresslogs loc=sd type=app true I am using the yaml hiera backend and the yaml file this is configured in looks like this: --- family : prod cluster : prod compresslogs : true However, when I try to execute the manifests either on the host or test them using cucumber-puppet I get the following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert Symbol into String at /etc/puppet/modules/app_users2/manifests/init.pp:2 on node xyz I have tried quoting, unquoting the data in the yaml file in the conditional in the class. I've tried calling hiera as a parameter to the class, also just as part of the conditional ( if hiera('compresslogs') == true ) etc. It appears that anytime I try to reference that value from puppet it throws this error. I have found a few references in IRC logs to others having this problem but they all stated Oh, I figured it out without explaining how - so I'm a bit stuck. I am running the following hiera versions on the puppetmaster: hiera-puppet-1.0.0-0.1rc1.el5 hiera-1.0.0-0.1rc3.el5 And the puppetmaster is running puppet v. 2.7.6.-2. I also tried updating the puppet version on my host running cucumber-puppet to 2.7.18 and it continues to throw this error. Any help would be greatly appreciated. Thanks, Aaron -- 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/-/w_yzv9P9fZMJ. 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.