diff --git a/awx/main/utils.py b/awx/main/utils.py index a800414755..169920aff0 100644 --- a/awx/main/utils.py +++ b/awx/main/utils.py @@ -446,7 +446,8 @@ def build_proot_temp_dir(): ''' Create a temporary directory for proot to use. ''' - path = tempfile.mkdtemp(prefix='ansible_tower_proot_') + from django.conf import settings + path = tempfile.mkdtemp(prefix='ansible_tower_proot_', dir=settings.AWX_PROOT_BASE_PATH) os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) return path diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 5caaaf06d3..a2324b05c0 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -352,6 +352,9 @@ AWX_PROOT_SHOW_PATHS = [] # Number of jobs to show as part of the job template history AWX_JOB_TEMPLATE_HISTORY = 10 +# The directory in which proot will create new temporary directories for its root +AWX_PROOT_BASE_PATH = "/tmp" + # Default list of modules allowed for ad hoc commands. AD_HOC_COMMANDS = [ 'command',