Improve failed_when rule for Wordpress Installed check #991
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.
I have a note of one time experiencing something similar to https://discourse.roots.io/t/trellis-failing-when-trying-to-deploy/11932/4. I do not remember what produced the error in my own case. This PR should slightly improve the error handling and reporting.
In rare cases the
wp_installed
registered var may be missing thestderr
attribute. Note that Trellis appliesdefault
values forstderr
elsewhere. This PR adds a default value for this particularstderr
. Doing so avoids the Ansible missing attribute error that would just get in the way of finding the actual error that occurred in thewp core is-installed
command.The
wp core is-installed
command return code is1
if WP is simply not installed. However, in rare cases the command may return some other higher return code indicative of true failure, so this PR makes the task fail ifwp_installed.rc > 1
.