Open prein opened 7 years ago
I suspect it may require hostsfile code similar to the directory code here (but for hostnames instead):
OR, when switched on, the cookbook would need to only accumulate hostsfile entries and converge the content later.
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?