associate insights machine id w/ host on fact scan

* Add inisghts fact scan module
* Update fact scan playbook to call new insight fact scan module
* JT run w/ store_facts=True will save scanned facts. We "skim" the
machine_id fact from Insights fact scans and associate it with the host
that the fact scan came from.
This commit is contained in:
Chris Meyers
2017-05-10 15:26:51 -04:00
parent 3099fd7a01
commit b9b0b29d97
5 changed files with 96 additions and 1 deletions

View File

@@ -350,7 +350,7 @@ class Host(CommonModelNameNotUnique):
class Meta:
app_label = 'main'
unique_together = (("name", "inventory"),) # FIXME: Add ('instance_id', 'inventory') after migration.
unique_together = (("name", "inventory"), ("insights_machine_id", "inventory"),) # FIXME: Add ('instance_id', 'inventory') after migration.
ordering = ('name',)
inventory = models.ForeignKey(
@@ -411,6 +411,13 @@ class Host(CommonModelNameNotUnique):
default={},
help_text=_('Arbitrary JSON structure of most recent ansible_facts, per-host.'),
)
insights_machine_id = models.TextField(
blank=True,
default=None,
null=True,
db_index=True,
help_text=_('Red Hat Insights host unique identifier.'),
)
objects = HostManager()