Skip to content
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

Not all errors are detected #5

Open
eigood opened this issue Jan 17, 2014 · 0 comments
Open

Not all errors are detected #5

eigood opened this issue Jan 17, 2014 · 0 comments

Comments

@eigood
Copy link

eigood commented Jan 17, 2014

When dig is not installed, the ip=$(dig) line is non-sensible. Later, when ssh-keygen and ssh-keyscan are called, they end up returning bad values, and the script result back to ansible ends up saying changed=false, but otherwise there is no error.

To fix this, use 'set -e', 'trap _onexit EXIT', and properly return a real error.

If exiting the script successfully, then remove the trap by "trap '' EXIT".

These commands are POSIX, so are safe to use.

ps: this script to actually be /bin/sh, if one used && instead of -a when doing [, and used = instead of ==,

pps: I could also make a fork/pull request for this too, if the above is not clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant