From a8710bf2f10e020594ac91fb4e8de66086bdda94 Mon Sep 17 00:00:00 2001 From: Jim Ladd Date: Mon, 2 Nov 2020 13:16:52 -0800 Subject: [PATCH] restore proot for inventory updates - in the past, inv. update jobs called `awx-manage inventory_update` which took care of setting up process isolation - at this point, though, inv. update jobs call runner / ansible-inventory directly, so we need another way to put process isolation in place - thankfully, there was already support for providing process isolation for other types of jobs (namely JT Jobs, Project Updates and Ad Hoc commands) - so, we do what those other jobs do and override the stub for should_use_proot (which by default returns false) so that it keys off of the `AWX_PROOT_ENABLED` setting --- awx/main/tasks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 04ac11b219..a810ad7d00 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -2461,6 +2461,12 @@ class RunInventoryUpdate(BaseTask): event_model = InventoryUpdateEvent event_data_key = 'inventory_update_id' + def should_use_proot(self, inventory_update): + ''' + Return whether this task should use proot. + ''' + return getattr(settings, 'AWX_PROOT_ENABLED', False) + @property def proot_show_paths(self): return [settings.AWX_ANSIBLE_COLLECTIONS_PATHS]