diff --git a/changelogs/fragments/321-kubectl_sleep.yml b/changelogs/fragments/321-kubectl_sleep.yml new file mode 100644 index 00000000..6839924b --- /dev/null +++ b/changelogs/fragments/321-kubectl_sleep.yml @@ -0,0 +1,3 @@ +--- +minor_changes: +- kubectl - wait for dd command to complete before proceeding (https://github.com/ansible-collections/kubernetes.core/pull/321). diff --git a/plugins/connection/kubectl.py b/plugins/connection/kubectl.py index a8fcbf5c..980b54a3 100644 --- a/plugins/connection/kubectl.py +++ b/plugins/connection/kubectl.py @@ -355,7 +355,7 @@ class Connection(ConnectionBase): [ self._play_context.executable, "-c", - "dd of=%s bs=%s%s" % (out_path, BUFSIZE, count), + "dd of=%s bs=%s%s && sleep 0" % (out_path, BUFSIZE, count), ] ) args = [to_bytes(i, errors="surrogate_or_strict") for i in args]