mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 03:17:39 -02:30
Merge pull request #3624 from ryanpetrello/iso-cleanup-path-changes
update periodic isolated cleanup to match the new paths post-runner Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -340,7 +340,7 @@ class IsolatedManager(object):
|
|||||||
:param instance: a `model.Job` instance
|
:param instance: a `model.Job` instance
|
||||||
:param private_data_dir: an absolute path on the local file system
|
:param private_data_dir: an absolute path on the local file system
|
||||||
where job-specific data should be written
|
where job-specific data should be written
|
||||||
(i.e., `/tmp/ansible_awx_xyz/`)
|
(i.e., `/tmp/awx_N_xyz/`)
|
||||||
:param playbook: the playbook to run
|
:param playbook: the playbook to run
|
||||||
:param module: the module to run
|
:param module: the module to run
|
||||||
:param module_args: the module args to use
|
:param module_args: the module args to use
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def main():
|
|||||||
job_cutoff = datetime.datetime.now() - datetime.timedelta(hours=1)
|
job_cutoff = datetime.datetime.now() - datetime.timedelta(hours=1)
|
||||||
|
|
||||||
for search_pattern in [
|
for search_pattern in [
|
||||||
'/tmp/ansible_awx_[0-9]*_*', '/tmp/ansible_awx_proot_*',
|
'/tmp/awx_[0-9]*_*', '/tmp/ansible_runner_pi_*',
|
||||||
]:
|
]:
|
||||||
for path in glob.iglob(search_pattern):
|
for path in glob.iglob(search_pattern):
|
||||||
st = os.stat(path)
|
st = os.stat(path)
|
||||||
@@ -49,7 +49,7 @@ def main():
|
|||||||
continue
|
continue
|
||||||
elif modtime > folder_cutoff:
|
elif modtime > folder_cutoff:
|
||||||
try:
|
try:
|
||||||
re_match = re.match(r'\/tmp\/ansible_awx_\d+_.+', path)
|
re_match = re.match(r'\/tmp\/awx_\d+_.+', path)
|
||||||
if re_match is not None:
|
if re_match is not None:
|
||||||
if subprocess.check_call(['ansible-runner', 'is-alive', path]) == 0:
|
if subprocess.check_call(['ansible-runner', 'is-alive', path]) == 0:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -56,12 +56,12 @@ by disabling some parts of the cleanup_isolated.yml playbook.
|
|||||||
|
|
||||||
Example location of a private data directory:
|
Example location of a private data directory:
|
||||||
|
|
||||||
`/tmp/ansible_awx_29_OM6Mnx/`
|
`/tmp/awx_29_OM6Mnx/`
|
||||||
|
|
||||||
The following command would run the playbook corresponding to that job.
|
The following command would run the playbook corresponding to that job.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible-runner start /tmp/ansible_awx_29_OM6Mnx/ -p some_playbook.yml
|
ansible-runner start /tmp/awx_29_OM6Mnx/ -p some_playbook.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Other ansible-runner commands include `start`, `is-alive`, and `stop`.
|
Other ansible-runner commands include `start`, `is-alive`, and `stop`.
|
||||||
|
|||||||
Reference in New Issue
Block a user