Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Use puppet facts instead of facter -p #346

Merged
merged 1 commit into from
Jun 8, 2017
Merged

Use puppet facts instead of facter -p #346

merged 1 commit into from
Jun 8, 2017

Conversation

raphink
Copy link
Member

@raphink raphink commented Jun 7, 2017

facter -p is officially deprecated and puppet facts actually returns more keys (including obsolete mapped keys, such as operatingsystem and osfamily).

@dhollinger dhollinger merged commit 78b7fd1 into voxpupuli:master Jun 8, 2017
@akomakom
Copy link

akomakom commented Dec 14, 2017

This appears to break things (at least for my installation with puppet 5.3.3 and facter 3.9.3).

As I had mistakenly commented on the wrong issue here: #262 (comment) , the change to using puppet facts --render-as yaml introduces an extra yaml nesting level which mco cannot parse.

puppet facts: (BAD, extra values level)

--- !ruby/object:Puppet::Node::Facts
name: tc-puppetmaster-002
values:
  aio_agent_version: 5.3.3
  apache_version: 2.4.6
  architecture: x86_64
  augeas:
    version: 1.8.1
  augeasversion: 1.8.1
  bios_release_date: 07/30/2013
  bios_vendor: Phoenix Technologies LTD

facter -p: (GOOD, no values: nesting level)

aio_agent_version => 5.3.3
apache_version => 2.4.6
augeas => {
  version => "1.8.1"
}

When running mco inventory:

yaml from puppet facts: (BAD)

Facts:
      expiration => 2017-12-14T12:31:04.331490576-08:00
      name => tc-puppetmaster-002
      timestamp => 2017-12-14T12:01:04.330889578-08:00
      values => {"aio_agent_version"=>"5.3.3", "apache_version"=>"2.4.6", "architecture"=>"x86_64", "augeas"=>{"version"=>"1.8.1"}, "augeasversion"=>"1.8.1", "bios_release_date"=>"07/30/2013", "bios_vendor"=>"Phoenix Technologies LTD", "bios_version"=>"6.00", "blockdevice_fd0_size"=>"4096", "blockdevice_sda_model"=>"Virtual disk", "blo

yaml from facter -p: (GOOD)

Facts:
    aio_agent_version => 5.3.3
    apache_version => 2.4.6
    augeas => {"version"=>"1.8.1"}
    concat_basedir => /opt/puppetlabs/puppet/cache/concat

The json-looking values hash is not parsed by mcollective and all fact querying is broken.

@akomakom akomakom mentioned this pull request Dec 14, 2017
@alexjfisher
Copy link
Member

@akomakom Thanks for reporting this.

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

Successfully merging this pull request may close these issues.

5 participants