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

Entries can only be appended, unless explicitly removed with "remove" action #91

Open
prein opened this issue Aug 24, 2017 · 1 comment

Comments

@prein
Copy link

prein commented Aug 24, 2017

The way I use the resource is that I iterate over chef search results and run hostsfile_entry resource for each result (node).
The problem is that when a node gets removed from chef or stops meeting search criteria, it is not removed from /etc/hosts.
I'm wondering, would it be possible to make the resource manage the entire collection of entries it manages. Maybe use comment (or it's part) as identifier rather than (only) ip_address?

@bby-bishopclark
Copy link

I suspect it may require hostsfile code similar to the directory code here (but for hostnames instead):

https://github.com/zts/chef-cookbook-managed_directory/blob/master/resources/managed_directory.rb#L44

OR, when switched on, the cookbook would need to only accumulate hostsfile entries and converge the content later.

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