@@ -241,6 +241,23 @@ function main {
241
241
clean_copy " $KAYOBE_CONFIG_SOURCE_PATH " " $source_kayobe_config_dir "
242
242
clean_copy " $KAYOBE_CONFIG_SOURCE_PATH " " $target_kayobe_config_dir "
243
243
244
+ function normalize_file_text() {
245
+ local file=" $1 "
246
+ local text=" $2 "
247
+
248
+ sed -i " s#/tmp/$text /\(.*\)#/tmp/\1#g" " $file "
249
+ }
250
+
251
+ function normalize_files_in_folder() {
252
+ local folder=" $1 "
253
+ local text=" $2 "
254
+
255
+ # Find all files in the folder and its subfolders and loop through them
256
+ find " $folder " -type f -print0 | while IFS= read -r -d ' ' file; do
257
+ normalize_file_text " $file " " $text "
258
+ done
259
+ }
260
+
244
261
function generate_target_config {
245
262
target_environment_path=/tmp/target-kayobe-env
246
263
export ANSIBLE_LOG_PATH=/tmp/target-kayobe.log
@@ -251,6 +268,7 @@ function main {
251
268
redact_config_dir " $target_environment_path "
252
269
encrypt_config_dir " $target_environment_path "
253
270
generate_config " $target_environment_path " " $target_dir "
271
+ normalize_files_in_folder " $target_environment_path " " target-kayobe-env"
254
272
}
255
273
256
274
function generate_source_config {
@@ -265,6 +283,7 @@ function main {
265
283
redact_config_dir " $source_environment_path " " $target_kayobe_config_dir "
266
284
encrypt_config_dir " $source_environment_path "
267
285
generate_config " $source_environment_path " " $source_dir "
286
+ normalize_files_in_folder " $source_environment_path " " source-kayobe-env"
268
287
}
269
288
270
289
generate_target_config $1 > /dev/null 2>&1 &
0 commit comments