File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change 102
102
dest : " {{ src_directory }}/{{ kayobe_config_name }}"
103
103
update : " {{ upgrade | bool }}"
104
104
105
- - name : Pop stashed Kayobe Config changes (upgrade)
106
- ansible.builtin.command :
107
- cmd : git stash pop
108
- chdir : " {{ src_directory }}/{{ kayobe_config_name }}"
109
- when : upgrade | bool
105
+ - when : upgrade
106
+ block :
107
+ - name : Pop stashed Kayobe Config changes (upgrade)
108
+ ansible.builtin.command :
109
+ cmd : git stash pop
110
+ chdir : " {{ src_directory }}/{{ kayobe_config_name }}"
111
+ register : pop_result
112
+ # NOTE: Fails when no stash exists
113
+ failed_when :
114
+ - pop_result is failure
115
+ - " 'No stash entries found' not in pop_result.stderr"
116
+ rescue :
117
+ - name : Check Kayobe Config diff (upgrade)
118
+ ansible.builtin.command :
119
+ cmd : git diff
120
+ chdir : " {{ src_directory }}/{{ kayobe_config_name }}"
121
+ register : diff_result
122
+
123
+ - name : Fail on git stash pop failure
124
+ ansible.builtin.fail :
125
+ msg : |-
126
+ Failed to pop stashed changes after upgrade.
127
+
128
+ {{ diff_result.stdout }}
110
129
111
130
- name : Replace TLS changes to avoid git conflicts (upgrade)
112
131
ansible.builtin.shell :
You can’t perform that action at this time.
0 commit comments