Skip to content

Commit 73abfec

Browse files
authored
Fail task when software updates were not installed
I had a situation when `softwareupdate -i` resulted with ``` Downloaded Command Line Tools (macOS High Sierra version 10.13) for Xcode\nDone.\n\nError installing updates. ``` In `stdout` with exit code 0, problem was hard to catch without the debug mode, because this task exited with success
1 parent 510b73b commit 73abfec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@
5555
when: pkg_info.rc != 0 or compiler.rc != 0 or not clt.stat.exists
5656
notify:
5757
- Cleanup
58+
register: su_result
59+
failed_when: '"Error installing updates." in su_result.stdout'

0 commit comments

Comments
 (0)