Fix inventory updates when running inside of k8s

This commit is contained in:
Shane McDonald 2021-03-29 13:09:56 -04:00
parent 9d17d40b86
commit 9bc0bf0ee7
No known key found for this signature in database
GPG Key ID: 6F374AF6E9EB9374
2 changed files with 5 additions and 1 deletions

View File

@ -1227,6 +1227,10 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin,
null=True,
)
@property
def is_container_group_task(self):
return bool(self.instance_group and self.instance_group.is_container_group)
def _get_parent_field_name(self):
return 'inventory_source'

View File

@ -2505,7 +2505,7 @@ class RunInventoryUpdate(BaseTask):
args.append(container_location)
args.append('--output')
args.append(os.path.join('/runner', 'artifacts', 'output.json'))
args.append(os.path.join('/runner', 'artifacts', str(inventory_update.id), 'output.json'))
if os.path.isdir(source_location):
playbook_dir = container_location