Add idle_timeout setting to job settings

This commit is contained in:
Alexander Komarov
2021-08-18 17:09:46 +05:00
parent 1ff8ebab94
commit aa682fa2c9
8 changed files with 43 additions and 0 deletions

View File

@@ -408,6 +408,18 @@ register(
unit=_('seconds'),
)
register(
'DEFAULT_JOB_IDLE_TIMEOUT',
field_class=fields.IntegerField,
min_value=0,
default=600,
label=_('Default Job Idle Timeout'),
help_text=_('If no output is detected from ansible in this number of seconds the execution will be terminated.'),
category=_('Jobs'),
category_slug='jobs',
unit=_('seconds'),
)
register(
'DEFAULT_INVENTORY_UPDATE_TIMEOUT',
field_class=fields.IntegerField,

View File

@@ -1365,6 +1365,7 @@ class BaseTask(object):
'envvars': env,
'settings': {
'job_timeout': self.get_instance_timeout(self.instance),
'idle_timeout': settings.DEFAULT_JOB_IDLE_TIMEOUT,
'suppress_ansible_output': True,
},
}

View File

@@ -64,6 +64,7 @@ describe('<JobsDetail />', () => {
);
assertDetail(wrapper, 'Maximum Scheduled Jobs', '10');
assertDetail(wrapper, 'Default Job Timeout', '0 seconds');
assertDetail(wrapper, 'Default Job Idle Timeout', '600 seconds');
assertDetail(wrapper, 'Default Inventory Update Timeout', '0 seconds');
assertDetail(wrapper, 'Default Project Update Timeout', '0 seconds');
assertDetail(wrapper, 'Per-Host Ansible Fact Cache Timeout', '0 seconds');

View File

@@ -137,6 +137,11 @@ function JobsEdit() {
config={jobs.DEFAULT_JOB_TIMEOUT}
type="number"
/>
<InputField
name="DEFAULT_JOB_IDLE_TIMEOUT"
config={jobs.DEFAULT_JOB_IDLE_TIMEOUT}
type="number"
/>
<InputField
name="DEFAULT_INVENTORY_UPDATE_TIMEOUT"
config={jobs.DEFAULT_INVENTORY_UPDATE_TIMEOUT}

View File

@@ -30,6 +30,7 @@
"AWX_TASK_ENV": {},
"DEFAULT_INVENTORY_UPDATE_TIMEOUT": 0,
"DEFAULT_JOB_TIMEOUT": 0,
"DEFAULT_JOB_IDLE_TIMEOUT": 600,
"DEFAULT_PROJECT_UPDATE_TIMEOUT": 0,
"GALAXY_IGNORE_CERTS": false,
"MAX_FORKS": 200,

View File

@@ -340,6 +340,17 @@
"unit": "seconds",
"default": 0
},
"DEFAULT_JOB_IDLE_TIMEOUT": {
"type": "integer",
"required": false,
"label": "Default Job Idle Timeout",
"help_text": "If no output is detected from ansible in this number of seconds the execution will be terminated.",
"min_value": 0,
"category": "Jobs",
"category_slug": "jobs",
"unit": "seconds",
"default": 600
},
"DEFAULT_INVENTORY_UPDATE_TIMEOUT": {
"type": "integer",
"required": false,
@@ -3987,6 +3998,16 @@
"defined_in_file": false,
"unit": "seconds"
},
"DEFAULT_JOB_IDLE_TIMEOUT": {
"type": "integer",
"label": "Default Job Idle Timeout",
"help_text": "If no output is detected from ansible in this number of seconds the execution will be terminated.",
"min_value": 0,
"category": "Jobs",
"category_slug": "jobs",
"defined_in_file": false,
"unit": "seconds"
},
"DEFAULT_INVENTORY_UPDATE_TIMEOUT": {
"type": "integer",
"label": "Default Inventory Update Timeout",

View File

@@ -49,6 +49,7 @@
"SCHEDULE_MAX_JOBS":10,
"AWX_ANSIBLE_CALLBACK_PLUGINS":[],
"DEFAULT_JOB_TIMEOUT":0,
"DEFAULT_JOB_IDLE_TIMEOUT":600,
"DEFAULT_INVENTORY_UPDATE_TIMEOUT":0,
"DEFAULT_PROJECT_UPDATE_TIMEOUT":0,
"ANSIBLE_FACT_CACHE_TIMEOUT":0,

View File

@@ -17,6 +17,7 @@
"SCHEDULE_MAX_JOBS": 10,
"AWX_ANSIBLE_CALLBACK_PLUGINS": [],
"DEFAULT_JOB_TIMEOUT": 0,
"DEFAULT_JOB_IDLE_TIMEOUT": 600,
"DEFAULT_INVENTORY_UPDATE_TIMEOUT": 0,
"DEFAULT_PROJECT_UPDATE_TIMEOUT": 0,
"ANSIBLE_FACT_CACHE_TIMEOUT": 0,