Remove escape characters from container command

Ansible outputs JSON-encoded strings which does not work with
container clis (ex. docker). Write to a temp file instead.

Change-Id: I554d62265ecf0e890f9545d871afe85c0344f747
Closes-Bug: #1847707
(cherry picked from commit 63243f6cb0)
changes/44/694344/2
Rabi Mishra 3 years ago committed by Jakub Libosvar
parent 5e58782078
commit 0351f5f836
  1. 8
      migration/tripleo_environment/playbooks/roles/migration/tasks/cleanup-dataplane.yml

@ -50,6 +50,7 @@
sed 's/--interactive /--volume=\/tmp\/cleanup-{{ item.key }}.sh:\/cleanup.sh:ro /g ' )"
f="/tmp/cleanup-{{ item.key }}.sh"
f_cmd="/tmp/container-cmd-{{ item.key }}.sh"
echo "#!/bin/sh" > $f
echo "set -x" >> $f
@ -61,7 +62,12 @@
echo $cmd /cleanup.sh
$cmd /cleanup.sh
echo "#!/bin/sh" > $f_cmd
echo "set -x" >> $f_cmd
echo "set -e" >> $f_cmd
echo $cmd /cleanup.sh >> $f_cmd
chmod a+x $f_cmd
$f_cmd
fi
with_dict: "{{ agent_cleanups }}"

Loading…
Cancel
Save