Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom facts shouldn't break structured facts #1565

Merged
merged 1 commit into from
Dec 2, 2016

Conversation

igalic
Copy link
Contributor

@igalic igalic commented Dec 2, 2016

Change the puts output to Facter.debug so that our structured facts remain side-effect free in normal runs, and can just be piped into tools like jq

Change the `puts` output to `Facter.debug` so that our structured facts remain side-effect free in normal runs, and can just be piped into tools like `jq`
@DavidS DavidS merged commit e885b54 into master Dec 2, 2016
@DavidS DavidS deleted the igalic-structured-facts branch December 2, 2016 13:26
@igalic
Copy link
Contributor Author

igalic commented Dec 2, 2016

before:

igalic@app02 ~> sudo -H /opt/puppetlabs/bin/puppet facts | jq .values.networking.primary
parse error: Invalid numeric literal at line 1, column 9
Error: Broken pipe @ io_write - <STDOUT>
Error: Try 'puppet help facts find' for usage

because:

igalic@app02 ~> sudo -H /opt/puppetlabs/bin/puppet facts
Matching apachectl 'Server version: Apache/2.4.20 (Ubuntu)
Server built:   2016-04-20T00:00:00'
{
  "name": "networking.primary",
  "values": {
    "aio_agent_version": "1.8.1",
    "apache_version": "2.4.20",
    "apt_has_updates": false,
    "apt_reboot_required": false,
    "apt_update_last_success": 1480660628,
    "architecture": "amd64",

after:

igalic@app02 /e/p/c/e/p/m/apache ((7d7007e9…))> sudo -H /opt/puppetlabs/bin/puppet facts | jq .values.networking.primary
"eth0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants