Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewind a resource that is already declared twice #6

Open
mancdaz opened this issue Apr 29, 2013 · 5 comments
Open

rewind a resource that is already declared twice #6

mancdaz opened this issue Apr 29, 2013 · 5 comments

Comments

@mancdaz
Copy link

mancdaz commented Apr 29, 2013

The opsode apache cookbook actually clones the apache ports.conf template resource in the default and mod_ssl recipes:

If I want to rewind that resource in my own wrapper cookbook, and try to use chef-rewind, it appears to only find a single instance of the resource (maybe the first one), and rewind it. But I still end up with the template from presumably the second declaration of the resource

[2013-04-29T17:03:10+00:00] WARN: Previous template[/etc/apache2/ports.conf]: /var/chef/cache/cookbooks/apache2/recipes/default.rb:195:in `from_file'
[2013-04-29T17:03:10+00:00] WARN: Current  template[/etc/apache2/ports.conf]: /var/chef/cache/cookbooks/apache2/recipes/mod_ssl.rb:37:in `from_file'
[2013-04-29T17:03:10+00:00] INFO: Resource template[/etc/apache2/ports.conf] found, now rewinding it

I know cloning the resource in the first instance is a bad thing, but is there some way to make chef-rewind match and rewind all instances of the resource, effectively consolidating them into a single resource declaration?

@mancdaz
Copy link
Author

mancdaz commented Apr 29, 2013

Just noted that I have to rewind both instances of the resource to get the desired result:

include_recipe 'apache2'

rewind...

include_recipe 'apache2::mod_ssl'

rewind...(exactly the same as the previous rewind block)

Certainly not ideal

@thommay
Copy link
Collaborator

thommay commented Dec 16, 2014

This is a duplicate of #3, I guess. We've fixed the unwind case, but not (yet) the rewind case.

@mancdaz
Copy link
Author

mancdaz commented Dec 16, 2014

Hi @thommay I don't think this is a dupe of that issue, for which the fix is unrelated to chef-rewind.

@thommay
Copy link
Collaborator

thommay commented Dec 16, 2014

Hm, you're right sorry. I'll construct some test cases and see what this looks like.

@thommay
Copy link
Collaborator

thommay commented Jan 8, 2015

I tested this, and found that (with current master) I just needed the second rewind block; the first was superfluous. Can you test with the 0.0.9 release and confirm this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants