Create Ansible/Git-based CMDB system #12817
Labels
No labels
announcement
anubis
authentication
aws
backlog
blocked
bodhi
ci
cloud
communishift
copr
database
day-to-day
dc-move
deprecated
dev
discourse
dns
downloads
easyfix
epel
firmitas
forgejo_migration
Gain
High
Gain
Low
Gain
Medium
gitlab
greenwave
hardware
help wanted
high-trouble
koji
koschei
lists
low-trouble
medium-trouble
mirrorlists
monitoring
Needs investigation
odcs
OpenShift
ops
outage
packager_workflow_blocker
pagure
permissions
Priority
Needs Review
Priority
Next Meeting
Priority
🔥 URGENT 🔥
Priority
Waiting on Assignee
Priority
Waiting on External
Priority
Waiting on Reporter
rabbitmq
release-monitoring
releng
request-for-resources
s390x
security
SMTP
sprint-0
sprint-1
src.fp.o
staging
unfreeze
waiverdb
websites-general
wiki
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
infra/tickets#12817
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: The Fedora Infrastructure CMDB doesn't really exist in a single place - we have some information like MAC addresses, IPs etc in Ansible, others in Red Hat internal spreadsheets, and more in other places. This causes issues:
In short, this isn't really fit for purpose. We should do something better.
Analysis of current data
What's in the internal spreadsheet? Reordering by "type of data", you might group it like this:
How could we track / use this better?
Proposal
Let's use Ansible as the CMDB-ish thing that stores all this. What might that look like?
Consderations
Security is question one, but in conversation with managers, the current thinking is "no, it's not". The only things I think might be worth thinking about are serial & purchase info / warranty info, and I can't see how you make a scam out of that.
Second, part of the goal here is to make the data more actionable, especially warranties. I can see several routes here
Other options
Do we have any alternatives?
Implementation
As it stands now, the two infras (Fedora & CentOS) have different structures in their inventory for how to track this stuff. Rather than "pick a winner", I feel it's fairer to change both 😀
More seriously, I do think it would make sense to have this under a single key, eg:
Having it all under
{{ hardware.* }}makes it easy to know where to look for things, and stops it getting distributed all over the host_vars file (which is definitely an issue for some of the hosts with lots of vars). We could start with things not currently tracked, such as warranty data, and can then look at migrating existing vars (eg, mac0-3, bmc, etc) to this key later on.For the Zabbix side, we can definitely do this via Ansible, as https://www.zabbix.com/documentation/current/en/manual/api/reference/host/object#host-inventory is the possible list of inventory keys, and https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#id4 has examples of sending those keys
Next steps
This is very much the high-level epic. I think we'll need to break this down into action items, including, but not limited to:
This looks great to me. I'm happy to help work on it too.
I think additionally we could nuke the inventory/hardware file because we can determine it via the existance of a hardware: key or not.
The serial is already in facts, but I guess duplicating it makes it easier to work with as a variable.
Metadata Update from @phsmoura:
Metadata Update from @gwmngilfen:
So, there has been progress here. A initial workflow has been figured out and @jbley is going to see what information can be migrated from the old spreadsheet here. After we do a few of these and get the data needed well known, we can spread this out to other interested folks to contibute to.
I'll work with @gwmngilfen on getting info on the missing information (where applicable).
@jbley has opened infra/ansible#3197 which I'll review next week.
still in progress, I've been trying to finish up the Nagios migration first, then this and a bunch of other cleanup can get done
Is there a reason to do "warranty_start + warranty_days" instead of just "warranty_end"?
FWIW I updated my script which queries the ansible fact cache data, to get just the relevant HW things out of it. Eg. (run on batcave in ~root)
./af2cmdb.sh .ansible_facts_cache/vmhost-x86-01.rdu3.fedoraproject.org