This repository was archived by the owner on Jun 18, 2021. It is now read-only.
Return non-zero error code if no hosts match#121
Merged
joshmoore merged 1 commit intoome:masterfrom Sep 29, 2016
Merged
Conversation
This is useful when running ansible-playbook automatically, since failure to mat ch a host may mean there's an incorrect hostname or groupname somewhere
This was referenced Sep 28, 2016
Member
|
I get: even without this PR. In fact, I don't I have yet been able to make it execute. |
Member
Author
|
Run it without The idea is to catch errors in the tests, e.g. in the |
Member
👍 |
manics
pushed a commit
to manics-archive/ome-infrastructure
that referenced
this pull request
Nov 24, 2016
Return non-zero error code if no hosts match
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a callback so that Ansible will set a non-zero exit code if a playbook was run but no hosts match. This is useful when running ansible-playbook automatically. For example, when running vagrant to test the Vagrantfile if there is a mismatch between the hosts expect by the playbook and the hosts in the Vagrantfile ansible would normally not care.
If you think this is inappropriate it could go into an alternative
ansible.cfgwhich is used only byvagrant(e.g. setANSIBLE_CONFIG)