mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 03:30:02 -03:30
refactored original hosts and renamed source_inventories to input_inventories
This commit is contained in:
@@ -11,7 +11,7 @@ class Migration(migrations.Migration):
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='inventory',
|
||||
name='source_inventories',
|
||||
name='input_inventories',
|
||||
field=models.ManyToManyField(
|
||||
blank=True,
|
||||
help_text='Only valid for constructed inventories, this links to the inventories that will be used.',
|
||||
|
||||
@@ -140,7 +140,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
|
||||
default=None,
|
||||
help_text=_('Filter that will be applied to the hosts of this inventory.'),
|
||||
)
|
||||
source_inventories = models.ManyToManyField(
|
||||
input_inventories = models.ManyToManyField(
|
||||
'Inventory',
|
||||
blank=True,
|
||||
related_name='destination_inventories',
|
||||
|
||||
@@ -1524,10 +1524,10 @@ class RunInventoryUpdate(SourceControlMixin, BaseTask):
|
||||
# special case for constructed inventories, we pass source inventories from database
|
||||
# these must come in order, and in order _before_ the constructed inventory itself
|
||||
if inventory_update.inventory.kind == 'constructed':
|
||||
for source_inventory in inventory_update.inventory.source_inventories.all():
|
||||
for input_inventory in inventory_update.inventory.input_inventories.all():
|
||||
args.append('-i')
|
||||
script_params = dict(hostvars=True, towervars=True)
|
||||
source_inv_path = self.write_inventory_file(source_inventory, private_data_dir, f'hosts_{source_inventory.id}', script_params)
|
||||
source_inv_path = self.write_inventory_file(input_inventory, private_data_dir, f'hosts_{input_inventory.id}', script_params)
|
||||
args.append(to_container_path(source_inv_path, private_data_dir))
|
||||
|
||||
# Add arguments for the source inventory file/script/thing
|
||||
|
||||
Reference in New Issue
Block a user