-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document, implement, and test remaining indirect host audit fields
- Loading branch information
1 parent
6b24590
commit 489cfcd
Showing
8 changed files
with
285 additions
and
115 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Generated by Django 4.2.16 on 2025-01-29 20:13 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('main', '0200_delete_token_cleanup_job'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='job', | ||
name='event_queries_processed', | ||
field=models.BooleanField(default=False, help_text='Events of this job have been queried for indirect host information'), | ||
), | ||
migrations.CreateModel( | ||
name='EventQuery', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('fqcn', models.CharField(help_text='Fully-qualified collection name.', max_length=255)), | ||
('collection_version', models.CharField(help_text='Version of the collection this data applies to.', max_length=32)), | ||
('event_query', models.JSONField(default=dict, help_text='The extensions/audit/event_query.yml file content scraped from the collection.')), | ||
], | ||
options={ | ||
'unique_together': {('fqcn', 'collection_version')}, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='IndirectManagedNodeAudit', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created', models.DateTimeField(auto_now_add=True)), | ||
('name', models.CharField(help_text='The Ansible name of the host that this audit record is for.', max_length=255)), | ||
('canonical_facts', models.JSONField(default=dict, help_text='Facts about the host that will be used for managed node deduplication.')), | ||
('facts', models.JSONField(default=dict, help_text='Non canonical facts having additional info about the managed node.')), | ||
('events', models.JSONField(default=list, help_text='List of fully-qualified names of modules that ran against the host in the job.')), | ||
('count', models.PositiveIntegerField(default=0, help_text='Counter of how many times registered modules were invoked on the host.')), | ||
( | ||
'host', | ||
models.ForeignKey( | ||
help_text='The host this audit record is for.', | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name='host_indirect_host_audits', | ||
to='main.host', | ||
), | ||
), | ||
( | ||
'inventory', | ||
models.ForeignKey( | ||
help_text='The inventory the related job ran against, and which the related host is in.', | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name='inventory_indirect_host_audits', | ||
to='main.inventory', | ||
), | ||
), | ||
( | ||
'job', | ||
models.ForeignKey( | ||
editable=False, | ||
help_text='Data saved in this record only applies to this specified job.', | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name='job_indirect_host_audits', | ||
to='main.job', | ||
), | ||
), | ||
( | ||
'organization', | ||
models.ForeignKey( | ||
help_text='Applicable organization, inferred from the related job.', | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name='organization_indirect_host_audits', | ||
to='main.organization', | ||
), | ||
), | ||
], | ||
options={ | ||
'unique_together': {('name', 'job')}, | ||
}, | ||
), | ||
] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.