diff --git a/awx/main/management/commands/inventory_import.py b/awx/main/management/commands/inventory_import.py index a3c6acdab3..a4d2da7680 100644 --- a/awx/main/management/commands/inventory_import.py +++ b/awx/main/management/commands/inventory_import.py @@ -78,6 +78,16 @@ class AnsibleInventoryLoader(object): bargs.extend(['-e', '{0}={1}'.format(key, value)]) ee = get_default_execution_environment() + if ee.credential: + process = subprocess.run(['podman', 'image', 'exists', ee.image], capture_output=True) + if process.returncode != 0: + logger.warn( + f'The default execution environment (id={ee.id}, name={ee.name}, image={ee.image}) is not available on this node. ' + 'The image needs to be available locally before using this command, due to registry authentication. ' + 'To pull this image, either run a job on this node or manually pull the image.' + ) + sys.exit(1) + bargs.extend([ee.image]) bargs.extend(['ansible-inventory', '-i', self.source])