Created
June 21, 2014 23:23
-
-
Save jolexa/2c385a814a427969e4e7 to your computer and use it in GitHub Desktop.
chef-rewind usage issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to unwind this template using chef-rewind? | |
https://github.com/opscode-cookbooks/tomcat/blob/master/providers/instance.rb#L157-L158 | |
template "#{new_resource.config_dir}/server.xml" do | |
source 'server.xml.erb' | |
The chef-client run expands that to : | |
template[/etc/tomcat6/server.xml] action create | |
Following the chef-rewind docs, I assumed that this would work in my recipe: | |
chef_gem 'chef-rewind' | |
require 'chef/rewind' | |
include_recipe 'tomcat::default' | |
unwind "template[/etc/tomcat6/server.xml]" | |
But it does not: | |
Chef::Exceptions::ResourceNotFound | |
---------------------------------- | |
Cannot find a resource matching template[/etc/tomcat6/server.xml] (did you define it first?) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
chef:recipe > f = resources("tomcat_instance[base]")
<tomcat_instance[base] @name: "base" @noop: nil @before: nil @params: {} @provider: nil @allowed_actions: [:nothing, :configure, :configure] @action: :configure @updated: false @updated_by_last_action: false @supports: {} @ignore_failure: false @retries: 0 @retry_delay: 2 @source_line: "/var/chef/cache/cookbooks/tomcat/recipes/default.rb:72:in
from_file'" @guard_interpreter: :default @elapsed_time: 0 @resource_name: :tomcat_instance @cookbook_name: "tomcat" @recipe_name: "default" @PORT: 8080 @proxy_port: nil @ssl_port: 8443 @ssl_proxy_port: nil @ajp_port: 8009 @shutdown_port: 8005>`