{"id":13689568,"url":"https://github.com/voxpupuli/facterdb","last_synced_at":"2025-05-02T00:30:31.299Z","repository":{"id":32907583,"uuid":"36502456","full_name":"voxpupuli/facterdb","owner":"voxpupuli","description":"A Database of OS facts provided by Facter","archived":false,"fork":false,"pushed_at":"2025-04-25T15:40:46.000Z","size":4604,"stargazers_count":43,"open_issues_count":13,"forks_count":78,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-04-29T21:29:45.432Z","etag":null,"topics":["hacktoberfest","ruby"],"latest_commit_sha":null,"homepage":"http://voxpupuli.org/facterdb/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voxpupuli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"vox-pupuli","github":"voxpupuli"}},"created_at":"2015-05-29T12:16:25.000Z","updated_at":"2025-04-25T15:40:51.000Z","dependencies_parsed_at":"2024-01-15T19:45:29.179Z","dependency_job_id":"798f1864-7eed-4bbc-b760-d1427ea7beed","html_url":"https://github.com/voxpupuli/facterdb","commit_stats":{"total_commits":558,"total_committers":71,"mean_commits":7.859154929577465,"dds":0.6451612903225806,"last_synced_commit":"86ad751b8c83a01a0bd7821e000520ef416ee5d1"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Ffacterdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Ffacterdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Ffacterdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Ffacterdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voxpupuli","download_url":"https://codeload.github.com/voxpupuli/facterdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251966431,"owners_count":21672666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","ruby"],"created_at":"2024-08-02T15:01:53.253Z","updated_at":"2025-05-02T00:30:31.292Z","avatar_url":"https://github.com/voxpupuli.png","language":"Ruby","funding_links":["https://opencollective.com/vox-pupuli","https://github.com/sponsors/voxpupuli"],"categories":["hacktoberfest"],"sub_categories":[],"readme":"facterdb\n========\n\n[![License](https://img.shields.io/github/license/voxpupuli/facterdb.svg)](https://github.com/voxpupuli/facterdb/blob/master/LICENSE)\n[![Test](https://github.com/voxpupuli/facterdb/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/facterdb/actions/workflows/test.yml)\n[![Release](https://github.com/voxpupuli/facterdb/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/facterdb/actions/workflows/release.yml)\n[![RubyGem Version](https://img.shields.io/gem/v/facterdb.svg)](https://rubygems.org/gems/facterdb)\n[![RubyGem Downloads](https://img.shields.io/gem/dt/facterdb.svg)](https://rubygems.org/gems/facterdb)\n[![Donated by Camptocamp](https://img.shields.io/badge/donated%20by-camptocamp-fb7047.svg)](#transfer-notice)\n\nA Gem that contains a lot of facts for a lot of Operating Systems.\n\n![FacterDB](images/facterdb.png)\n\n\n**With facterdb 2 legacy facts are deprecated and will be removed in facterdb 3**\n\nSome facts were declared legacy a long time ago: [Core facts documentation](https://www.puppet.com/docs/puppet/latest/core_facts.html)\nWith Puppet 8 they are disabled by default. With the release of facterdb 3 we will also remove the legacy facts from our factsets.\n\n# Usage\n\n## CLI\n\n```shell\nfacterdb 'facterversion=/^2.4\\./ and (operatingsystem=Debian and operatingsystemrelease\u003e=7 or operatingsystem=RedHat and operatingsystemrelease=/^7/)'\n```\n\nWill return a JSON containing the facts for Debian 7, Debian 8 and RedHat 7 generated by Facter 2.4.\n\n## Ruby\n\n```ruby\nrequire 'facterdb'\nFacterDB::get_facts()\n```\n\nReturns an Array of Hash containing the whole facts database.\n\n## Filtering by Facter version and fact values\n\n### With an Array filter\n\n```ruby\nrequire 'facterdb'\n\nFacterDB.get_facts([{:osfamily =\u003e 'Debian'}])\n```\n\n### With an Hash filter\n\n```ruby\nrequire 'facterdb'\n\nFacterDB.get_facts({:osfamily =\u003e 'Debian'})\n```\n\n### With a String filter\n\n```ruby\nrequire 'facterdb'\n\nFacterDB::get_facts('osfamily=Debian')\n```\n\n## Included Factsets\n\nStarting with version 1.28.0 (May 2024), check [RubyDoc](https://www.rubydoc.info/gems/facterdb/) for Factsets included in each released gem.\nCheck the [Voxpupuli website](https://voxpupuli.org/facterdb/) for Factsets included in the `master` branch.\n\n## Add new Operating System support\n\nThere is `Vagrantfile` to automagically populate `facts` for all supported operating systems by spawning a new VM and launches a provisioning scripts.\nDetails of how to generate facts for each operating system are [here](facts/README.md).\n\n## Supplying custom external facts\n\nThe default facts are great for many things but there will be times when you need to have facterdb search custom\nfact sets that only make sense in your environment or might contain sensitive information.\n\nThis can be useful when combined with [rspec_puppet_facts](https://github.com/mcanevet/rspec-puppet-facts) or the [puppet-debugger](https://github.com/nwops/puppet-debugger) which both use this gem.\n\nTo supply external facts to facterdb just set the `FACTERDB_SEARCH_PATHS` environment variable with one or more\npaths to your facts.  Do this any time facterdb is used directly or indirectly.\n\nWhen separating paths please use the default path separator character supported by your OS.\n* Unix/Linux/OSX = `:`\n* Windows = `;`\n\nEach fact set you create must meet the following requirements:\n1. A JSON serialized file containing a single Hash of all the facts.\n2. The facts file must end in `.facts`\n3. Must be placed inside some directory.  You can organize this directory however you like.\n\nFacterdb is smart enough the search your supplied directories for files ending with '.facts'.  You can even supply\nmultiple directories.\n\nExample:\n\n`FACTERDB_SEARCH_PATHS=\"/var/opt/lib/custom_facts\"`\n\nor\n\n`FACTERDB_SEARCH_PATHS=\"/var/opt/lib/custom_facts:/tmp/custom_facts:/home/user1/custom_facts\"`\n\nWe still highly encourage you to create pull requests with new fact sets over of using external facts.\n\nYou can create these files via many methods.\n\n* `puppet facts | jq '.values' \u003e /tmp/custom_facts/datacenter_a/2.4/os_x.facts`  # must have jq command\n* Via puppetdb queries\n* hand crafted\n\n\nAdditionally you can skip the default FacterDB facts completely by setting the environment variable `FACTERDB_SKIP_DEFAULTDB`.\nThis will instruct facterdb to not look at its built-in facts which can be useful should you need to completely replace which facts are used.\n\n\nSetting the variable `FACTERDB_SKIP_DEFAULTDB` to anything will disable the internal facts used by facterdb.  You would most likely use this in combination\nwith the `FACTERDB_SEARCH_PATHS` environment variable.\n\nExample:\n\n```\nFACTERDB_SEARCH_PATHS=\"/var/opt/lib/custom_facts:/tmp/custom_facts:/home/user1/custom_facts\"\nFACTERDB_SKIP_DEFAULTDB='yes'\n```\n\n## Debugging fact sets\n\nBy setting the environment variable `FACTERDB_INJECT_SOURCE` the following facts are injected into all fact sets:\n\n`_facterdb_path` : The base name of the file used to load this fact set e.g. `centos-5-i386.facts`\n\n`_facterdb_filename` : The full path of the file used to load this fact set e.g. `/project/facter-db/centos-5-i386.facts`\n\n\n``` json\n{\n  \"_facterdb_path\": \"centos-5-i386.facts\",\n  \"_facterdb_filename\": \"/project/facter-db/centos-5-i386.facts\",\n  \"aio_agent_version\": \"1.8.3\",\n  \"architecture\": \"i386\",\n  \"augeas\": {\n    \"version\": \"1.4.0\"\n  },\n  \"augeasversion\": \"1.4.0\",\n  \"bios_release_date\": \"07/30/2013\",\n  \"bios_vendor\": \"Phoenix Technologies LTD\",\n  \"bios_version\": \"6.00\",\n  \"blockdevice_fd0_size\": 4096,\n  \"blockdevice_hdc_size\": 4294965248,\n  \"blockdevice_sda_model\": \"Virtual disk\",\n  ...\n```\n\nTo set the environment variable use;\n\n``` bash\nbash\u003e FACTERDB_INJECT_SOURCE='true'\n```\nor on Windows\n``` powershell\npowershell\u003e $ENV:FACTERDB_INJECT_SOURCE = 'true'\n```\n\n# Contributing\n\nPlease submit issues at https://github.com/voxpupuli/facterdb/issues or PRs in the same repository.\n\n## Release process\n\n* Update the version in `lib/facterdb/version.rb`\n* `bundle config set --local path .vendor`\n* `bundle config set --local with 'development'`\n* `CHANGELOG_GITHUB_TOKEN=\"github_PAT\" bundle exec rake changelog`\n* Commit and PR the results.\n\n\n## Transfer Notice\n\nThis plugin was originally authored by [Camptocamp](http://www.camptocamp.com).\nThe maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.\nExisting pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.\n\nPreviously: https://github.com/camptocamp/facterdb\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpupuli%2Ffacterdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoxpupuli%2Ffacterdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpupuli%2Ffacterdb/lists"}