-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Samba shares nuked when unrelated resource fails during chef-client run #96
Comments
I suspect this is to do with the accumulator pattern.it sounds like something earlier on in the run is altering the share resource. Then the last share isn't getting a chance to be added to the collection. I would suggest putting the samba server and the share resource together so they fail together, and don't alter the file. If that doesn't work, or I'm completely off the mark here. Let me know and we cna further dig into this problem. |
Yes, this seems to be a common problem in community cookbooks that use the accumulator pattern. I believe your suggestion...
... will work in my particular case. At least, it fixed the issue in the quick-and-dirty testing that I've been doing. However, it doesn't work in all cases. When the accumulated resources are spread out across multiple cookbooks, it becomes impossible to group them together - I ran into this issue with the firewall cookbook, for instance. |
Yeah we really don't like using the accumulator pattern, but are usually forced into it when there is no conf.d directory for the software. Technically, I'm not sure there's a lot we can do apart from the above suggestion of keeping together resources. Especially if in between those resources you have things that are likely to fail. |
smb.conf supports an |
If we think we can get that working, and you and point me at that documentation! That'd be awesome. |
Well it may be a moot point. Turns out smb.conf does not support wildcard includes, only a single file at a time. So even with includes, it would probably be necessary to use an accumulator to build the list of files to include. References: |
Do we think this is possible to do, or it should be documented it isn't recommended to structure the resources in the way you're doing? |
Cookbook version
1.2.0
Chef-client version
14.2.0
Platform Details
RHEL 7.6
Scenario:
Steps to Reproduce:
Run the following recipe:
Half the time this recipe will execute successfully, causing the correct config file to get written out:
Half the time this recipe will fail. This causes an incorrect configuration file, missing the shares, to get written out:
This recently caused a service interruption on one of our customer's systems. A yum repository resource, unrelated to samba, failed. This caused samba to write out the config without any shares. As a result, all of the customer's shares went away.
Expected Result:
When the recipe fails, existing shares should be remain intact in order to avoid service interruptions.
Actual Result:
When the recipe fails, existing shares are removed from the configuration file, causing service interruptions.
The text was updated successfully, but these errors were encountered: