Version information
This version is compatible with:
- Puppet 3.x
- Gentoo, , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'tampakrap-facter', '0.2.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-facter
Manage facter package and create external facts under /etc/facter/facts.d
Facter Package Installation
Since puppet will pull facter as dependency, this module will let you track the
installed version. Also, it will create the directory /etc/facter/facts.d
,
where we can put external facts
See Usage for more installation details.
fact
Additionally, this module provides the fact
type/resource, that creates
external facts:
fact { 'environment':
content => 'production',
target => 'env',
ensure => present,
}
This will create a file /etc/facter/facts.d/env.txt
containing:
environment=production
content
is mandatory. It can not be empty string or whitespace.target
is optional. It defaults to the name of the resource.ensure
is optional. It defaults topresent
.
The fact
provider is based on the filemapper
provider extension.
Usage
In order to use this module, just import the facter class:
import facter
You can specify extra options for the package installation, such as alternative
provider
(in case you want to install it from Gem instead of distro package),
additional install_options
or alternative package_name
, or alternative
permissions for the /etc/facter and facts.d directories:
class { 'facter':
package_name => 'rubygem-facter',
install_options => {'--no-recommends', '--from': 'third_party_repo'},
ensure => 'latest',
owner => 'puppet',
group => 'puppet',
mode => '0750',
}
(Please prefer to use hiera for your data though)
Classes
Public Classes
facter
: Main class to install facter, /etc/facter/facts.d and purge unmanaged resources
Private Classes
facter::package
: Handles the package installationfacter::params
: Various platform dependent variablesfacter::package::portage
: Gentoo/Portage specific, handles KEYWORDS and USE flags of the dev-ruby/facter package
Parameters
The following parameters are available for the hiera class:
package_name
The facter package name. Default: facter or platform dependent
ensure
The ensure value of the facter package. Default: present
provider
The package provider. Default: undef
install_options
The install_options param for the package provider. Default: undef
purge_unmanaged
Whether to purge all unmanaged external facts from /etc/facter/facts.d. Default: false
owner
The owner of the /etc/facter and facts.d directories. Default: undef
group
The group of the /etc/facter and facts.d directories. Default: undef
mode
The mode of the /etc/facter and facts.d directories. Default: undef
Types in this module release
CHANGELOG
0.2.0
2015-05-30
- Add documentation about Parameters
- Add params to change the permissions of the /etc/facter and facts.d directories
- #9 Updates in the
content
parameter:- Accept boolean content
- Change its default value to 'true'
- Make it optional
- #8 Add option to remove unmanaged fact resources
- This introduces a new dependency to the puppetlabs/stdlib module
0.1.2
2015-02-05
- Fix testcase for nonexistent provider
- #2 Refactor the fact provider
- #2 Handle invalid inputs when parsing
- #3 Split integration and unit tests
- #4 Refactor the class tests to use puppet_spec_facts
- Remove the openSUSE Tumbleweed support, it will be brought back on the next released openSUSE version
- Use latest forge releases instead of git master for fixtures
0.1.1
2015-02-01
- #1 Make :content mandatory
0.1.0
2015-02-01
- Initial release
Dependencies
- adrien/filemapper (>= 1.1.3)
- gentoo/portage (>= 2.1.0)
- pupetlabs/stdlib (>= 4.6.0)
Copyright 2013 Theo Chatzimichos Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.