File tree Expand file tree Collapse file tree 2 files changed +30
-6
lines changed Expand file tree Collapse file tree 2 files changed +30
-6
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 :
Original file line number Diff line number Diff line change @@ -182,7 +182,12 @@ function generate_overcloud_certs() {
182
182
# NOTE: Previously it was necessary to first deploy HAProxy with TLS disabled.
183
183
if [[ -f $KAYOBE_CONFIG_PATH /environments/$KAYOBE_ENVIRONMENT /kolla/globals-tls-config.yml ]]; then
184
184
sed -i ' s/# kolla_enable_tls_internal: true/kolla_enable_tls_internal: true/g' $KAYOBE_CONFIG_PATH /environments/$KAYOBE_ENVIRONMENT /kolla.yml
185
- cat $KAYOBE_CONFIG_PATH /environments/$KAYOBE_ENVIRONMENT /kolla/globals-tls-config.yml >> $KAYOBE_CONFIG_PATH /environments/$KAYOBE_ENVIRONMENT /kolla/globals.yml
185
+ # This condition provides some level of idempotency, as well as supporting
186
+ # the case where the content of globals-tls-config.yml has been added to
187
+ # globals.yml within a conditional check for internal TLS.
188
+ if ! grep kolla_copy_ca_into_containers $KAYOBE_CONFIG_PATH /environments/$KAYOBE_ENVIRONMENT /kolla/globals-tls-config.yml & > /dev/null; then
189
+ cat $KAYOBE_CONFIG_PATH /environments/$KAYOBE_ENVIRONMENT /kolla/globals-tls-config.yml >> $KAYOBE_CONFIG_PATH /environments/$KAYOBE_ENVIRONMENT /kolla/globals.yml
190
+ fi
186
191
fi
187
192
}
188
193
You can’t perform that action at this time.
0 commit comments