From f04270492eaeeb88c0182271226589b014b115df Mon Sep 17 00:00:00 2001 From: Tim Way <1091435+timway@users.noreply.github.com> Date: Thu, 10 Aug 2023 01:07:52 -0500 Subject: [PATCH] Exclude `/run/host-services` When Using Docker Desktop on MacOS * Docker Desktop takes care of setting up ssh-agent forwarding from MacOS but does in a way that is only allowed to `root` inside the container * As documented at the time of commit at https://docs.docker.com/desktop/networking/#ssh-agent-forwarding * Move the `None` check ahead of the path checking with a specific error message to clearly differentiate that error from path checking errors --- src/ansible_runner/config/_base.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ansible_runner/config/_base.py b/src/ansible_runner/config/_base.py index e711bcf96..e8847e033 100644 --- a/src/ansible_runner/config/_base.py +++ b/src/ansible_runner/config/_base.py @@ -371,9 +371,14 @@ def _get_playbook_path(self, cmdline_args): def _update_volume_mount_paths( self, args_list, src_mount_path, dst_mount_path=None, labels=None ): + if src_mount_path is None: + logger.debug("Source volume mount path was not provided") + return - if src_mount_path is None or not os.path.exists(src_mount_path): - logger.debug("Source volume mount path does not exist: %s", src_mount_path) + if not os.path.exists(src_mount_path) and not ( + self.containerized and self.process_isolation_executable == "docker" and os.path.abspath(src_mount_path).startswith("/run/host-services") + ): + logger.debug("Source volume mount path does not exit {0}".format(src_mount_path)) return # ensure source is abs