- From: Jens Skott <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Question about databags
- Date: Thu, 1 Nov 2012 20:12:30 +0100
Super. Now it works. Thanks so much =)
Jens Skott
Tel: +46-8-5142 4396
Schibsted Centralen IT
2012/11/1 Elliot Murphy
<
>:
>
Because the context is recipe code and not an erb template, I believe you
>
need to use string interpolation with #{} here.
>
>
not_if "cat /root/test | grep #{test['test1']}", :user => 'root'
>
>
>
>
On Thu, Nov 1, 2012 at 2:11 PM, Jens Skott
>
<
>
>
wrote:
>
>
>
> It worked like a charm. The databags works with templates and stuff
>
> but now I want to be able to
>
> use the items in bash.
>
>
>
> Added this to my recipie and the test['test1'] and test['test2'] are
>
> from the databag.
>
>
>
> Have tried in every different way possble to include the variables in
>
> the bash scrip.
>
>
>
> bash "make_test_file" do
>
> not_if "cat /root/test | grep test['test1']", :user => 'root'
>
>
>
> user "root"
>
> code <<-EOH
>
> echo test['test1'] test['test2'] >> /root/test
>
> EOH
>
> end
>
>
>
> Jens Skott
>
> Tel: +46-8-5142 4396
>
> Schibsted Centralen IT
>
>
>
>
>
>
>
> 2012/11/1 Elliot Murphy
>
> <
>:
>
> > On Thu, Nov 1, 2012 at 7:17 AM, Jens Skott
>
> > <
>
>
> > wrote:
>
> >>
>
> >>
>
> >> Any takers to help me out here or perhaps have a nice databag tutorial
>
> >> session with me? =)
>
> >
>
> >
>
> > Walking through this post is what helped me get encrypted data bags
>
> > working.
>
> >
>
> > http://jtimberman.housepub.org/blog/2011/08/06/encrypted-data-bag-for-postfix-sasl-authentication/
>
> >
>
> > --
>
> > Elliot Murphy
>
>
>
>
>
--
>
Elliot Murphy
>
Pat Deegan PhD & Associates, LLC
Archive powered by MHonArc 2.6.16.