I have several cookbooks which include several other cookbooks, depending on each cookbook's needs.
The included cookbooks declare services which notify other services.

One of the included cookbook `common_actions` is included in all the other cookbooks as it contains actions common to all.

```
include_recipe 'cookbook1'
include_recipe 'common_actions'
include_recipe 'cookbook2'
# Several cookbooks have such includes, but 'common_actions'
# is included in almost all the cookbooks.

# cookbook specific conditional logic that should be
# executed only if some condition in 'common_actions' is true

```

Is it a wise idea to include a conditional return statement in the `common_actions` cookbook so that it will force the including cookbooks not to be compiled/executed based on that condition? For the purpose of this question, please consider any fake condition like:

```
if node['IP'] == 'xyz'
    # All including cookbooks should execute only IP is xyz
    return
end

```

Can a cookbook with such a return statement cause only certain cookbooks to run? Is it advisable?

Note: I am doing this because I do not want to copy-paste the same code in all the other cookbooks.