- From: Brad Knowles <
>
- To:
- Cc: Brad Knowles <
>
- Subject: [chef] Re: Passing responses back to Chef?
- Date: Tue, 6 Aug 2013 15:07:13 -0500
On Aug 6, 2013, at 2:00 PM, Matt Ray
<
>
wrote:
>
This is where you'd want to use mixlib-shellout in your recipes. It
>
captures all the stdout and stderr on a command, you can then process it in
>
Ruby. Take a look at this example.
>
https://github.com/opscode-cookbooks/pxe_dust/blob/master/recipes/bootstrap_template.rb#L33
>
https://github.com/opscode/mixlib-shellout
Okay, so now I've got that mostly working, but I'm getting an error when I
try to send a notification to install a package resource:
[2013-08-06T15:03:18-05:00] INFO: Processing ruby_block[find closest matching
full version for mysql-server to desired version] action create
(brad_mysql::server line 53)
[2013-08-06T15:03:18-05:00] DEBUG: aptitude show mysql-server=5.1 | grep
'^Version: ' | sed 's/^Version: //' | grep "^5.1"
[2013-08-06T15:03:19-05:00] DEBUG: 5.1.70-0ubuntu0.10.04.1
[2013-08-06T15:03:19-05:00] INFO: ruby_block[find closest matching full
version for mysql-server to desired version] called
[2013-08-06T15:03:19-05:00] INFO: ruby_block[find closest matching full
version for mysql-server to desired version] sending install action to
package[mysql-server] (immediate)
[2013-08-06T15:03:19-05:00] DEBUG: Re-raising exception: NoMethodError -
undefined method `run_action' for "package[mysql-server]":String
Is this a feature that is only available in newer versions of chef-client and
chef-solo? We're using 10.18.2 at the moment, and I know that the website has
been updated to reflect the latest 11.x versions, so I'm not sure if I'm
running into a known problem here.
Thanks!
--
Brad Knowles
<
>
LinkedIn Profile: <
http://tinyurl.com/y8kpxu>
Archive powered by MHonArc 2.6.16.