Allow proot's base tmp path to be configurable

This commit is contained in:
Matthew Jones 2015-08-21 15:28:39 -04:00
parent 7080996670
commit 1471a3bb3e
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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',