configuration management - How do you make a chef resource optional? -
I found a resource in the chef recipe that I want to be optional, that is, when the recipe runs, the processing fails Goes, I want everything to move forward. I still want to know that the curriculum had a failure with that resource, it is not just an important resource and nothing is on its basis, so I want to continue the rest.
I am used to working with puppet, where you have to declare your dependencies clearly, and resources are left out, when those dependencies fail rather than a failure Do not let the whole file run to run.
Not sure why this is not a real question (even after reading FAQ), but I'll add some example code to clarify what I'm asking, hopefully someone else You can vote to open or answer from.
I am using Chef to establish Dev environment, and only a part of it is cloning just a few GIT repops. Nothing is dependent on them, and sometimes there is also a private repository which some gods do not have access to. If it fails to clone, then I want to continue to run other resources.
So for the following resources:
["foo", "bar", "buzz"]. Do each. Repo | Git repo do repository "git@github.com/example/#{repo}" reference "master" verb: sync depth 1 user 'dev' group 'dev' destination "# {node [: src_dir]} / # {repo} "End End If the user is running then he is not allowed to clue Fu, I have to fu frustrate, but bar and buzz to clone more. How is this possible?
You can set ignore_failure true
Comments
Post a Comment