Skip to content

'require puppet' forces puppet to load pre-maturely #163

@ChrisPortman

Description

@ChrisPortman

The following facts:
lib/facter/pip_version.rb
lib/facter/python_version.rb
lib/facter/virtualenv_version.rb

All do 'require puppet' which causes the puppet to load before it should. This creates issues in setting resource defaults in site.pp. For example, Puppet 3.7 currently issues this warning:

Warning: The package type's allow_virtual parameter will be changing its default value from false to true in a future release. If you do not want to allow virtual packages, please explicitly set allow_virtual to false.
(at /opt/puppet/lib/ruby/site_ruby/1.9.1/puppet/type/package.rb:430:in `block (3 levels) in module:Puppet')

during puppet agent runs. The accepted way to mute this is to explicitly set the detault value for allow_virtual like this:

site.pp

if versioncmp($::puppetversion,'3.6.1') >= 0 {
Package {
allow_virtual => false,
}
}

however, due to the 'require puppet' statement in these facts, the code that generates this warning is loaded before site.pp is processed.

Please remove the 'require puppet'

Thanks,
Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions