On Wed, Apr 11, 2012 at 06:16:18PM -0400, Jay Feldblum wrote:> the system later during the convergence phase are *unique* by their types
> Motiejus,
>
> Resources that you create during the compilation phase to be executed by
> and names.I looked for a way to execute a query without creating a resource, but didn't
>
> You created a resource of type execute with name "delete password". The
> next time you call execute "delete password", it doesn't make a new
> resource. Instead, it finds the resource with that type and name, and
> reopens it so you can change resource attributes and add only-if/not-if
> blocks and add actions. In the end, there is only one resource of type
> execute with name "delete password".
find one. I looked at apt and chef-client cookbooks for an example and tried to
google for it. All "executions" are handled when creating an "execute" named block.
OK, clearer, thanks. So once string is evaluated in the resource, it will stay
like this.
This is what I came up with:
execute "delete password for " + u['id'] do
command "passwd -d #{u['id']}"I don't like it. Is there a better way to do it, or is it the way to do it?
only_if "test $(passwd -S #{u['id']} | awk '{print $2}') = L"
end
Jay, thanks for your explanations. :) A tutorial or higher-level documentation
would be useful here, so I wouldn't ask those kind of basic questions. We'll
see what I can do about it when I learn chef.
Motiejus
Archive powered by MHonArc 2.6.16.