remove cached stdlib puppet module, so that different versions can be used depending on modules selected

This commit is contained in:
Z. Cliffe Schreuders
2022-07-29 12:23:46 +01:00
parent 3fbfd9690d
commit 68afa4be11
566 changed files with 7 additions and 28319 deletions

View File

@@ -8,8 +8,10 @@
forge "https://forgeapi.puppetlabs.com"
# specific versions of modules
mod 'puppetlabs-stdlib', :path => '<%= LOCAL_PUPPET_DIR %>/stdlib' # '4.25.1', stdlib enables parsejson() in manifests and other useful functions
# unfortunately we can't hard code local copies of libraries any longer
# because we have different needs depending on the distro
# we used to be able to do this for faster build times:
#mod 'puppetlabs-stdlib', :path => '<%= LOCAL_PUPPET_DIR %>/stdlib' # '4.25.1', stdlib enables parsejson() in manifests and other useful functions
#mod 'puppetlabs-apt' #, '7.4.0' # pin apt to 7.4.0 as current version is incompatible with our base boxes
# from local copy, for faster build times
### mod 'translate', :path => '<%= LOCAL_PUPPET_DIR %>'
@@ -25,3 +27,6 @@ mod 'SecGen-<%= selected_module.module_path_name %>/<%= selected_module.module_p
<% end -%>
mod 'puppetlabs-vcsrepo' # , :path => '<%= LOCAL_PUPPET_DIR %>/vcsrepo'
# stdlib is used throughout (ensure_packages, parsejson, etc), placing it last ensures a compatible version is selected
mod 'puppetlabs-stdlib'

View File

@@ -1,938 +0,0 @@
# Change log
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org).
## Supported Release 4.25.1
### Summary
This is a patch which includes a roll up of small fixes. In Puppet 5.5.0 `flatten()`, `length(),` `empty(),` `join(),` `keys(),` and `values()` are now built into Puppet. Please note that the Puppet implementation of the functions will take precedence over the functions in 'puppetlabs-stdlib'.
#### Fixed
- Remove unneeded execute permission from test files.
- Puppet 5.5.0 function deprecation [MODULES-6894](https://tickets.puppetlabs.com/browse/MODULES-6894).
## Supported Release 4.25.0
### Summary
This is quite a feature heavy release, it makes this module PDK-compliant for easier maintenance and includes a roll up of maintenance changes.
#### Added
- PDK conversion [MODULES-6332](https://tickets.puppetlabs.com/browse/MODULES-6332).
- Update `join_keys_to_values` with an undef statement.
- Type alias `Stdlib::Fqdn` matches paths on a fully qualified domain name.
- Type alias `Stdlib::Host` matches a valid host, this can be a valid 'ipv4', 'ipv6' or 'fqdn'.
- Type alias `Stdlib::Port` matches a valid TCP/UDP Port number.
- Type alias `Stdlib::Filesource` matches paths valid values for the source parameter of the puppet file type.
- Type alias `Stdlib::IP::Address` matches any IP address, including both IPv4 and IPv6 addresses,
- Type alias `Stdlib::IP::Address::V4` matches any string consisting of a valid IPv4 address, this is extended by 'CIDR' and 'nosubnet'.
- Type alias `Stdlib::IP::Address::V6` matches any string consisting of a valid IPv6 address, this is extended by 'Full', 'Alternate' and 'Compressed'.
- Type alias `Stdlib::IP::Address::V6::Nosubnet`matches any string consisting of a valid IPv6 address with no subnet, this is extended by 'Full', 'Alternate' and 'Compressed'.
- Type alias `Stdlib::Port` matches a valid TCP/UDP Port number this is then extended to 'Privileged' which are ports less than 1024 and 'Unprivileged' which are ports greater than 1024.
## Supported Release 4.24.0
### Summary
This release includes a roll up of minor changes and a new feature which provides the ability to skip undef values `to_json_pretty()`.
We have also reverted a change that was previously made and resulted in breaking compatibility with Ruby 1.8.7.
#### Added
- Ability to skip undef values in `to_json_pretty()`.
- Fix type3x function in stdlib ([MODULES-6216](https://tickets.puppet.com/browse/MODULES-6216))
#### Changed
- Indentation for `sync.yml` was fixed.
- Updated type alias tests and dropped superfluous wrapper classes
- Revert to old ruby 1.X style of hash ([MODULES-6139](https://tickets.puppet.com/browse/MODULES-6139))
- `rubocop.yml` not managed by msync ([MODULES-6201](https://tickets.puppet.com/browse/MODULES-6201))
## Supported Release 4.23.0
### Summary
This release is in order to implement Rubocop changes throughout the module.
#### Added
- Standard and translated readme's have been updated.
- Rubocop has been implemented in the module and a wide variety of changes have been made to the code.
- Modulesync changes have been merged into the code.
#### Fixed
- Minor fix to the readme.
## Supported Release 4.22.0
### Summary
This is a clean release in preparation of putting the module through the rubocop process.
#### Added
- Support has been added for Debian 9
- 'Stdlib::Mode type' has been added to the module.
- A type for 'ensure' has been added to the service resources.
- A new function 'sprintf_hash' has been added to allow the use of named references.
#### Removed
- Support has been removed for: RedHat 4, CentOS 4, OracleLinux 4, Scientific 4, SLES 10 SP4, Windows Server 2003, Windows Server 2003 R2 and Windows 8.
#### Fixed
- The 'ruby_spec.rb' test file has been altered s that it properly checks results.
- Example syntax in 'file_line.rb' has been fixed.
## Supported Release 4.21.0
### Summary
This is a small feature release that includes a revamped, albeit backwards-compatible file_line type.
#### Added
- `replace_all_matches_not_matching_line` parameter in file_line
- additional tests and documentation for file_line
#### Removed
- duplicate spec test for absolute_path
#### Fixed
- Unixpath type to allow "/" as valid path
- file_line behavior that caused infinite appending of `line` to a file ([MODULES-5651](https://tickets.puppet.com/browse/MODULES-5651))
## Supported Release 4.20.0
### Summary
This release adds new functions and updated README translations.
#### Added
- `to_json`, `to_json_pretty`, and `to_yaml` functions
- new Japanese README translations
#### Fixed
- compatibility issue with older versions of Puppet and the `pw_hash` function ([MODULES-5546](https://tickets.puppet.com/browse/MODULES-5546))
#### Removed
- support for EOL platform Debian 6 (Squeeze)
## Supported Release 4.19.0
### Summary
This release adds new functions and better documentation/fixes for existing functions with a noteworthy fix for file_line.
#### Added
- Add validate_domain_name function
- Add the round function
- Add type for MAC address
- Add support for sensitive data type to pw_hash ([MODULES-4908](https://tickets.puppet.com/browse/MODULES-4908))
- Add new function, fact() (FACT-932)
#### Fixed
- Fixes for the file_line provider ([MODULES-5003](https://tickets.puppet.com/browse/MODULES-5003))
- Add documentation for email functions ([MODULES-5382](https://tickets.puppet.com/browse/MODULES-5382))
- unique function is deprecated for puppet version > 5. (FM-6239)
- Fix headers in CHANGELOG.md so that headers render correctly
- ensure_packages, converge ensure values 'present' and 'installed'
#### Changed
- Removes listed support for EOL Ubuntu versions
## Supported Release 4.18.0
### Summary
Small release that reverts the Puppet version requirement lower bound to again include Puppet 2.7+ and bumps the upper bound to now include Puppet 5.
#### Fixed
- Reverts lower bound of Puppet requirement to 2.7.20
## Supported Release 4.17.1
### Summary
Small release to address a bug (PUP-7650). Also pushes the Puppet version compatibility to 4.7.0.
#### Bugfixes
- (MODULES-5095) Workaround for PUP-7650
- (FM-6197) Formatting fixes for file_line resource
## Supported Release 4.17.0
### Summary
This release adds support for internationalization. It also contains Japanese translations for the README, summary and description of the metadata.json and major cleanups in the README. Additional folders have been introduced called locales and readmes where translation files can be found. A number of features and bug fixes are also included in this release. It also adds a new function `glob()` for expanding file lists. Also works around an issue that appeared in puppet 4.6.0 involving types being declared multiple times.
#### Features
- Addition of POT file / folder structure for i18n.
- Addition of Internationalized READMEs.
- `glob()` function
### Fixed
- Occasional duplicate type definitions when using `defined_with_params()`
- `file_line` encoding issue on ruby 1.8 (unsupported)
- Huge readme refresh
## Supported Release 4.16.0
### Summary
This release sees a massive update to all unit tests to test UTF8 characters. There are also multiple cleanups in preparation for internationalization. Alongside this, improvements to ipv6 support, a new length function compatible with Puppet 4, and an update to path types. Also contains multiple bug fixes around functionality and tests.
#### Features
- Addition of coverage in all unit tests for functions, data and resource types for UTF8 for i18n.
- All strings within the readme and functions that are split over two lines have been combined in preparation for i18n parser/decorator.
- Improvement on the ipv6 support for type - Improves regex to catch some valid (but lesser known) ipv6 strings, mostly those which are a mix of ipv6 strings and embedded ipv6 numbers.
- Adds a new parameter `encoding` to allow non UTF-8 files to specify a file encoding. This prevents receiving the error message "invalid byte sequence in UTF-8" when special characters that are not UTF-8 encoded appear in the input stream, such as the copyright symbol.
- Addition of the new length function. Returns the length of a given string, array or hash. To eventually replace the deprecated size() function as can handle the new type functionality introduced in Puppet 4.
- Permit double slash in absolute/Unix path types.
#### Bugfixes
- Fix unsupported data type error with rspec-puppet master.
- Now allows test module metadata.json to be read by Puppet.
- Fix acceptance test failure "Hiera is not a class".
- Removal of unsupported platforms and future parser setting in acceptance tests.
- Regex for tuple checking has been loosened.
- Ensure_packages function - Now only tries to apply the resource if not defined.
- (MODULES-4528) Use versioncmp to check Puppet version for 4.10.x compat.
- Adds comments to warn for UTF8 incompatibility of the functions that may not be compatible with UTF8 with Ruby < 2.4.0.
## Supported Release 4.15.0
### Summary
This release introduces multiple new functions, a new fact and the addition of Ubuntu Xenial support. Also includes a bugfix and documentation update.
#### Features
- Addition of puppet_server fact to return agents server.
- Addition of a pry function.
- Addition of tests for ensure_resources.
- Addition of FQDN UUID generation function.
- Addition of Ubuntu Xenial to OS Support.
#### Bugfixes
- Ensure_packages now works with Ruby < 2.0.
- Updated the documentation of str2bool function.
## Supported Release 4.14.0
### Summary
Adds several new features and updates, especially around refining the deprecation and validate_legacy functions. Also includes a Gemfile update around an issue with parallel_tests dependancy for different versions of Ruby.
#### Features
- Deprecation function now uses puppet stacktrace if available.
- join_key_to_values function now handles array values. If values are arrays, multiple keys are added for each element.
- Updated Gemfile to deal with parallel_tests Ruby dependancy (MODULES-3983).
- Updated/Fixed ipv4 regex validator (MODULES-3980).
- Deprecation clarification added to README.
#### Bugfixes
- README typo fixes.
- Use .dup to duplicate classes for modification (MODULES-3829).
- Fixes spec failures that were caused by a change in the tested error message in validate_legacy_spec.
- Broken link to validate_legacy docs fixed.
- Updates deprecation tests to include future parser.
## Supported Release 4.13.1
### Summary
This bugfix release addresses the `undefined method 'optional_repeated_param'` error messages seen by users of puppet 3.7.
It also improves the user experience around function deprecations by emitting one warning per function(-name) instead of only one deprecation overall. This allows users to identify all deprecated functions used in one agent run, with less back-and-forth.
#### Bugfixes
* Emit deprecations warnings for each function, instead of once per process. (MODULES-3961)
* Use a universally available API for the v4 deprecation stubs of `is_*` and `validate_*`. (MODULES-3962)
* Make `getvar()` compatible to ruby 1.8.7. (MODULES-3969)
* Add v4 deprecation stubs for the `is_` counterparts of the deprecated functions to emit the deprecations warnings in all cases.
## Supported Release 4.13.0
### Summary
This version of stdlib deprecates a whole host of functions, and provides stepping stones to move to Puppet 4 type validations. Be sure to check out the new `deprecation()` and `validate_legacy()` functions to migrate off the deprecated v3-style data validations.
Many thanks to all community contributors: bob, Dmitry Ilyin, Dominic Cleal, Joris, Joseph Yaworski, Loic Antoine-Gombeaud, Maksym Melnychok, Michiel Brandenburg, Nate Potter, Romain Tartière, Stephen Benjamin, and Steve Moore, as well as anyone contributing in the code review process and by submitting issues.
Special thanks to [Voxpupuli's](https://voxpupuli.org/) Igor Galić for donating the puppet-tea types to kickstart this part of stdlib.
#### Deprecations
* `validate_absolute_path`, `validate_array`, `validate_bool`, `validate_hash`, `validate_integer`, `validate_ip_address`, `validate_ipv4_address`, `validate_ipv6_address`, `validate_numeric`, `validate_re`, `validate_slength`, `validate_string`, and their `is_` counter parts are now deprecated on Puppet 4. See the `validate_legacy()` description in the README for help on migrating away from those functions.
* The `dig` function is provided by core puppet since 4.5.0 with slightly different calling convention. The stdlib version can still be accessed as `dig44` for now.
#### Features
* Add Puppet 4 data types for Unix, and Windows paths, and URLs.
* Add `deprecation` function to warn users of functionality that will be removed soon.
* Add `validate_legacy` function to help with migrating to Puppet 4 data types.
* Add `any2bool` function, a combination of of `string2bool` and `num2bool`.
* Add `delete_regex` function to delete array elements matching a regular expression.
* Add `puppet_environmentpath` fact to expose the `environmentpath` setting.
* Add `regexpescape` function to safely insert arbitrary strings into regular expressions.
* Add `shell_escape`, `shell_join`, and `shell_split` functions for safer working with shell scripts..
* The `delete` function now also accepts regular expressions as search term.
* The `loadyaml` function now accepts a default value, which is returned when there is an error loading the file.
#### Bugfixes
* Fix `file_line.match_for_absence` implementation and description to actually work. (MODULES-3590)
* Fix `getparam` so that it can now also return `false`. (MODULES-3933)
* Fix the fixture setup for testing and adjust `load_module_metadata` and `loadjson` tests.
* Fix `defined_with_params` to handle `undef` correctly on all puppet versions. (PUP-6422, MODULES-3543)
* Fix `file_line.path` validation to use puppet's built in `absolute_path?` matcher.
#### Minor Improvements
* README changes: improved descriptions of `deep_merge`, `delete`, `ensure_packages`, `file_line.after`, `range`, and `validate_numeric`.
* The `getvar` function now returns nil in all situations where the variable is not found.
* Update the `dig44` function with better `undef`, `nil`, and `false` handling.
* Better wording on `str2bool` argument validation error message.
### Known issues
* The `validate_legacy` function relies on internal APIs from Puppet 4.4.0 (PE 2016.1) onwards, and doesn't work on earlier versions.
* Puppet 4.5.0 (PE 2016.2) has a number of improvements around data types - especially error handling - that make working with them much nicer.
## Supported Release 4.12.0
### Summary
This release provides several new functions, bugfixes, modulesync changes, and some documentation updates.
#### Features
- Adds `clamp`. This function keeps values within a specified range.
- Adds `validate_x509_rsa_key_pair`. This function validates an x509 RSA certificate and key pair.
- Adds `dig`. This function performs a deep lookup in nested hashes or arrays.
- Extends the `base64` support to fit `rfc2045` and `rfc4648`.
- Adds `is_ipv6_address` and `is_ipv4_address`. These functions validate the specified ipv4 or ipv6 addresses.
- Adds `enclose_ipv6`. This function encloses IPv6 addresses in square brackets.
- Adds `ensure_resources`. This function takes a list of resources and creates them if they do not exist.
- Extends `suffix` to support applying a suffix to keys in a hash.
- Apply modulesync changes.
- Add validate_email_address function.
#### Bugfixes
- Fixes `fqdn_rand_string` tests, since Puppet 4.4.0 and later have a higher `fqdn_rand` ceiling.
- (MODULES-3152) Adds a check to `package_provider` to prevent failures if Gem is not installed.
- Fixes to README.md.
- Fixes catch StandardError rather than the gratuitous Exception
- Fixes file_line attribute validation.
- Fixes concat with Hash arguments.
## Supported Release 4.11.0
### Summary
Provides a validate_absolute_paths and Debian 8 support. There is a fix to the is_package_provider fact and a test improvement.
#### Features
- Adds new parser called is_absolute_path
- Supports Debian 8
#### Bugfixes
- Allow package_provider fact to resolve on PE 3.x
#### Improvements
- ensures that the test passes independently of changes to rubygems for ensure_resource
## 2015-12-15 - Supported Release 4.10.0
### Summary
Includes the addition of several new functions and considerable improvements to the existing functions, tests and documentation. Includes some bug fixes which includes compatibility, test and fact issues.
#### Features
- Adds service_provider fact
- Adds is_a() function
- Adds package_provider fact
- Adds validate_ip_address function
- Adds seeded_rand function
#### Bugfixes
- Fix backwards compatibility from an improvement to the parseyaml function
- Renaming of load_module_metadata test to include _spec.rb
- Fix root_home fact on AIX 5.x, now '-c' rather than '-C'
- Fixed Gemfile to work with ruby 1.8.7
#### Improvements
- (MODULES-2462) Improvement of parseyaml function
- Improvement of str2bool function
- Improvement to readme
- Improvement of intersection function
- Improvement of validate_re function
- Improved speed on Facter resolution of service_provider
- empty function now handles numeric values
- Package_provider now prevents deprecation warning about the allow_virtual parameter
- load_module_metadata now succeeds on empty file
- Check added to ensure puppetversion value is not nil
- Improvement to bool2str to return a string of choice using boolean
- Improvement to naming convention in validate_ipv4_address function
## Supported Release 4.9.1
### Summary
Small release for support of newer PE versions. This increments the version of PE in the metadata.json file.
## 2015-09-08 - Supported Release 4.9.0
### Summary
This release adds new features including the new functions dos2unix, unix2dos, try_get_value, convert_base as well as other features and improvements.
#### Features
- (MODULES-2370) allow `match` parameter to influence `ensure => absent` behavior
- (MODULES-2410) Add new functions dos2unix and unix2dos
- (MODULE-2456) Modify union to accept more than two arrays
- Adds a convert_base function, which can convert numbers between bases
- Add a new function "try_get_value"
#### Bugfixes
- n/a
#### Improvements
- (MODULES-2478) Support root_home fact on AIX through "lsuser" command
- Acceptance test improvements
- Unit test improvements
- Readme improvements
## 2015-08-10 - Supported Release 4.8.0
### Summary
This release adds a function for reading metadata.json from any module, and expands file\_line's abilities.
#### Features
- New parameter `replace` on `file_line`
- New function `load_module_metadata()` to load metadata.json and return the content as a hash.
- Added hash support to `size()`
#### Bugfixes
- Fix various docs typos
- Fix `file_line` resource on puppet < 3.3
## 2015-06-22 - Supported Release 4.7.0
### Summary
Adds Solaris 12 support along with improved Puppet 4 support. There are significant test improvements, and some minor fixes.
#### Features
- Add support for Solaris 12
#### Bugfixes
- Fix for AIO Puppet 4
- Fix time for ruby 1.8.7
- Specify rspec-puppet version
- range() fix for typeerror and missing functionality
- Fix pw_hash() on JRuby < 1.7.17
- fqdn_rand_string: fix argument error message
- catch and rescue from looking up non-existent facts
- Use puppet_install_helper, for Puppet 4
#### Improvements
- Enforce support for Puppet 4 testing
- fqdn_rotate/fqdn_rand_string acceptance tests and implementation
- Simplify mac address regex
- validate_integer, validate_numeric: explicitely reject hashes in arrays
- Readme edits
- Remove all the pops stuff for rspec-puppet
- Sync via modulesync
- Add validate_slength optional 3rd arg
- Move tests directory to examples directory
## 2015-04-14 - Supported Release 4.6.0
### Summary
Adds functions and function argument abilities, and improves compatibility with the new puppet parser
#### Features
- MODULES-444: `concat()` can now take more than two arrays
- `basename()` added to have Ruby File.basename functionality
- `delete()` can now take an array of items to remove
- `prefix()` can now take a hash
- `upcase()` can now take a hash or array of upcaseable things
- `validate_absolute_path()` can now take an array
- `validate_cmd()` can now use % in the command to embed the validation file argument in the string
- MODULES-1473: deprecate `type()` function in favor of `type3x()`
- MODULES-1473: Add `type_of()` to give better type information on future parser
- Deprecate `private()` for `assert_private()` due to future parser
- Adds `ceiling()` to take the ceiling of a number
- Adds `fqdn_rand_string()` to generate random string based on fqdn
- Adds `pw_hash()` to generate password hashes
- Adds `validate_integer()`
- Adds `validate_numeric()` (like `validate_integer()` but also accepts floats)
#### Bugfixes
- Fix seeding of `fqdn_rotate()`
- `ensure_resource()` is more verbose on debug mode
- Stricter argument checking for `dirname()`
- Fix `is_domain_name()` to better match RFC
- Fix `uriescape()` when called with array
- Fix `file_line` resource when using the `after` attribute with `match`
## 2015-01-14 - Supported Release 4.5.1
### Summary
This release changes the temporary facter_dot_d cache locations outside of the /tmp directory due to a possible security vunerability. CVE-2015-1029
#### Bugfixes
- Facter_dot_d cache will now be stored in puppet libdir instead of tmp
## 2014-12-15 - Supported Release 4.5.0
### Summary
This release improves functionality of the member function and adds improved future parser support.
#### Features
- MODULES-1329: Update member() to allow the variable to be an array.
- Sync .travis.yml, Gemfile, Rakefile, and CONTRIBUTING.md via modulesync
#### Bugfixes
- Fix range() to work with numeric ranges with the future parser
- Accurately express SLES support in metadata.json (was missing 10SP4 and 12)
- Don't require `line` to match the `match` parameter
## 2014-11-10 - Supported Release 4.4.0
### Summary
This release has an overhauled readme, new private manifest function, and fixes many future parser bugs.
#### Features
- All new shiny README
- New `private()` function for making private manifests (yay!)
#### Bugfixes
- Code reuse in `bool2num()` and `zip()`
- Fix many functions to handle `generate()` no longer returning a string on new puppets
- `concat()` no longer modifies the first argument (whoops)
- strict variable support for `getvar()`, `member()`, `values_at`, and `has_interface_with()`
- `to_bytes()` handles PB and EB now
- Fix `tempfile` ruby requirement for `validate_augeas()` and `validate_cmd()`
- Fix `validate_cmd()` for windows
- Correct `validate_string()` docs to reflect non-handling of `undef`
- Fix `file_line` matching on older rubies
## 2014-07-15 - Supported Release 4.3.2
### Summary
This release merely updates metadata.json so the module can be uninstalled and
upgraded via the puppet module command.
## 2014-07-14 - Supported Release 4.3.1
### Summary
This supported release updates the metadata.json to work around upgrade behavior of the PMT.
#### Bugfixes
- Synchronize metadata.json with PMT-generated metadata to pass checksums
## 2014-06-27 - Supported Release 4.3.0
### Summary
This release is the first supported release of the stdlib 4 series. It remains
backwards-compatible with the stdlib 3 series. It adds two new functions, one bugfix, and many testing updates.
#### Features
- New `bool2str()` function
- New `camelcase()` function
#### Bugfixes
- Fix `has_interface_with()` when interfaces fact is nil
## 2014-06-04 - Release 4.2.2
### Summary
This release adds PE3.3 support in the metadata and fixes a few tests.
## 2014-05-08 - Release - 4.2.1
### Summary
This release moves a stray symlink that can cause problems.
## 2014-05-08 - Release - 4.2.0
### Summary
This release adds many new functions and fixes, and continues to be backwards compatible with stdlib 3.x
#### Features
- New `base64()` function
- New `deep_merge()` function
- New `delete_undef_values()` function
- New `delete_values()` function
- New `difference()` function
- New `intersection()` function
- New `is_bool()` function
- New `pick_default()` function
- New `union()` function
- New `validate_ipv4_address` function
- New `validate_ipv6_address` function
- Update `ensure_packages()` to take an option hash as a second parameter.
- Update `range()` to take an optional third argument for range step
- Update `validate_slength()` to take an optional third argument for minimum length
- Update `file_line` resource to take `after` and `multiple` attributes
#### Bugfixes
- Correct `is_string`, `is_domain_name`, `is_array`, `is_float`, and `is_function_available` for parsing odd types such as bools and hashes.
- Allow facts.d facts to contain `=` in the value
- Fix `root_home` fact on darwin systems
- Fix `concat()` to work with a second non-array argument
- Fix `floor()` to work with integer strings
- Fix `is_integer()` to return true if passed integer strings
- Fix `is_numeric()` to return true if passed integer strings
- Fix `merge()` to work with empty strings
- Fix `pick()` to raise the correct error type
- Fix `uriescape()` to use the default URI.escape list
- Add/update unit & acceptance tests.
## 2014-03-04 - Supported Release - 3.2.1
### Summary
This is a supported release
#### Bugfixes
- Fixed `is_integer`/`is_float`/`is_numeric` for checking the value of arithmatic expressions.
#### Known bugs
* No known bugs
---
##### 2013-05-06 - Jeff McCune <jeff@puppetlabs.com> - 4.1.0
* (#20582) Restore facter\_dot\_d to stdlib for PE users (3b887c8)
* (maint) Update Gemfile with GEM\_FACTER\_VERSION (f44d535)
##### 2013-05-06 - Alex Cline <acline@us.ibm.com> - 4.1.0
* Terser method of string to array conversion courtesy of ethooz. (d38bce0)
##### 2013-05-06 - Alex Cline <acline@us.ibm.com> 4.1.0
* Refactor ensure\_resource expectations (b33cc24)
##### 2013-05-06 - Alex Cline <acline@us.ibm.com> 4.1.0
* Changed str-to-array conversion and removed abbreviation. (de253db)
##### 2013-05-03 - Alex Cline <acline@us.ibm.com> 4.1.0
* (#20548) Allow an array of resource titles to be passed into the ensure\_resource function (e08734a)
##### 2013-05-02 - Raphaël Pinson <raphael.pinson@camptocamp.com> - 4.1.0
* Add a dirname function (2ba9e47)
##### 2013-04-29 - Mark Smith-Guerrero <msmithgu@gmail.com> - 4.1.0
* (maint) Fix a small typo in hash() description (928036a)
##### 2013-04-12 - Jeff McCune <jeff@puppetlabs.com> - 4.0.2
* Update user information in gemspec to make the intent of the Gem clear.
##### 2013-04-11 - Jeff McCune <jeff@puppetlabs.com> - 4.0.1
* Fix README function documentation (ab3e30c)
##### 2013-04-11 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
* stdlib 4.0 drops support with Puppet 2.7
* stdlib 4.0 preserves support with Puppet 3
##### 2013-04-11 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
* Add ability to use puppet from git via bundler (9c5805f)
##### 2013-04-10 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
* (maint) Make stdlib usable as a Ruby GEM (e81a45e)
##### 2013-04-10 - Erik Dalén <dalen@spotify.com> - 4.0.0
* Add a count function (f28550e)
##### 2013-03-31 - Amos Shapira <ashapira@atlassian.com> - 4.0.0
* (#19998) Implement any2array (7a2fb80)
##### 2013-03-29 - Steve Huff <shuff@vecna.org> - 4.0.0
* (19864) num2bool match fix (8d217f0)
##### 2013-03-20 - Erik Dalén <dalen@spotify.com> - 4.0.0
* Allow comparisons of Numeric and number as String (ff5dd5d)
##### 2013-03-26 - Richard Soderberg <rsoderberg@mozilla.com> - 4.0.0
* add suffix function to accompany the prefix function (88a93ac)
##### 2013-03-19 - Kristof Willaert <kristof.willaert@gmail.com> - 4.0.0
* Add floor function implementation and unit tests (0527341)
##### 2012-04-03 - Eric Shamow <eric@puppetlabs.com> - 4.0.0
* (#13610) Add is\_function\_available to stdlib (961dcab)
##### 2012-12-17 - Justin Lambert <jlambert@eml.cc> - 4.0.0
* str2bool should return a boolean if called with a boolean (5d5a4d4)
##### 2012-10-23 - Uwe Stuehler <ustuehler@team.mobile.de> - 4.0.0
* Fix number of arguments check in flatten() (e80207b)
##### 2013-03-11 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
* Add contributing document (96e19d0)
##### 2013-03-04 - Raphaël Pinson <raphael.pinson@camptocamp.com> - 4.0.0
* Add missing documentation for validate\_augeas and validate\_cmd to README.markdown (a1510a1)
##### 2013-02-14 - Joshua Hoblitt <jhoblitt@cpan.org> - 4.0.0
* (#19272) Add has\_element() function (95cf3fe)
##### 2013-02-07 - Raphaël Pinson <raphael.pinson@camptocamp.com> - 4.0.0
* validate\_cmd(): Use Puppet::Util::Execution.execute when available (69248df)
##### 2012-12-06 - Raphaël Pinson <raphink@gmail.com> - 4.0.0
* Add validate\_augeas function (3a97c23)
##### 2012-12-06 - Raphaël Pinson <raphink@gmail.com> - 4.0.0
* Add validate\_cmd function (6902cc5)
##### 2013-01-14 - David Schmitt <david@dasz.at> - 4.0.0
* Add geppetto project definition (b3fc0a3)
##### 2013-01-02 - Jaka Hudoklin <jakahudoklin@gmail.com> - 4.0.0
* Add getparam function to get defined resource parameters (20e0e07)
##### 2013-01-05 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
* (maint) Add Travis CI Support (d082046)
##### 2012-12-04 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
* Clarify that stdlib 3 supports Puppet 3 (3a6085f)
##### 2012-11-30 - Erik Dalén <dalen@spotify.com> - 4.0.0
* maint: style guideline fixes (7742e5f)
##### 2012-11-09 - James Fryman <james@frymanet.com> - 4.0.0
* puppet-lint cleanup (88acc52)
##### 2012-11-06 - Joe Julian <me@joejulian.name> - 4.0.0
* Add function, uriescape, to URI.escape strings. Redmine #17459 (fd52b8d)
##### 2012-09-18 - Chad Metcalf <chad@wibidata.com> - 3.2.0
* Add an ensure\_packages function. (8a8c09e)
##### 2012-11-23 - Erik Dalén <dalen@spotify.com> - 3.2.0
* (#17797) min() and max() functions (9954133)
##### 2012-05-23 - Peter Meier <peter.meier@immerda.ch> - 3.2.0
* (#14670) autorequire a file\_line resource's path (dfcee63)
##### 2012-11-19 - Joshua Harlan Lifton <lifton@puppetlabs.com> - 3.2.0
* Add join\_keys\_to\_values function (ee0f2b3)
##### 2012-11-17 - Joshua Harlan Lifton <lifton@puppetlabs.com> - 3.2.0
* Extend delete function for strings and hashes (7322e4d)
##### 2012-08-03 - Gary Larizza <gary@puppetlabs.com> - 3.2.0
* Add the pick() function (ba6dd13)
##### 2012-03-20 - Wil Cooley <wcooley@pdx.edu> - 3.2.0
* (#13974) Add predicate functions for interface facts (f819417)
##### 2012-11-06 - Joe Julian <me@joejulian.name> - 3.2.0
* Add function, uriescape, to URI.escape strings. Redmine #17459 (70f4a0e)
##### 2012-10-25 - Jeff McCune <jeff@puppetlabs.com> - 3.1.1
* (maint) Fix spec failures resulting from Facter API changes (97f836f)
##### 2012-10-23 - Matthaus Owens <matthaus@puppetlabs.com> - 3.1.0
* Add PE facts to stdlib (cdf3b05)
##### 2012-08-16 - Jeff McCune <jeff@puppetlabs.com> - 3.0.1
* Fix accidental removal of facts\_dot\_d.rb in 3.0.0 release
##### 2012-08-16 - Jeff McCune <jeff@puppetlabs.com> - 3.0.0
* stdlib 3.0 drops support with Puppet 2.6
* stdlib 3.0 preserves support with Puppet 2.7
##### 2012-08-07 - Dan Bode <dan@puppetlabs.com> - 3.0.0
* Add function ensure\_resource and defined\_with\_params (ba789de)
##### 2012-07-10 - Hailee Kenney <hailee@puppetlabs.com> - 3.0.0
* (#2157) Remove facter\_dot\_d for compatibility with external facts (f92574f)
##### 2012-04-10 - Chris Price <chris@puppetlabs.com> - 3.0.0
* (#13693) moving logic from local spec\_helper to puppetlabs\_spec\_helper (85f96df)
##### 2012-10-25 - Jeff McCune <jeff@puppetlabs.com> - 2.5.1
* (maint) Fix spec failures resulting from Facter API changes (97f836f)
##### 2012-10-23 - Matthaus Owens <matthaus@puppetlabs.com> - 2.5.0
* Add PE facts to stdlib (cdf3b05)
##### 2012-08-15 - Dan Bode <dan@puppetlabs.com> - 2.5.0
* Explicitly load functions used by ensure\_resource (9fc3063)
##### 2012-08-13 - Dan Bode <dan@puppetlabs.com> - 2.5.0
* Add better docs about duplicate resource failures (97d327a)
##### 2012-08-13 - Dan Bode <dan@puppetlabs.com> - 2.5.0
* Handle undef for parameter argument (4f8b133)
##### 2012-08-07 - Dan Bode <dan@puppetlabs.com> - 2.5.0
* Add function ensure\_resource and defined\_with\_params (a0cb8cd)
##### 2012-08-20 - Jeff McCune <jeff@puppetlabs.com> - 2.5.0
* Disable tests that fail on 2.6.x due to #15912 (c81496e)
##### 2012-08-20 - Jeff McCune <jeff@puppetlabs.com> - 2.5.0
* (Maint) Fix mis-use of rvalue functions as statements (4492913)
##### 2012-08-20 - Jeff McCune <jeff@puppetlabs.com> - 2.5.0
* Add .rspec file to repo root (88789e8)
##### 2012-06-07 - Chris Price <chris@puppetlabs.com> - 2.4.0
* Add support for a 'match' parameter to file\_line (a06c0d8)
##### 2012-08-07 - Erik Dalén <dalen@spotify.com> - 2.4.0
* (#15872) Add to\_bytes function (247b69c)
##### 2012-07-19 - Jeff McCune <jeff@puppetlabs.com> - 2.4.0
* (Maint) use PuppetlabsSpec::PuppetInternals.scope (master) (deafe88)
##### 2012-07-10 - Hailee Kenney <hailee@puppetlabs.com> - 2.4.0
* (#2157) Make facts\_dot\_d compatible with external facts (5fb0ddc)
##### 2012-03-16 - Steve Traylen <steve.traylen@cern.ch> - 2.4.0
* (#13205) Rotate array/string randomley based on fqdn, fqdn\_rotate() (fef247b)
##### 2012-05-22 - Peter Meier <peter.meier@immerda.ch> - 2.3.3
* fix regression in #11017 properly (f0a62c7)
##### 2012-05-10 - Jeff McCune <jeff@puppetlabs.com> - 2.3.3
* Fix spec tests using the new spec\_helper (7d34333)
##### 2012-05-10 - Puppet Labs <support@puppetlabs.com> - 2.3.2
* Make file\_line default to ensure => present (1373e70)
* Memoize file\_line spec instance variables (20aacc5)
* Fix spec tests using the new spec\_helper (1ebfa5d)
* (#13595) initialize\_everything\_for\_tests couples modules Puppet ver (3222f35)
* (#13439) Fix MRI 1.9 issue with spec\_helper (15c5fd1)
* (#13439) Fix test failures with Puppet 2.6.x (665610b)
* (#13439) refactor spec helper for compatibility with both puppet 2.7 and master (82194ca)
* (#13494) Specify the behavior of zero padded strings (61891bb)
##### 2012-03-29 Puppet Labs <support@puppetlabs.com> - 2.1.3
* (#11607) Add Rakefile to enable spec testing
* (#12377) Avoid infinite loop when retrying require json
##### 2012-03-13 Puppet Labs <support@puppetlabs.com> - 2.3.1
* (#13091) Fix LoadError bug with puppet apply and puppet\_vardir fact
##### 2012-03-12 Puppet Labs <support@puppetlabs.com> - 2.3.0
* Add a large number of new Puppet functions
* Backwards compatibility preserved with 2.2.x
##### 2011-12-30 Puppet Labs <support@puppetlabs.com> - 2.2.1
* Documentation only release for the Forge
##### 2011-12-30 Puppet Labs <support@puppetlabs.com> - 2.1.2
* Documentation only release for PE 2.0.x
##### 2011-11-08 Puppet Labs <support@puppetlabs.com> - 2.2.0
* #10285 - Refactor json to use pson instead.
* Maint - Add watchr autotest script
* Maint - Make rspec tests work with Puppet 2.6.4
* #9859 - Add root\_home fact and tests
##### 2011-08-18 Puppet Labs <support@puppetlabs.com> - 2.1.1
* Change facts.d paths to match Facter 2.0 paths.
* /etc/facter/facts.d
* /etc/puppetlabs/facter/facts.d
##### 2011-08-17 Puppet Labs <support@puppetlabs.com> - 2.1.0
* Add R.I. Pienaar's facts.d custom facter fact
* facts defined in /etc/facts.d and /etc/puppetlabs/facts.d are
automatically loaded now.
##### 2011-08-04 Puppet Labs <support@puppetlabs.com> - 2.0.0
* Rename whole\_line to file\_line
* This is an API change and as such motivating a 2.0.0 release according to semver.org.
##### 2011-08-04 Puppet Labs <support@puppetlabs.com> - 1.1.0
* Rename append\_line to whole\_line
* This is an API change and as such motivating a 1.1.0 release.
##### 2011-08-04 Puppet Labs <support@puppetlabs.com> - 1.0.0
* Initial stable release
* Add validate\_array and validate\_string functions
* Make merge() function work with Ruby 1.8.5
* Add hash merging function
* Add has\_key function
* Add loadyaml() function
* Add append\_line native
##### 2011-06-21 Jeff McCune <jeff@puppetlabs.com> - 0.1.7
* Add validate\_hash() and getvar() functions
##### 2011-06-15 Jeff McCune <jeff@puppetlabs.com> - 0.1.6
* Add anchor resource type to provide containment for composite classes
##### 2011-06-03 Jeff McCune <jeff@puppetlabs.com> - 0.1.5
* Add validate\_bool() function to stdlib
##### 0.1.4 2011-05-26 Jeff McCune <jeff@puppetlabs.com>
* Move most stages after main
##### 0.1.3 2011-05-25 Jeff McCune <jeff@puppetlabs.com>
* Add validate\_re() function
##### 0.1.2 2011-05-24 Jeff McCune <jeff@puppetlabs.com>
* Update to add annotated tag
##### 0.1.1 2011-05-24 Jeff McCune <jeff@puppetlabs.com>
* Add stdlib::stages class with a standard set of stages

View File

@@ -1,271 +0,0 @@
# Contributing to Puppet modules
So you want to contribute to a Puppet module: Great! Below are some instructions to get you started doing
that very thing while setting expectations around code quality as well as a few tips for making the
process as easy as possible.
### Table of Contents
1. [Getting Started](#getting-started)
1. [Commit Checklist](#commit-checklist)
1. [Submission](#submission)
1. [More about commits](#more-about-commits)
1. [Testing](#testing)
- [Running Tests](#running-tests)
- [Writing Tests](#writing-tests)
1. [Get Help](#get-help)
## Getting Started
- Fork the module repository on GitHub and clone to your workspace
- Make your changes!
## Commit Checklist
### The Basics
- [x] my commit is a single logical unit of work
- [x] I have checked for unnecessary whitespace with "git diff --check"
- [x] my commit does not include commented out code or unneeded files
### The Content
- [x] my commit includes tests for the bug I fixed or feature I added
- [x] my commit includes appropriate documentation changes if it is introducing a new feature or changing existing functionality
- [x] my code passes existing test suites
### The Commit Message
- [x] the first line of my commit message includes:
- [x] an issue number (if applicable), e.g. "(MODULES-xxxx) This is the first line"
- [x] a short description (50 characters is the soft limit, excluding ticket number(s))
- [x] the body of my commit message:
- [x] is meaningful
- [x] uses the imperative, present tense: "change", not "changed" or "changes"
- [x] includes motivation for the change, and contrasts its implementation with the previous behavior
## Submission
### Pre-requisites
- Make sure you have a [GitHub account](https://github.com/join)
- [Create a ticket](https://tickets.puppet.com/secure/CreateIssue!default.jspa), or [watch the ticket](https://tickets.puppet.com/browse/) you are patching for.
### Push and PR
- Push your changes to your fork
- [Open a Pull Request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) against the repository in the puppetlabs organization
## More about commits
1. Make separate commits for logically separate changes.
Please break your commits down into logically consistent units
which include new or changed tests relevant to the rest of the
change. The goal of doing this is to make the diff easier to
read for whoever is reviewing your code. In general, the easier
your diff is to read, the more likely someone will be happy to
review it and get it into the code base.
If you are going to refactor a piece of code, please do so as a
separate commit from your feature or bug fix changes.
We also really appreciate changes that include tests to make
sure the bug is not re-introduced, and that the feature is not
accidentally broken.
Describe the technical detail of the change(s). If your
description starts to get too long, that is a good sign that you
probably need to split up your commit into more finely grained
pieces.
Commits which plainly describe the things which help
reviewers check the patch and future developers understand the
code are much more likely to be merged in with a minimum of
bike-shedding or requested changes. Ideally, the commit message
would include information, and be in a form suitable for
inclusion in the release notes for the version of Puppet that
includes them.
Please also check that you are not introducing any trailing
whitespace or other "whitespace errors". You can do this by
running "git diff --check" on your changes before you commit.
2. Sending your patches
To submit your changes via a GitHub pull request, we _highly_
recommend that you have them on a topic branch, instead of
directly on "master".
It makes things much easier to keep track of, especially if
you decide to work on another thing before your first change
is merged in.
GitHub has some pretty good
[general documentation](http://help.github.com/) on using
their site. They also have documentation on
[creating pull requests](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).
In general, after pushing your topic branch up to your
repository on GitHub, you can switch to the branch in the
GitHub UI and click "Pull Request" towards the top of the page
in order to open a pull request.
3. Update the related JIRA issue.
If there is a JIRA issue associated with the change you
submitted, then you should update the ticket to include the
location of your branch, along with any other commentary you
may wish to make.
# Testing
## Getting Started
Our Puppet modules provide [`Gemfile`](./Gemfile)s, which can tell a Ruby package manager such as [bundler](http://bundler.io/) what Ruby packages,
or Gems, are required to build, develop, and test this software.
Please make sure you have [bundler installed](http://bundler.io/#getting-started) on your system, and then use it to
install all dependencies needed for this project in the project root by running
```shell
% bundle install --path .bundle/gems
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.1.0)
Using builder (3.2.2)
-- 8><-- many more --><8 --
Using rspec-system-puppet (2.2.0)
Using serverspec (0.6.3)
Using rspec-system-serverspec (1.0.0)
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
```
NOTE: some systems may require you to run this command with sudo.
If you already have those gems installed, make sure they are up-to-date:
```shell
% bundle update
```
## Running Tests
With all dependencies in place and up-to-date, run the tests:
### Unit Tests
```shell
% bundle exec rake spec
```
This executes all the [rspec tests](http://rspec-puppet.com/) in the directories defined [here](https://github.com/puppetlabs/puppetlabs_spec_helper/blob/699d9fbca1d2489bff1736bb254bb7b7edb32c74/lib/puppetlabs_spec_helper/rake_tasks.rb#L17) and so on.
rspec tests may have the same kind of dependencies as the module they are testing. Although the module defines these dependencies in its [metadata.json](./metadata.json),
rspec tests define them in [.fixtures.yml](./fixtures.yml).
### Acceptance Tests
Some Puppet modules also come with acceptance tests, which use [beaker][]. These tests spin up a virtual machine under
[VirtualBox](https://www.virtualbox.org/), controlled with [Vagrant](http://www.vagrantup.com/), to simulate scripted test
scenarios. In order to run these, you need both Virtualbox and Vagrant installed on your system.
Run the tests by issuing the following command
```shell
% bundle exec rake spec_clean
% bundle exec rspec spec/acceptance
```
This will now download a pre-fabricated image configured in the [default node-set](./spec/acceptance/nodesets/default.yml),
install Puppet, copy this module, and install its dependencies per [spec/spec_helper_acceptance.rb](./spec/spec_helper_acceptance.rb)
and then run all the tests under [spec/acceptance](./spec/acceptance).
## Writing Tests
### Unit Tests
When writing unit tests for Puppet, [rspec-puppet][] is your best friend. It provides tons of helper methods for testing your manifests against a
catalog (e.g. contain_file, contain_package, with_params, etc). It would be ridiculous to try and top rspec-puppet's [documentation][rspec-puppet_docs]
but here's a tiny sample:
Sample manifest:
```puppet
file { "a test file":
ensure => present,
path => "/etc/sample",
}
```
Sample test:
```ruby
it 'does a thing' do
expect(subject).to contain_file("a test file").with({:path => "/etc/sample"})
end
```
### Acceptance Tests
Writing acceptance tests for Puppet involves [beaker][] and its cousin [beaker-rspec][]. A common pattern for acceptance tests is to create a test manifest, apply it
twice to check for idempotency or errors, then run expectations.
```ruby
it 'does an end-to-end thing' do
pp = <<-EOF
file { 'a test file':
ensure => present,
path => "/etc/sample",
content => "test string",
}
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe file("/etc/sample") do
it { is_expected.to contain "test string" }
end
```
# If you have commit access to the repository
Even if you have commit access to the repository, you still need to go through the process above, and have someone else review and merge
in your changes. The rule is that **all changes must be reviewed by a project developer that did not write the code to ensure that
all changes go through a code review process.**
The record of someone performing the merge is the record that they performed the code review. Again, this should be someone other than the author of the topic branch.
# Get Help
### On the web
* [Puppet help messageboard](http://puppet.com/community/get-help)
* [Writing tests](https://docs.puppet.com/guides/module_guides/bgtm.html#step-three-module-testing)
* [General GitHub documentation](http://help.github.com/)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
### On chat
* Slack (slack.puppet.com) #forge-modules, #puppet-dev, #windows, #voxpupuli
* IRC (freenode) #puppet-dev, #voxpupuli
[rspec-puppet]: http://rspec-puppet.com/
[rspec-puppet_docs]: http://rspec-puppet.com/documentation/
[beaker]: https://github.com/puppetlabs/beaker
[beaker-rspec]: https://github.com/puppetlabs/beaker-rspec

View File

@@ -1,136 +0,0 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
def location_for(place_or_version, fake_version = nil)
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
else
[place_or_version, { require: false }]
end
end
def gem_type(place_or_version)
if place_or_version =~ %r{\Agit[:@]}
:git
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
:file
else
:gem
end
end
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')
group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-blacksmith", '~> 3.4', require: false
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.13')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
end
puppet_version = ENV['PUPPET_GEM_VERSION']
puppet_type = gem_type(puppet_version)
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']
def puppet_older_than?(version)
puppet_version = ENV['PUPPET_GEM_VERSION']
!puppet_version.nil? &&
Gem::Version.correct?(puppet_version) &&
Gem::Requirement.new("< #{version}").satisfied_by?(Gem::Version.new(puppet_version.dup))
end
gems = {}
gems['puppet'] = location_for(puppet_version)
# If facter or hiera versions have been specified via the environment
# variables, use those versions. If not, and if the puppet version is < 3.5.0,
# use known good versions of both for puppet < 3.5.0.
if facter_version
gems['facter'] = location_for(facter_version)
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
gems['facter'] = ['>= 1.6.11', '<= 1.7.5', require: false]
end
if hiera_version
gems['hiera'] = location_for(ENV['HIERA_GEM_VERSION'])
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
gems['hiera'] = ['>= 1.0.0', '<= 1.3.0', require: false]
end
if Gem.win_platform? && (puppet_type != :gem || puppet_older_than?('3.5.0'))
# For Puppet gems < 3.5.0 (tested as far back as 3.0.0) on Windows
if puppet_type == :gem
gems['ffi'] = ['1.9.0', require: false]
gems['minitar'] = ['0.5.4', require: false]
gems['win32-eventlog'] = ['0.5.3', '<= 0.6.5', require: false]
gems['win32-process'] = ['0.6.5', '<= 0.7.5', require: false]
gems['win32-security'] = ['~> 0.1.2', '<= 0.2.5', require: false]
gems['win32-service'] = ['0.7.2', '<= 0.8.8', require: false]
else
gems['ffi'] = ['~> 1.9.0', require: false]
gems['minitar'] = ['~> 0.5.4', require: false]
gems['win32-eventlog'] = ['~> 0.5', '<= 0.6.5', require: false]
gems['win32-process'] = ['~> 0.6', '<= 0.7.5', require: false]
gems['win32-security'] = ['~> 0.1', '<= 0.2.5', require: false]
gems['win32-service'] = ['~> 0.7', '<= 0.8.8', require: false]
end
gems['win32-dir'] = ['~> 0.3', '<= 0.4.9', require: false]
if RUBY_VERSION.start_with?('1.')
gems['win32console'] = ['1.3.2', require: false]
# sys-admin was removed in Puppet 3.7.0 and doesn't compile under Ruby 2.x
gems['sys-admin'] = ['1.5.6', require: false]
end
# Puppet < 3.7.0 requires these.
# Puppet >= 3.5.0 gem includes these as requirements.
# The following versions are tested to work with 3.0.0 <= puppet < 3.7.0.
gems['win32-api'] = ['1.4.8', require: false]
gems['win32-taskscheduler'] = ['0.2.2', require: false]
gems['windows-api'] = ['0.4.3', require: false]
gems['windows-pr'] = ['1.2.3', require: false]
elsif Gem.win_platform?
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
gems['win32-dir'] = ['<= 0.4.9', require: false]
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
gems['win32-process'] = ['<= 0.7.5', require: false]
gems['win32-security'] = ['<= 0.2.5', require: false]
gems['win32-service'] = ['<= 0.8.8', require: false]
end
gems.each do |gem_name, gem_params|
gem gem_name, *gem_params
end
# Evaluate Gemfile.local and ~/.gemfile if they exist
extra_gemfiles = [
"#{__FILE__}.local",
File.join(Dir.home, '.gemfile'),
]
extra_gemfiles.each do |gemfile|
if File.file?(gemfile) && File.readable?(gemfile)
eval(File.read(gemfile), binding)
end
end
# vim: syntax=ruby

View File

@@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

View File

@@ -1,6 +0,0 @@
## Maintenance
Maintainers:
- Puppet Forge Modules Team `forge-modules |at| puppet |dot| com`
Tickets: https://tickets.puppet.com/browse/MODULES. Make sure to set component to `stdlib`.

View File

@@ -1,23 +0,0 @@
stdlib puppet module
Copyright (C) 2011-2016 Puppet Labs, Inc.
and some parts:
Copyright (C) 2011 Krzysztof Wilczynski
Puppet Labs can be contacted at: info@puppetlabs.com
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.

File diff suppressed because it is too large Load Diff

View File

@@ -1,35 +0,0 @@
Puppet Specific Facts
=====================
Facter is meant to stand alone and apart from Puppet. However, Facter often
runs inside Puppet and all custom facts included in the stdlib module will
almost always be evaluated in the context of Puppet and Facter working
together.
Still, we don't want to write custom facts that blow up in the users face if
Puppet is not loaded in memory. This is often the case if the user runs
`facter` without also supplying the `--puppet` flag.
Ah! But Jeff, the custom fact won't be in the `$LOAD_PATH` unless the user
supplies `--facter`! You might say...
Not (always) true I say! If the user happens to have a CWD of
`<modulepath>/stdlib/lib` then the facts will automatically be evaluated and
blow up.
In any event, it's pretty easy to write a fact that has no value if Puppet is
not loaded. Simply do it like this:
Facter.add(:node_vardir) do
setcode do
# This will be nil if Puppet is not available.
Facter::Util::PuppetSettings.with_puppet do
Puppet[:vardir]
end
end
end
The `Facter::Util::PuppetSettings.with_puppet` method accepts a block and
yields to it only if the Puppet library is loaded. If the Puppet library is
not loaded, then the method silently returns `nil` which Facter interprets as
an undefined fact value. The net effect is that the fact won't be set.

View File

@@ -1,7 +0,0 @@
NOTE
====
This project's specs depend on puppet core, and thus they require the
`puppetlabs_spec_helper` project. For more information please see the README
in that project, which can be found here: [puppetlabs spec
helper](https://github.com/puppetlabs/puppetlabs_spec_helper)

View File

@@ -1,24 +0,0 @@
# Contributing to this module #
* Work in a topic branch
* Submit a github pull request
* Address any comments / feeback
* Merge into master using --no-ff
# Releasing this module #
* This module adheres to http://semver.org/
* Look for API breaking changes using git diff vX.Y.Z..master
* If no API breaking changes, the minor version may be bumped.
* If there are API breaking changes, the major version must be bumped.
* If there are only small minor changes, the patch version may be bumped.
* Update the CHANGELOG
* Update the Modulefile
* Commit these changes with a message along the lines of "Update CHANGELOG and
Modulefile for release"
* Create an annotated tag with git tag -a vX.Y.Z -m 'version X.Y.Z' (NOTE the
leading v as per semver.org)
* Push the tag with git push origin --tags
* Build a new package with puppet-module or the rake build task if it exists
* Publish the new package to the forge
* Bonus points for an announcement to puppet-users.

View File

@@ -1,4 +0,0 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'

View File

@@ -1,57 +0,0 @@
version: 1.1.x.{build}
skip_commits:
message: /^\(?doc\)?.*/
clone_depth: 10
init:
- SET
- 'mkdir C:\ProgramData\PuppetLabs\code && exit 0'
- 'mkdir C:\ProgramData\PuppetLabs\facter && exit 0'
- 'mkdir C:\ProgramData\PuppetLabs\hiera && exit 0'
- 'mkdir C:\ProgramData\PuppetLabs\puppet\var && exit 0'
environment:
matrix:
-
RUBY_VERSION: 24-x64
CHECK: syntax lint
-
RUBY_VERSION: 24-x64
CHECK: metadata_lint
-
RUBY_VERSION: 24-x64
CHECK: rubocop
-
PUPPET_GEM_VERSION: ~> 4.0
RUBY_VERSION: 21
CHECK: spec
-
PUPPET_GEM_VERSION: ~> 4.0
RUBY_VERSION: 21-x64
CHECK: spec
-
PUPPET_GEM_VERSION: ~> 5.0
RUBY_VERSION: 24
CHECK: spec
-
PUPPET_GEM_VERSION: ~> 5.0
RUBY_VERSION: 24-x64
CHECK: spec
matrix:
fast_finish: true
install:
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
- bundle install --jobs 4 --retry 2 --without system_tests
- type Gemfile.lock
build: off
test_script:
- bundle exec puppet -V
- ruby -v
- gem -v
- bundle -v
- bundle exec rake %CHECK%
notifications:
- provider: Email
to:
- nobody@nowhere.com
on_build_success: false
on_build_failure: false
on_build_status_changed: false

View File

@@ -1,566 +0,0 @@
{
"CHANGELOG.md": "e51208519c13999f1e9551090c0c4fc6",
"CONTRIBUTING.md": "4d17f3c942e7c93d1577cc4438a231e4",
"Gemfile": "47f2bb73e730d42a921e7bca4449f5aa",
"LICENSE": "3b83ef96387f14655fc854ddc3c6bd57",
"MAINTAINERS.md": "b40ec4f2c16145af6f723c2c34bb2ff9",
"NOTICE": "b2e552587e5969886fdd60481e8b0351",
"README.md": "f0861f0c9c5d5661ed690a9e99c43e3c",
"README_DEVELOPER.markdown": "220a8b28521b5c5d2ea87c4ddb511165",
"README_SPECS.markdown": "82bb4c6abbb711f40778b162ec0070c1",
"RELEASE_PROCESS.markdown": "94b92bc99ac4106ba1a74d5c04e520f9",
"Rakefile": "892f5f56e24ac668b998bb74fb18035e",
"appveyor.yml": "105dce352be3244a497e667f6b0403c7",
"examples/file_line.pp": "d8126b139dd1dce21ff26910d1c5a245",
"examples/has_interface_with.pp": "d69d520cf3ff4d0b495480afaca359ef",
"examples/has_ip_address.pp": "32f42575e49aa66f0f2398a70ae2a9f4",
"examples/has_ip_network.pp": "bfb8db068c58d77c4dd7ae9697536537",
"examples/init.pp": "b52fd907330ddbd9c3e070cf39f7b317",
"lib/facter/facter_dot_d.rb": "9f65108ecd7b8c5ce9c90ab4cd9d45be",
"lib/facter/package_provider.rb": "12d57e65f9b90c13e7808c347fbdc0b0",
"lib/facter/pe_version.rb": "245bb8ea121e8a55e1a38668cc480530",
"lib/facter/puppet_settings.rb": "d86bacf2b962a4744b701868cda31729",
"lib/facter/root_home.rb": "b384092f0470b9e2177edaf546de2ec1",
"lib/facter/service_provider.rb": "66cc42526eae631e306b397391f1f01c",
"lib/facter/util/puppet_settings.rb": "f69007bcc02031cd772fa7f2dffa3c0c",
"lib/puppet/functions/deprecation.rb": "705115a036e0235840db59cf9f4c17fe",
"lib/puppet/functions/fact.rb": "5879006198f1f4106acfe13422087d56",
"lib/puppet/functions/is_a.rb": "5a61d6a34ef45d7a5490455f334ef48a",
"lib/puppet/functions/is_absolute_path.rb": "0806756fc12b1fc752d1b54e81b15832",
"lib/puppet/functions/is_array.rb": "4d5c8d6af4e481ebb42f73b6504685c8",
"lib/puppet/functions/is_bool.rb": "9ae803c605c5ed057508c6501ef1a47f",
"lib/puppet/functions/is_float.rb": "ebe18dc0096233fcd555423761fc29f2",
"lib/puppet/functions/is_ip_address.rb": "ab9a1c6172db59cc15023f220853e2f2",
"lib/puppet/functions/is_ipv4_address.rb": "dec325b5911ce409b16c643697a13822",
"lib/puppet/functions/is_ipv6_address.rb": "f4864fee72c42bd3e40914768fb10f8e",
"lib/puppet/functions/is_numeric.rb": "970d785070eaa02bcac3e0589a8d5e7f",
"lib/puppet/functions/is_string.rb": "5aa459896fda1782f74752a1d324f048",
"lib/puppet/functions/length.rb": "3f6b0510bfe134241e4529d3f1a5318d",
"lib/puppet/functions/sprintf_hash.rb": "50fc7c6e57c098b7e6a594e1fd0d9904",
"lib/puppet/functions/to_json.rb": "bb6893a3e9eb6c48064c5a3c0bd4a41a",
"lib/puppet/functions/to_json_pretty.rb": "61ff20121b4c09987eadf3242b6231cf",
"lib/puppet/functions/to_yaml.rb": "0358dfd97b9a051e15046c6842b327be",
"lib/puppet/functions/type_of.rb": "4ee9c082047c08b8b1a82bc0bef8fd78",
"lib/puppet/functions/validate_absolute_path.rb": "556b0e3de450f03d724747d7d3825309",
"lib/puppet/functions/validate_array.rb": "efe329c6c8f65fce1ae2560fa5751530",
"lib/puppet/functions/validate_bool.rb": "5516a0f2efb48eeb4460fc713c6f9521",
"lib/puppet/functions/validate_hash.rb": "ce99bea6e1ee4da1a67b53b3ce06ce96",
"lib/puppet/functions/validate_integer.rb": "c028b299f194c221002ba442077e9209",
"lib/puppet/functions/validate_ip_address.rb": "278f3e0ea96b4b31e7b85c13887079b6",
"lib/puppet/functions/validate_ipv4_address.rb": "bd015492af1f3c4bef7ac780ae1c7e61",
"lib/puppet/functions/validate_ipv6_address.rb": "5144a327b6850ed5b7fb26fa37113353",
"lib/puppet/functions/validate_legacy.rb": "789bdef436873b6fcc8205c6d2270e43",
"lib/puppet/functions/validate_numeric.rb": "2bd2733f44749e0e56940ceaf5d8e2f8",
"lib/puppet/functions/validate_re.rb": "12c3412a7383b1d258dba5d4307e9464",
"lib/puppet/functions/validate_slength.rb": "1fc441736085bd0b5c7862f5dc9f839a",
"lib/puppet/functions/validate_string.rb": "c0fe867d3b5f8fbcaa3641f0f393a669",
"lib/puppet/parser/functions/abs.rb": "176df45128a7b89c9ec6a6c6918d8c30",
"lib/puppet/parser/functions/any2array.rb": "60cdb0bdfabff0115e74eda31c5c869b",
"lib/puppet/parser/functions/any2bool.rb": "4bafd2903a5e7992b4a8af476f05f46a",
"lib/puppet/parser/functions/assert_private.rb": "c61884d43ebdb5ee5a5aa1507165084a",
"lib/puppet/parser/functions/base64.rb": "6216cc60b71949724e21b0be4dbac316",
"lib/puppet/parser/functions/basename.rb": "6b0dc955024352c8007d175f900dba36",
"lib/puppet/parser/functions/bool2num.rb": "bfeeac22e909c76dc5a0d55441f39a27",
"lib/puppet/parser/functions/bool2str.rb": "e9e1c441e3b3c51b8b0734d12e9a63a5",
"lib/puppet/parser/functions/camelcase.rb": "13f3125b1bcb6ce7794385aea6cbc4c0",
"lib/puppet/parser/functions/capitalize.rb": "0a039c4bcd3a73dab80b389332457f0d",
"lib/puppet/parser/functions/ceiling.rb": "c4af0da229909c00b2adda7bdd3f0d93",
"lib/puppet/parser/functions/chomp.rb": "ebb5eb5e2020ec84c00477777f29b6bc",
"lib/puppet/parser/functions/chop.rb": "6a7d4154b326e84e478eb4a17aa55e74",
"lib/puppet/parser/functions/clamp.rb": "eeaed011946f4dec98870815e7c1657c",
"lib/puppet/parser/functions/concat.rb": "02a6ba0560a005b5f92aec096ce26e09",
"lib/puppet/parser/functions/convert_base.rb": "438da17946864b835e38155b8f72a184",
"lib/puppet/parser/functions/count.rb": "0241b1bd0bc8de6426b7d077a54f56fe",
"lib/puppet/parser/functions/deep_merge.rb": "fae771cff4fc1d6c639bea1672e05c9c",
"lib/puppet/parser/functions/defined_with_params.rb": "0e2a92b10efb6c502df6a52f35cf7983",
"lib/puppet/parser/functions/delete.rb": "ec0bb949e24d1b9ca6c749af0ab18de9",
"lib/puppet/parser/functions/delete_at.rb": "4a6bde67835592dafa48bca7bb8af939",
"lib/puppet/parser/functions/delete_regex.rb": "ee86f13f796e61e41c62ee91f8349735",
"lib/puppet/parser/functions/delete_undef_values.rb": "247a52c41dc02375b50ac3c1791f4c09",
"lib/puppet/parser/functions/delete_values.rb": "0a979383ac73e1bf82278e0eb104842c",
"lib/puppet/parser/functions/deprecation.rb": "9f935fec2f9f0d01394292eb6f21bd7d",
"lib/puppet/parser/functions/difference.rb": "e3d3006b7f50fc0fad1616ec53f21614",
"lib/puppet/parser/functions/dig.rb": "d315de1659a037430fea9623bff323a6",
"lib/puppet/parser/functions/dig44.rb": "2317ddee7dbda385e2f964655fe6ad88",
"lib/puppet/parser/functions/dirname.rb": "240597e264df02effa454cf9cb8bb9e7",
"lib/puppet/parser/functions/dos2unix.rb": "ab2f9f280c616be55f58903948e226a2",
"lib/puppet/parser/functions/downcase.rb": "3e6b908548607a55ee426e8be16fb46c",
"lib/puppet/parser/functions/empty.rb": "f9dcb1b4cb0abb671294d5283e673ee5",
"lib/puppet/parser/functions/enclose_ipv6.rb": "89c728eb11f71ed9390664bad9732328",
"lib/puppet/parser/functions/ensure_packages.rb": "a0b4bdc14613d4b8c396b4e02a1aa33d",
"lib/puppet/parser/functions/ensure_resource.rb": "2915c77baa0d45531912613dd1cac902",
"lib/puppet/parser/functions/ensure_resources.rb": "805d56e894c9dcca2595464fa87a7c56",
"lib/puppet/parser/functions/flatten.rb": "54fd2d9d7bc7cd4f9889554da6094dd8",
"lib/puppet/parser/functions/floor.rb": "f0a70977110525dc4aa6b109db9ff9e4",
"lib/puppet/parser/functions/fqdn_rand_string.rb": "731365381b6a28a196e108329e16c6c2",
"lib/puppet/parser/functions/fqdn_rotate.rb": "3925369078084f98f9b527d25cc9e4d2",
"lib/puppet/parser/functions/fqdn_uuid.rb": "adbd60dbcc561c8586567a6e58abec82",
"lib/puppet/parser/functions/get_module_path.rb": "e141ce049d4ace6d12b50d6b171b029c",
"lib/puppet/parser/functions/getparam.rb": "84c7358b24f0a5e45c1ad523c196817e",
"lib/puppet/parser/functions/getvar.rb": "835e6b79e209a541e125cdaddefb3396",
"lib/puppet/parser/functions/glob.rb": "f8177554be6da357b0822edaa7eb8d14",
"lib/puppet/parser/functions/grep.rb": "b2e7e32188a1cb4f1dafa375ba9b8b14",
"lib/puppet/parser/functions/has_interface_with.rb": "422015811c5b7c0656b83eaea3b8fdcc",
"lib/puppet/parser/functions/has_ip_address.rb": "fc76c9a87145560f58a4ae9a6d9df444",
"lib/puppet/parser/functions/has_ip_network.rb": "b1bb1868e6fef95f8ae840d420ab0816",
"lib/puppet/parser/functions/has_key.rb": "572f8a648c74c0b774718991a88adc56",
"lib/puppet/parser/functions/hash.rb": "5730e6a297b9064c12d3484a2ae31010",
"lib/puppet/parser/functions/intersection.rb": "6436444eb8585ee71cfd5bd1e0802026",
"lib/puppet/parser/functions/is_absolute_path.rb": "268600b66670a29690be009d45013d42",
"lib/puppet/parser/functions/is_array.rb": "0e425e55c8ce9cc5e327d53d114391ba",
"lib/puppet/parser/functions/is_bool.rb": "4e021a5143c2c98b31344acceda5fbe2",
"lib/puppet/parser/functions/is_domain_name.rb": "1abf04d1d57de6f7f630045c0efe5e4c",
"lib/puppet/parser/functions/is_email_address.rb": "d11c644fa1bd73f8e1d36c4f9e67272e",
"lib/puppet/parser/functions/is_float.rb": "b95a00f15242e3f26a5cf129db7d31e5",
"lib/puppet/parser/functions/is_function_available.rb": "3bb60da5789493da017f84d48ac46f08",
"lib/puppet/parser/functions/is_hash.rb": "3f74a7e9b6e47b834c4ad58939c27eab",
"lib/puppet/parser/functions/is_integer.rb": "e3480725fccac1c7eba28162dc62393d",
"lib/puppet/parser/functions/is_ip_address.rb": "3616dacf58febcd4944945d3c2647efe",
"lib/puppet/parser/functions/is_ipv4_address.rb": "7930d25d23d92f0e5cb81f93315cea16",
"lib/puppet/parser/functions/is_ipv6_address.rb": "c206564af3a738e504afca2284497d3c",
"lib/puppet/parser/functions/is_mac_address.rb": "b75e440d5594b879b70cf034fc52cd51",
"lib/puppet/parser/functions/is_numeric.rb": "4bd1a47192ce4040810819789fbf3147",
"lib/puppet/parser/functions/is_string.rb": "cf06fecd6147bea77d406a189b649f81",
"lib/puppet/parser/functions/join.rb": "aed0b418cc216d86f3beaa5f2302279b",
"lib/puppet/parser/functions/join_keys_to_values.rb": "5ad99136e59a68064c24dd2933727c57",
"lib/puppet/parser/functions/keys.rb": "d65816215c6c7736bcfe393e7d9d3bf4",
"lib/puppet/parser/functions/load_module_metadata.rb": "4972bafc84e5b7ce4a00cbee21aece18",
"lib/puppet/parser/functions/loadjson.rb": "b6e43c28dee4a74a7312af41393d09de",
"lib/puppet/parser/functions/loadyaml.rb": "9066804fd56894210d4d064aab9df406",
"lib/puppet/parser/functions/lstrip.rb": "de231169f63d922b72b754521488bca5",
"lib/puppet/parser/functions/max.rb": "3406e6e1da36ed126ca7a359dbbcbb23",
"lib/puppet/parser/functions/member.rb": "4f8639d96fbd17cd194224794dd9f279",
"lib/puppet/parser/functions/merge.rb": "e867f9f9340d7bf5b85141d2f7ec2392",
"lib/puppet/parser/functions/min.rb": "6243d16650b1787f017f587b5be276f3",
"lib/puppet/parser/functions/num2bool.rb": "35f42a4339b34d0b1efc6a6c3b2d3b69",
"lib/puppet/parser/functions/parsejson.rb": "fee0dc33cd6e18b0d9a5fe8befb66cd2",
"lib/puppet/parser/functions/parseyaml.rb": "f4b67d011970c1799bc6fb36a3caf1f2",
"lib/puppet/parser/functions/pick.rb": "4a4ba9288a233a4bcdbdc59ecac80be0",
"lib/puppet/parser/functions/pick_default.rb": "6b0ccac1913a85e540a3de20c6a88096",
"lib/puppet/parser/functions/prefix.rb": "3d268ec646255199ade4b01b719a59ed",
"lib/puppet/parser/functions/private.rb": "a1f44a1c32da00aa14f474f4f303be87",
"lib/puppet/parser/functions/pry.rb": "970544bf6308b7b6902b936063a45109",
"lib/puppet/parser/functions/pw_hash.rb": "07fea662493e5b2ffcf37dbb4c4e74b9",
"lib/puppet/parser/functions/range.rb": "60d786031129d4a495a67468d4b5219d",
"lib/puppet/parser/functions/regexpescape.rb": "d7d22f987d616f2b5ec9d967f1528f53",
"lib/puppet/parser/functions/reject.rb": "31f5f65be6f710d6856ffce75c432271",
"lib/puppet/parser/functions/reverse.rb": "3f96ffed2afe4987da5039de2d56f38b",
"lib/puppet/parser/functions/round.rb": "287db8b83f3bc6652eb042682f8be698",
"lib/puppet/parser/functions/rstrip.rb": "5042d02e81ac59068d87a2b54c784cce",
"lib/puppet/parser/functions/seeded_rand.rb": "4f45ef0723411ff8281aaf093f0fabc2",
"lib/puppet/parser/functions/shell_escape.rb": "6e51793b8483eb6bfc4be98b438fd47e",
"lib/puppet/parser/functions/shell_join.rb": "4fbe23ff73932f65db696f106517887e",
"lib/puppet/parser/functions/shell_split.rb": "cb851119ee167ccb12930c53e94333cc",
"lib/puppet/parser/functions/shuffle.rb": "6b16497151e961fbdb6e00ec70d6bbe9",
"lib/puppet/parser/functions/size.rb": "05cbf180420e3a3e2e5aa5be157c6951",
"lib/puppet/parser/functions/sort.rb": "20fa47c2ccde4b37626e8d3995503f02",
"lib/puppet/parser/functions/squeeze.rb": "e42e1d5ec9a23443d14ff07512fd695f",
"lib/puppet/parser/functions/str2bool.rb": "b82d971cc305a19b26089cc4fd566eb0",
"lib/puppet/parser/functions/str2saltedsha512.rb": "d4443e8985b4ce6f6e925c6f46d8456c",
"lib/puppet/parser/functions/strftime.rb": "62b13548cc3b28b1609b7b4bd966f666",
"lib/puppet/parser/functions/strip.rb": "ec030431f8ec17e285f18a6f60b7f269",
"lib/puppet/parser/functions/suffix.rb": "4eff1920b75829e32fb2c2ee4aab8a24",
"lib/puppet/parser/functions/swapcase.rb": "d1a53787b35ae9a5a643c49f4e0975a8",
"lib/puppet/parser/functions/time.rb": "cd31abf40b4e4e22b9de8b6b27ec1a50",
"lib/puppet/parser/functions/to_bytes.rb": "55a65ad70ea78983e7c1d6d565094c1f",
"lib/puppet/parser/functions/try_get_value.rb": "b039b960b07a21b935baf6c78fb94612",
"lib/puppet/parser/functions/type.rb": "857348edb913cdc4f25b2169994984cf",
"lib/puppet/parser/functions/type3x.rb": "22c902213365c39919625d1a33d5abff",
"lib/puppet/parser/functions/union.rb": "690e5c15a1e7b95ab4b90ee18eb48f81",
"lib/puppet/parser/functions/unique.rb": "e448da2c183c0e19bd6e64bc423a749f",
"lib/puppet/parser/functions/unix2dos.rb": "0aa6e66d1c47ca0bb417e248b01f6f1b",
"lib/puppet/parser/functions/upcase.rb": "b0ed0e1ada21b9d73a00043146254335",
"lib/puppet/parser/functions/uriescape.rb": "f2facfe201658a65a7e81199cdd1bef7",
"lib/puppet/parser/functions/validate_absolute_path.rb": "892faf0e74b99b11190ec7fc4b78a893",
"lib/puppet/parser/functions/validate_array.rb": "9518be91bab77e56be711d1498d119b9",
"lib/puppet/parser/functions/validate_augeas.rb": "c5bbf1bc42b7ea024e48ab12b46f55e9",
"lib/puppet/parser/functions/validate_bool.rb": "bea67f1a0f5fc23ee8b632000cfa63db",
"lib/puppet/parser/functions/validate_cmd.rb": "dbb22e68eca3f6be63fb49b465b1d611",
"lib/puppet/parser/functions/validate_domain_name.rb": "04f4b1d0be9a8a12d278f0b044f78427",
"lib/puppet/parser/functions/validate_email_address.rb": "6dc01f14c43fdff19106a2388d01b51a",
"lib/puppet/parser/functions/validate_hash.rb": "80f7cfb430818e1497d3b12769d8f9c4",
"lib/puppet/parser/functions/validate_integer.rb": "edb176a717c4af6cd50d2d26e4da149d",
"lib/puppet/parser/functions/validate_ip_address.rb": "55d0f019803d687bf95bcc64e8751ba5",
"lib/puppet/parser/functions/validate_ipv4_address.rb": "94843b876cc92414b29223f7ac3cc3b6",
"lib/puppet/parser/functions/validate_ipv6_address.rb": "6c10396f466f64a6f897d1be4291dd4a",
"lib/puppet/parser/functions/validate_numeric.rb": "092cce5ed9d3a73319c48cdf9a2a822e",
"lib/puppet/parser/functions/validate_re.rb": "df6a2cc342dad63d008ef257fde9038a",
"lib/puppet/parser/functions/validate_slength.rb": "b20959e080f36bf320eacb472d125741",
"lib/puppet/parser/functions/validate_string.rb": "0239e1697134605a6385ff8c9bdc066b",
"lib/puppet/parser/functions/validate_x509_rsa_key_pair.rb": "b16e5ebaeb497e1639c7bf78d61c2b45",
"lib/puppet/parser/functions/values.rb": "94ac0ce49d09256677f6adddd40be129",
"lib/puppet/parser/functions/values_at.rb": "72d780badb5f600dbd6b9ca3271ee12f",
"lib/puppet/parser/functions/zip.rb": "aef1ee868716d07b01e605ae6c4741cc",
"lib/puppet/provider/file_line/ruby.rb": "06dd4b2bd0037fcdc8382fcd4214dda3",
"lib/puppet/type/anchor.rb": "95867e600863019b08990277c4254cac",
"lib/puppet/type/file_line.rb": "208655541a332e54e2d9abac0e328d33",
"locales/config.yaml": "d3795b3334faf13674a5d1e3759064ac",
"locales/ja/puppetlabs-stdlib.po": "805e5d893d2025ad57da8ec0614a6753",
"locales/puppetlabs-stdlib.pot": "23c892ac0683aef4b09aabe0037750ae",
"manifests/init.pp": "9560a09f657d7eebbfdb920cefcc1d4f",
"manifests/stages.pp": "72eb4fa624474faf23b39e57cf1590bd",
"metadata.json": "39391b92fcbbb4effff543a25abe371d",
"readmes/README_ja_JP.md": "eb710c5546a02051a8a4b5b182bde556",
"spec/acceptance/abs_spec.rb": "68e49c791f4f356278d5fae34b3cd9bf",
"spec/acceptance/anchor_spec.rb": "96b18124a8bd485928ef49ac82072789",
"spec/acceptance/any2array_spec.rb": "8071bc5d9616d73d29c252ca3f919300",
"spec/acceptance/base64_spec.rb": "817503716d7df9052ca3730a8d3fa1f5",
"spec/acceptance/bool2num_spec.rb": "b98e3dcca524e9ac2cc08979a566841d",
"spec/acceptance/build_csv.rb": "0d4e10040cb934a78c523bebda8a2362",
"spec/acceptance/capitalize_spec.rb": "8fb00604f391cb13c85e6e852b404697",
"spec/acceptance/ceiling_spec.rb": "b1cfdae5039f6e40be8c81d5bc70f88c",
"spec/acceptance/chomp_spec.rb": "b51f86c2957f9882609d3c5b0eac67df",
"spec/acceptance/chop_spec.rb": "f097d03666e000251f567ff90fec2cfe",
"spec/acceptance/clamp_spec.rb": "35aa8410bbd283546b3325c90c394521",
"spec/acceptance/concat_spec.rb": "0432bcd648b43d2b9fe539543cddfadd",
"spec/acceptance/count_spec.rb": "67c9f9083e980ab397b3d259367ac201",
"spec/acceptance/deep_merge_spec.rb": "a29b282369d829b04784c2b7035a66b0",
"spec/acceptance/defined_with_params_spec.rb": "0563530340cb2f802fb44e9840236037",
"spec/acceptance/delete_at_spec.rb": "a6bae7649fcfe02eaf58660a81660a9d",
"spec/acceptance/delete_spec.rb": "69ff71ade09add15063a1375b49d7ad9",
"spec/acceptance/delete_undef_values_spec.rb": "258ca3da1b06afc1e6d8588eed92e8f2",
"spec/acceptance/delete_values_spec.rb": "3a15a34628df45f6a2f25ebf14e3e4f1",
"spec/acceptance/deprecation_spec.rb": "3298d3fc62c4f18211add9ed273df85f",
"spec/acceptance/difference_spec.rb": "e6a0ebbdfffcd374520d40fce11d957b",
"spec/acceptance/dirname_spec.rb": "84cad3f9b2bb6d7e36fbf8b8df1be77b",
"spec/acceptance/downcase_spec.rb": "4b03b9a33254f5df52a76aa40a2143e5",
"spec/acceptance/empty_spec.rb": "b89067b0975336683a38bf20a6a1f036",
"spec/acceptance/ensure_resource_spec.rb": "d09c350ba1d0bf7ff14bacf4f1c8e487",
"spec/acceptance/flatten_spec.rb": "54da51ee7665de8b56252d20215a3c30",
"spec/acceptance/floor_spec.rb": "061f23967d177a6d7d728f59398ff088",
"spec/acceptance/fqdn_rand_string_spec.rb": "33d5fa38b5f880157ea69dd25a12a332",
"spec/acceptance/fqdn_rotate_spec.rb": "c280ce28ba57b9d67a3e3b1a0c14f342",
"spec/acceptance/get_module_path_spec.rb": "cb34a578c336f8572835520425878d5d",
"spec/acceptance/getparam_spec.rb": "eaa6149d19c6082d7d6cb7f81c1aa342",
"spec/acceptance/getvar_spec.rb": "afe43ffe3e071e0c1d18b679f714fdfc",
"spec/acceptance/grep_spec.rb": "b74c67c94d39a49e9ee395a6c5fc9c9d",
"spec/acceptance/has_interface_with_spec.rb": "36e2cc57fb3f9044e2b93fa98eb436ab",
"spec/acceptance/has_ip_address_spec.rb": "da00303c038e758115e96a0fb65ab9c5",
"spec/acceptance/has_ip_network_spec.rb": "c4991bb6905d4aeba6bab1c9f7cc3fa5",
"spec/acceptance/has_key_spec.rb": "d4eb28efd599e1eac485bf9f6ca930d3",
"spec/acceptance/hash_spec.rb": "0736319571163989e4df71dcff017fd1",
"spec/acceptance/intersection_spec.rb": "8bd80ad4ebf9627add63f257bf0674e4",
"spec/acceptance/is_a_spec.rb": "ecca7dbb41739ebffcefccc2cb85722d",
"spec/acceptance/is_array_spec.rb": "b5baf237a47ace8d53c3748c3432f226",
"spec/acceptance/is_bool_spec.rb": "fa53d0fc3486fc6473184105fad31f2e",
"spec/acceptance/is_domain_name_spec.rb": "963998fd1d72750dd800c8227fa9354c",
"spec/acceptance/is_float_spec.rb": "4f4d179d4e4ca3b6f38ccca6bb855a3f",
"spec/acceptance/is_function_available_spec.rb": "83bb5c733cf1dd2c15fa2f3add9ce61e",
"spec/acceptance/is_hash_spec.rb": "2bfe3af74c15731b2ab251bbaf386245",
"spec/acceptance/is_integer_spec.rb": "f68672a767a6216e3502fc08e61f4a01",
"spec/acceptance/is_ip_address_spec.rb": "680bcb2199c16d346a65c29c6042148c",
"spec/acceptance/is_ipv4_address_spec.rb": "5bbb9b312267da1a2124558867d0cec3",
"spec/acceptance/is_ipv6_address_spec.rb": "05e45351f00b3c4fbfc7ec78bb9f93c6",
"spec/acceptance/is_mac_address_spec.rb": "1971ab98b688992efadf80bd6ff5aedd",
"spec/acceptance/is_numeric_spec.rb": "a4b6c6d0b4570672f4cf8ecea3324d9f",
"spec/acceptance/is_string_spec.rb": "1faf6b5fc01a5924077449b3ecf22cbb",
"spec/acceptance/join_keys_to_values_spec.rb": "d8e6a7575e96e33e44ded6c1ef4d329c",
"spec/acceptance/join_spec.rb": "a0db319d437e05e97608cea0525d11e2",
"spec/acceptance/keys_spec.rb": "5712c1b5fdbb268369923d4f3a7e4a5c",
"spec/acceptance/loadjson_spec.rb": "c4a2bebd9648f8843cd394fc78691cb7",
"spec/acceptance/loadyaml_spec.rb": "641cee5b4c85bb01033c75bc5cc9678e",
"spec/acceptance/lstrip_spec.rb": "61355ba1f6b55cab4f75d9089509d963",
"spec/acceptance/max_spec.rb": "fd10617940c2e30cc102aa090f69ae6e",
"spec/acceptance/member_spec.rb": "92facc113e77834516361f7e91a6b07a",
"spec/acceptance/merge_spec.rb": "a2d398f1b407736d576a01a350a7b378",
"spec/acceptance/min_spec.rb": "b90fc74f13e90099e588b8de39bff084",
"spec/acceptance/nodesets/centos-7-x64.yml": "a713f3abd3657f0ae2878829badd23cd",
"spec/acceptance/nodesets/debian-8-x64.yml": "d2d2977900989f30086ad251a14a1f39",
"spec/acceptance/nodesets/default.yml": "b42da5a1ea0c964567ba7495574b8808",
"spec/acceptance/nodesets/docker/centos-7.yml": "8a3892807bdd62306ae4774f41ba11ae",
"spec/acceptance/nodesets/docker/debian-8.yml": "ac8e871d1068c96de5e85a89daaec6df",
"spec/acceptance/nodesets/docker/ubuntu-14.04.yml": "dc42ee922a96908d85b8f0f08203ce58",
"spec/acceptance/num2bool_spec.rb": "a1c7ae1ae573238474264f512ceac029",
"spec/acceptance/parsejson_spec.rb": "703943409a4942e143a9ee64428137d2",
"spec/acceptance/parseyaml_spec.rb": "4c423fec2126c06d73b680ccedb2d92a",
"spec/acceptance/pick_default_spec.rb": "74ef7cc0cff5613e2f5bb51860cc78f5",
"spec/acceptance/pick_spec.rb": "883435ee18338b44d8a809df948f013a",
"spec/acceptance/prefix_spec.rb": "6e3763b5c18208441b21d2f6eae24339",
"spec/acceptance/pw_hash_spec.rb": "ec6cc8b96fed721a5fd1053015827070",
"spec/acceptance/range_spec.rb": "d875cff37547b97946bebb726918c9d6",
"spec/acceptance/reject_spec.rb": "844ab5a15688cf0d4777f78f1ba94513",
"spec/acceptance/reverse_spec.rb": "3b1bb403962eedbdbc86f02c396bada0",
"spec/acceptance/rstrip_spec.rb": "85a3ba1c3ab9e0fd69c8676de1ff204b",
"spec/acceptance/shuffle_spec.rb": "c3541f8e2612d38aa11cb848ba5c2fd6",
"spec/acceptance/size_spec.rb": "07d3e1cf5e2e8205e8aeb075d65701b7",
"spec/acceptance/sort_spec.rb": "2985f4f244a826ef324fcd327899522f",
"spec/acceptance/squeeze_spec.rb": "1f6dd45cab59278b021a3c8ee931a988",
"spec/acceptance/str2bool_spec.rb": "875a523687b93ab94169ca06b02d8fc2",
"spec/acceptance/str2saltedsha512_spec.rb": "d7552194362956fd86e7be11c49d75e9",
"spec/acceptance/strftime_spec.rb": "d7d83f31a8b6968d7e49ed137939b03f",
"spec/acceptance/strip_spec.rb": "86a4ceaa1d46de1686cf457e7841e591",
"spec/acceptance/suffix_spec.rb": "3fc89836a92965f8093187554099bc5a",
"spec/acceptance/swapcase_spec.rb": "9b90e7d7d441e998a7946fb33a7d9edd",
"spec/acceptance/time_spec.rb": "b262929e40fb53bbaabca8fda696c5b3",
"spec/acceptance/to_bytes_spec.rb": "0907f39eb1815eb766e18d458a44a967",
"spec/acceptance/try_get_value_spec.rb": "2dfffd91ac418d5429b32ddb4cdb236c",
"spec/acceptance/type3x_spec.rb": "fa30d2d82906b774d69109ad08f963b4",
"spec/acceptance/type_spec.rb": "1d55a0ad8635c239a33a1d107bda5404",
"spec/acceptance/union_spec.rb": "7fc2a6f6b6c4c2abb625926cd9013cca",
"spec/acceptance/unique_spec.rb": "66bf8230e4a8a9ae15a8d2850ceb281b",
"spec/acceptance/upcase_spec.rb": "90b5ef5ac39f4748306869bf83031d1f",
"spec/acceptance/uriescape_spec.rb": "29ce7eea67a8b400c2f2f6d9e63390f6",
"spec/acceptance/validate_absolute_path_spec.rb": "56bcca87397652e38f56c84f3c4865ed",
"spec/acceptance/validate_array_spec.rb": "50273b0f02c5c45d52386d501f025712",
"spec/acceptance/validate_augeas_spec.rb": "006d3658397e85dd497d7c612cbb3ae5",
"spec/acceptance/validate_bool_spec.rb": "448cc97e9b277cea82a6aa15cb40cc88",
"spec/acceptance/validate_cmd_spec.rb": "c42681ac8aed0ca83577c0205fec6aa9",
"spec/acceptance/validate_hash_spec.rb": "e0c2114c7c365a90230335a2e8d9d817",
"spec/acceptance/validate_ipv4_address_spec.rb": "233a114fc42a9a138902531d8b5b2b50",
"spec/acceptance/validate_ipv6_address_spec.rb": "215aed228a0c626ee321212534b31264",
"spec/acceptance/validate_re_spec.rb": "10eb1f29d0cd62dfafef9f99939cbc81",
"spec/acceptance/validate_slength_spec.rb": "6c82dcb830e1d2cf66b60c425e5aa27b",
"spec/acceptance/validate_string_spec.rb": "3e4d023775e7b11de5d1deabf4bb4e39",
"spec/acceptance/values_at_spec.rb": "25ab415d4a3b2bbbf225f1e3410978dc",
"spec/acceptance/values_spec.rb": "7cd9f430afad102cae1feb5d4a6cc743",
"spec/acceptance/zip_spec.rb": "fc7b9e42b408d0fe2171b4eabfcfd585",
"spec/fixtures/dscacheutil/root": "e1a7622f55f3d1be258c9a5b16b474be",
"spec/fixtures/lsuser/root": "2ed657fa157372a81634539bb1a56be8",
"spec/fixtures/test/manifests/base32.pp": "2662eb916f3830689f40decfe8fddae8",
"spec/fixtures/test/manifests/base64.pp": "935f9c1b4ac741c58b7abd49d3cfb794",
"spec/fixtures/test/manifests/deftype.pp": "1f2e86fa39604fdfde8fd20b9ae92813",
"spec/fixtures/test/manifests/ensure_resources.pp": "898c473ba5641313294827f4b4845bd6",
"spec/functions/abs_spec.rb": "eb9982a88e173ed84926afbbda41452e",
"spec/functions/any2array_spec.rb": "3ada6ddbda41b8681ba4b924ce81d422",
"spec/functions/any2bool_spec.rb": "903aacf741bdf4f7049cd4ee1d34d673",
"spec/functions/assert_private_spec.rb": "c4f0ced23534a74d6478fbd7477003e7",
"spec/functions/base64_spec.rb": "5083c40b825f86863cc2950d97d3807b",
"spec/functions/basename_spec.rb": "beeae06a6fc449d44352031e4a61e900",
"spec/functions/bool2num_spec.rb": "bb82d4eed099e97c5af545cdce3445d6",
"spec/functions/bool2str_spec.rb": "286b56a5bab37d4849e10b7f0f9630ed",
"spec/functions/camelcase_spec.rb": "1d9ae972915a1c45c8093eda7ea8a1fe",
"spec/functions/capitalize_spec.rb": "8d7ed6e2c3a338b17a09e6c891c1215c",
"spec/functions/ceiling_spec.rb": "dbda35bf0b2aaffb87ba533454004569",
"spec/functions/chomp_spec.rb": "5883602173019b8237aed1624bd40170",
"spec/functions/chop_spec.rb": "3e293af75bdc7f72655eadcd9920c95f",
"spec/functions/clamp_spec.rb": "8094bc19ff0fe82dfd0a072b654bf318",
"spec/functions/concat_spec.rb": "d103f894bdb4a2054b17cb0185a033a1",
"spec/functions/convert_base_spec.rb": "534bd90106b2c58f736b897974c5a10a",
"spec/functions/count_spec.rb": "55a6ead532b31f2ccfcc7fb7126e34d7",
"spec/functions/deep_merge_spec.rb": "134d802b7d39e6523e3a622d2718ec12",
"spec/functions/defined_with_params_spec.rb": "b24e3fd629b4d52f1abd1b13f715a9a7",
"spec/functions/delete_at_spec.rb": "2a373b50759ef60b3abc569bca50537c",
"spec/functions/delete_regex_spec.rb": "5b6cf5e6d94da0d00fd612f4558fc426",
"spec/functions/delete_spec.rb": "0cee161af26c8dc4165bf0cfea09ce85",
"spec/functions/delete_undef_values_spec.rb": "00ca6e3d2c838b6b12263268c698e0ce",
"spec/functions/delete_values_spec.rb": "41003ea949782329513763df34861264",
"spec/functions/deprecation_spec.rb": "58094a18d86c44c6caf4cf29863880aa",
"spec/functions/difference_spec.rb": "bb86ac651f85148184a04248e21b3073",
"spec/functions/dig44_spec.rb": "1d8a681607f745e41499ce87d6ef00f0",
"spec/functions/dig_spec.rb": "74f65f4c4f237d9bc122abf5fd862b6b",
"spec/functions/dirname_spec.rb": "39b1fbb7cfd05881e21beaf81b667ec4",
"spec/functions/dos2unix_spec.rb": "f7f10a39d4d4d42bef7a1bc99d97ea1c",
"spec/functions/downcase_spec.rb": "2a5970a27352ebee3bae7b28bb4edacb",
"spec/functions/empty_spec.rb": "5b10598d2782eb25b10e4dd9e186aca0",
"spec/functions/ensure_packages_spec.rb": "c19f725196a6aee508c25c9c0e1468f4",
"spec/functions/ensure_resource_spec.rb": "de9dc96ceefe684e7c785f385136b44a",
"spec/functions/ensure_resources_spec.rb": "d8e93e55de05ddb1fce5c242ab21b0a7",
"spec/functions/flatten_spec.rb": "8e5fc1ec2c63778e41fda8a86603826b",
"spec/functions/floor_spec.rb": "68fdcf9ab8596a83ee00b83e52b2889b",
"spec/functions/fqdn_rand_string_spec.rb": "136cf6e77e02b42d79c0e5766779d5d4",
"spec/functions/fqdn_rotate_spec.rb": "792ada483512e4d60a3937fd1c8f788f",
"spec/functions/fqdn_uuid_spec.rb": "60526a453f556867b369496ca1215a86",
"spec/functions/get_module_path_spec.rb": "7c3aa0236a71a77e12698ef7988bec38",
"spec/functions/getparam_spec.rb": "807694642f3ebdfafca4c8f0eca4c062",
"spec/functions/getvar_spec.rb": "327fc59ca02525d9a6d266957461c32f",
"spec/functions/glob_spec.rb": "537139a45aa1acfb605aa0cb6b598b73",
"spec/functions/grep_spec.rb": "c79409710df9272306ac1211668dd85f",
"spec/functions/has_interface_with_spec.rb": "d484da75727170eb3ff22bbc71394fd1",
"spec/functions/has_ip_address_spec.rb": "811d63a9c87a1de43a18d07c8ee5a796",
"spec/functions/has_ip_network_spec.rb": "9ec0c0c607a60d2dde3a66fc969e4478",
"spec/functions/has_key_spec.rb": "d4d97da7d35a794e72d1bbc5e0a4838f",
"spec/functions/hash_spec.rb": "cd394a2a67891c1b8d8666d71ee8ede2",
"spec/functions/intersection_spec.rb": "be5f4ab66e9f8567b93c368acb5dbf7c",
"spec/functions/is_a_spec.rb": "e657f393cc3572883aa2ab872840f4bf",
"spec/functions/is_array_spec.rb": "aa5f9f75714c267f1ea0463412f24285",
"spec/functions/is_bool_spec.rb": "46ed9e2d70f68db12799918d88d2d804",
"spec/functions/is_domain_name_spec.rb": "0e2cf9c9410827484ee3652591757faf",
"spec/functions/is_email_address_spec.rb": "f3e60f28e9d66d7707a434a8edc79900",
"spec/functions/is_float_spec.rb": "a89f4bbc747ce7117c6899d8e5e75e83",
"spec/functions/is_function_available_spec.rb": "0f46d970fca74c87dbcbbaa588b6dc37",
"spec/functions/is_hash_spec.rb": "cec4b5638ea3f871350a055cee98ea11",
"spec/functions/is_integer_spec.rb": "aa78c5487a22744feccc74ad1ad7f211",
"spec/functions/is_ip_address_spec.rb": "c175629e894671b57ed97f76d7ee495c",
"spec/functions/is_ipv4_address_spec.rb": "c10a82ce2b0987cba45916f442759d8c",
"spec/functions/is_ipv6_address_spec.rb": "f33842262d74f6fa6ac459f980938ecf",
"spec/functions/is_mac_address_spec.rb": "80b7d3346f1b4b487f5f88257fe33bc4",
"spec/functions/is_numeric_spec.rb": "e3e3c3541c794d74ae1775ca5996e47d",
"spec/functions/is_string_spec.rb": "1b1fd9c63def53fcb519a04952057aa0",
"spec/functions/join_keys_to_values_spec.rb": "5b8d4704d1e3aee0a8b9738d1324f7f3",
"spec/functions/join_spec.rb": "73b5cde490bf58e28b76d839cd6ef1c7",
"spec/functions/keys_spec.rb": "921f060f4b6e0e754f4ff72204e2381e",
"spec/functions/length_spec.rb": "bd88fd83eb41377f554b1197210674ca",
"spec/functions/load_module_metadata_spec.rb": "fcd21ec96196921526179de3fa5de95d",
"spec/functions/loadjson_spec.rb": "4d24fcd02c823ea02eb56e96b223038e",
"spec/functions/loadyaml_spec.rb": "b85e7f0425df94bb3356db2e52530d79",
"spec/functions/lstrip_spec.rb": "7a6e82653fe4087615bb29e4d8818008",
"spec/functions/max_spec.rb": "e12bc75395d63b5c15c830291d2f8afe",
"spec/functions/member_spec.rb": "43c3c315d44b793a0da3ed80820d386f",
"spec/functions/merge_spec.rb": "48761dac5afc99bd381f76f88927cdb0",
"spec/functions/min_spec.rb": "44df74b50984cc4efedca7ac9adeef91",
"spec/functions/num2bool_spec.rb": "fe3c3dbec9787622850175db510fe4f0",
"spec/functions/parsejson_spec.rb": "2f626614bba7f123fc0704878cad731a",
"spec/functions/parseyaml_spec.rb": "1e41204590f35d1cc127efcbdaa8321f",
"spec/functions/pick_default_spec.rb": "9c8337fb7dd83df40d01c5977d62b4a7",
"spec/functions/pick_spec.rb": "856384e60757e1d94ca3aef161be3d0a",
"spec/functions/prefix_spec.rb": "a4d28e657d42a42e06f7bcaf1bba1c08",
"spec/functions/private_spec.rb": "689c5821596afd859de6312e8ffb1fea",
"spec/functions/pw_hash_spec.rb": "d9bdce271d38ce6ec1d8258e807a7c67",
"spec/functions/range_spec.rb": "9d38e84765c4fbd8351211741b493b01",
"spec/functions/regexpescape_spec.rb": "80a497405be58e82e849cfb3784dbfd1",
"spec/functions/reject_spec.rb": "24c6e7597e73bcef62637cf90d994db9",
"spec/functions/reverse_spec.rb": "19829abf65a041a74097cfeb8f9e821a",
"spec/functions/round_spec.rb": "62862ca723b0e2406e1ab278b4b8a7a8",
"spec/functions/rstrip_spec.rb": "240792c366063a1cf82c51615d3f4316",
"spec/functions/seeded_rand_spec.rb": "9ff38a91d988c51ef70149bb902e3a83",
"spec/functions/shell_escape_spec.rb": "513534e47818ce650b343985febedf9e",
"spec/functions/shell_join_spec.rb": "e47a7b81d864933fa3ed8b03f189019e",
"spec/functions/shell_split_spec.rb": "ea446ddf08763b98ca794d4aaf9878ee",
"spec/functions/shuffle_spec.rb": "f0415952345da7d4464512728f35e52f",
"spec/functions/size_spec.rb": "d3aa74419efba6ec5c4b50ccbd45bf88",
"spec/functions/sort_spec.rb": "ae131f00aa9ce2a576243f997e0f12b2",
"spec/functions/sprintf_hash_spec.rb": "1b014e8c0a44b935ec0c045e275ad6b3",
"spec/functions/squeeze_spec.rb": "3d01142c11d5e7e7e841c23e9a37e458",
"spec/functions/str2bool_spec.rb": "d099ca74f02ac231f699e59d7a41bafb",
"spec/functions/str2saltedsha512_spec.rb": "815dfb2f7c65f81769c117129e45bf85",
"spec/functions/strftime_spec.rb": "e4ff0163ab707966186d7941b0e5f18d",
"spec/functions/strip_spec.rb": "c439a03137befdff8dd0ef483bf1ef2c",
"spec/functions/suffix_spec.rb": "dac301a98ed47f85c62293ca968066ff",
"spec/functions/swapcase_spec.rb": "53e01155bd14271641dc954b02bc06e6",
"spec/functions/time_spec.rb": "eaf3f48601278bb250659b05022a2a44",
"spec/functions/to_bytes_spec.rb": "dbc093a1a72429a0a67e784ecabc100a",
"spec/functions/to_json_pretty_spec.rb": "318892fb8ae3fba91ea3a3f41d563c54",
"spec/functions/to_json_spec.rb": "e4fbcd70fb3e0b6890337b6eec51f1f0",
"spec/functions/to_yaml_spec.rb": "b151fd564e9f7e8b35b69c6ae46948e1",
"spec/functions/try_get_value_spec.rb": "53ab2e553ae441821ad02be3c952a34a",
"spec/functions/type3x_spec.rb": "cd85e50dda33d32fb90f08eafb29efd7",
"spec/functions/type_of_spec.rb": "ecfeb9d47e54f5aae421f7855853d47a",
"spec/functions/type_spec.rb": "3a7a71aed638cacfc3d22573cf66ced6",
"spec/functions/union_spec.rb": "237517b051eddffd7afc020eeb53c7a1",
"spec/functions/unique_spec.rb": "27af15518c2bc4f6dc3009d563d25144",
"spec/functions/unix2dos_spec.rb": "77e6d0e7c703576924981038472c8e4e",
"spec/functions/upcase_spec.rb": "3eb2544373f1c474b334dd9b37ae4818",
"spec/functions/uriescape_spec.rb": "b88f0575ba928b4f60635de6db77299c",
"spec/functions/validate_absolute_path_spec.rb": "09470e989ed56866d380e1fb1e2d81f2",
"spec/functions/validate_array_spec.rb": "814b2e7f39ed83d5ff0b822c32462a47",
"spec/functions/validate_augeas_spec.rb": "4bf035ec4548a00d42f73643374d6f58",
"spec/functions/validate_bool_spec.rb": "0c486955f041d86356d41f86ea0c6bd4",
"spec/functions/validate_cmd_spec.rb": "179e570e9aec94c5dcaf337a6b431d20",
"spec/functions/validate_domain_name_spec.rb": "611f3b301003d11a6a55e293dc3a8e5c",
"spec/functions/validate_email_address_spec.rb": "8bac32b793f1e4264ae32df975d4d893",
"spec/functions/validate_hash_spec.rb": "09e78289eac14bdc3389620a4dfc3c8d",
"spec/functions/validate_integer_spec.rb": "a82914e1813c10b0ffa432ccf44ef781",
"spec/functions/validate_ip_address_spec.rb": "fe5c58a23295a00c55637ee3dcb6470f",
"spec/functions/validate_ipv4_address_spec.rb": "b8b6ff3ab6dc9360635f6b3a4d2aaaec",
"spec/functions/validate_ipv6_address_spec.rb": "1ebc18a929b989eb4591260a75edb5de",
"spec/functions/validate_legacy_spec.rb": "2d93df10c72ec5dde1e6618c02e78d40",
"spec/functions/validate_numeric_spec.rb": "ace0a1f0d69c78ced85a02900e6d0f73",
"spec/functions/validate_re_spec.rb": "19e0f2589d5a48559efa61cfe308ef1b",
"spec/functions/validate_slength_spec.rb": "d0e2b4c6ca7050a39f02c1a3005dcb5f",
"spec/functions/validate_string_spec.rb": "7591075ba74d9d69145497ff0ba040ff",
"spec/functions/validate_x509_rsa_key_pair_spec.rb": "5d3260fcd331122fc3fb056fe8da5acf",
"spec/functions/values_at_spec.rb": "a434a3361626dfcab7adfc92a5a1ea4e",
"spec/functions/values_spec.rb": "c55dd25c91a51942dddc7dcffb74d022",
"spec/functions/zip_spec.rb": "163a0f62553252a8ef8adc9fc44a3568",
"spec/monkey_patches/alias_should_to_must.rb": "52ce6baeefea70b66c80cfdc5dfafddc",
"spec/monkey_patches/publicize_methods.rb": "d2ae9210754b0a4eae0d6bf33737fe90",
"spec/spec_helper.rb": "6a8493cc89df06740a1f7ed364aed66c",
"spec/spec_helper_acceptance.rb": "90ed03c8192a0711a4979af8c6bdc1f9",
"spec/spec_helper_local.rb": "5644c5ce611a9e131cf37106e2a8b841",
"spec/support/shared_data.rb": "dfe4cbdbe2833d670a89bcdf3163839b",
"spec/type_aliases/absolute_path_spec.rb": "5bdfe834183c06b06a406ac4c8a20622",
"spec/type_aliases/array_spec.rb": "5a7a5be96ccb1347a5a806ef436064e6",
"spec/type_aliases/base32_spec.rb": "3d4394fb10e0cc58f5ed6b11a00cdffc",
"spec/type_aliases/base64_spec.rb": "383aa3be600b38a3a7de1e488056262e",
"spec/type_aliases/bool_spec.rb": "798d1fb0b43cdc7c560ba8b61fb742e6",
"spec/type_aliases/compat__ip_address.rb": "7ee3a1f901e33a5a72632cd390629450",
"spec/type_aliases/compat__ipv4_spec.rb": "d091b3dcd1fc3a30fe080d9b53a69014",
"spec/type_aliases/compat__ipv6_spec.rb": "08005590462f404047995ec86a80e85c",
"spec/type_aliases/filemode_spec.rb": "81b7a8687b9bcf1ddaf5667d95498f19",
"spec/type_aliases/filesource_spec.rb": "4b72052c22274c568849c2138b6b44ab",
"spec/type_aliases/float_spec.rb": "e566885fdf22399a54450022bfbfd31a",
"spec/type_aliases/fqdn_spec.rb": "cc343ee15ae50af90a2a6faa41864111",
"spec/type_aliases/hash_spec.rb": "1b8c49a76db8b5ef44f0f0a8e56c5eb3",
"spec/type_aliases/host_spec.rb": "418b672c12248267e3aa810b8e9a3832",
"spec/type_aliases/httpsurl_spec.rb": "a0aff170decf6659dd5d253f06459ae0",
"spec/type_aliases/httpurl_spec.rb": "64e610fd2369f9579d72879ea80634f9",
"spec/type_aliases/integer_spec.rb": "8f66ae64602543d65e4b784527bf1463",
"spec/type_aliases/ip_address.rb": "064acb87912cb36c8fc0a1f3b5441eef",
"spec/type_aliases/ip_address_nosubnet_spec.rb": "9d196b9b9522a91ac2bc3a67ccd02d5f",
"spec/type_aliases/ip_address_spec.rb": "ae9c24b0ee7d77b967b93ffb13fb67bb",
"spec/type_aliases/ip_address_v4_nosubnet_spec.rb": "c30a31b7bcb92eed728be5fef7b45724",
"spec/type_aliases/ip_address_v4_spec.rb": "0aacb3967d4ca3a7f8bc3a17e93f141f",
"spec/type_aliases/ip_address_v6_alternative_spec.rb": "17da75c696f406ffbd4829a13828fcc5",
"spec/type_aliases/ip_address_v6_compressed_spec.rb": "508f6e102bbc3c7af4bd24df5e640f40",
"spec/type_aliases/ip_address_v6_full_spec.rb": "35ff79b1855e77ffff7c38599cfafaa2",
"spec/type_aliases/ip_address_v6_nosubnet_alternative_spec.rb": "020fc117a134398818910b41a76094aa",
"spec/type_aliases/ip_address_v6_nosubnet_compressed_spec.rb": "f97969e6cdae00e5a1ffbbd71ba7e08e",
"spec/type_aliases/ip_address_v6_nosubnet_full_spec.rb": "c5fad1a8e5fee0cfac3ee9f1b5083804",
"spec/type_aliases/ip_address_v6_spec.rb": "74a4c54bf8fffc4ebc3e33c12b085640",
"spec/type_aliases/ipv4_spec.rb": "7bb8f191690fb67806be4c8349872a3e",
"spec/type_aliases/ipv6_spec.rb": "8343f83b863e73348969d0f790a6fb6b",
"spec/type_aliases/numeric_spec.rb": "06ae28964dfad6ca60ac59468c33104b",
"spec/type_aliases/port__privileged_spec.rb": "531e8567e3251548324088e1cdac29d6",
"spec/type_aliases/port__unprivileged_spec.rb": "ec5aa19f8bfb62307617c0e9b002475d",
"spec/type_aliases/port_spec.rb": "6fff6e2cfc7b91e49b6dd169629f8a53",
"spec/type_aliases/string_spec.rb": "458ac453f5870066824b6a11ec49f9ae",
"spec/type_aliases/unixpath_spec.rb": "015ad5050bcbe3b9b633e13525412e48",
"spec/type_aliases/windowspath_spec.rb": "946275f885194c3f2fde07b66aa46f4a",
"spec/unit/facter/facter_dot_d_spec.rb": "01bd42a343214521b2dc340457f21e5d",
"spec/unit/facter/package_provider_spec.rb": "ce3015059cc3b8db3a8129563d08cf40",
"spec/unit/facter/pe_version_spec.rb": "8cd3ea8ee24a1fa1c64e27dac0ca7fc7",
"spec/unit/facter/root_home_spec.rb": "18f770e2105fbcb634c1a0501f0d2778",
"spec/unit/facter/service_provider_spec.rb": "19072e8955ba2f3ef64d452c574354c5",
"spec/unit/facter/util/puppet_settings_spec.rb": "d6c856b8da6e1ca4bcf377f4f7c2568e",
"spec/unit/puppet/parser/functions/enclose_ipv6_spec.rb": "660badf5fdca469a98e8e2359d6a2825",
"spec/unit/puppet/parser/functions/is_absolute_path_spec.rb": "258f55b8c9563bad0aaa9e98df4d6fc6",
"spec/unit/puppet/provider/file_line/ruby_spec.rb": "f5aca0856046c760832822816c44c705",
"spec/unit/puppet/provider/file_line/ruby_spec_alter.rb": "afa3589fb59f743bb8c2242c294951b2",
"spec/unit/puppet/provider/file_line/ruby_spec_use_cases.rb": "13d2c5198ca879f29d70ca230288b1e8",
"spec/unit/puppet/type/anchor_spec.rb": "5f67ab4f4a0cfc40cd2fcdb3f148f026",
"spec/unit/puppet/type/file_line_spec.rb": "92c3ac78210f730fc2135e012ded86bb",
"types/absolutepath.pp": "3ae6f48dd95835df87c5dacea13c88d2",
"types/base32.pp": "c1e7d9939641c49af90b07043a52112e",
"types/base64.pp": "6e61a5c608ab2147fdf295f97b1052c9",
"types/compat/absolute_path.pp": "c500d00e471fa7684abce8c67e2a0a3e",
"types/compat/array.pp": "43c41022dd743d55c8e9e82ce3ed741c",
"types/compat/bool.pp": "6e0cd7b2a7e1b9efaa0e273937211e58",
"types/compat/float.pp": "fd134a0e0e1abd420cec2107780a7afa",
"types/compat/hash.pp": "3535d98f0f3eaec44d443190f258e9ba",
"types/compat/integer.pp": "d73ad743def0a4e754cbf2e82d5c6b5d",
"types/compat/ip_address.pp": "d42c7435de30a469a71b69c45d642da7",
"types/compat/ipv4.pp": "962713ea8483c01f2188f87fac1fefa8",
"types/compat/ipv6.pp": "bc2c5d46bb49c5180c70c64a8a9ee6ea",
"types/compat/numeric.pp": "b9543932cda152dfc2cb7fb554a307f7",
"types/compat/re.pp": "70b05d4697e61f9af0c212ba063f395d",
"types/compat/string.pp": "b9a179664c85e121aa0277021627d126",
"types/ensure/service.pp": "efa28f903420bb9555910c27a9b810e8",
"types/filemode.pp": "1776107a2f48cb22131e61f4aaf93750",
"types/filesource.pp": "ca652b33c6848e2a6231279fe7cc58d0",
"types/fqdn.pp": "f6fb6bf625dab3bd0ab63a1ff7983fb8",
"types/host.pp": "69260768a909759bdc31aeaae58d449e",
"types/httpsurl.pp": "108225d0273e17d541b239882287ed15",
"types/httpurl.pp": "4ba64825b11af75997c59b5acf07c62d",
"types/ip/address/nosubnet.pp": "e7c5a338634dfd0eea60cf36092f3fd8",
"types/ip/address/v4/cidr.pp": "2f6f69e74d16f08f3e80e2ca3f3dd413",
"types/ip/address/v4/nosubnet.pp": "9590ebd639bc47fd25288d32dee5405d",
"types/ip/address/v4.pp": "18165fd02c81c08dff234f83d50662a0",
"types/ip/address/v6/alternative.pp": "9e82ba1516dc28cab9707066780ca512",
"types/ip/address/v6/compressed.pp": "f4d8102d586347ba093a2793271460c5",
"types/ip/address/v6/full.pp": "0492b9081ca01bfff8a3d3f07df5c41c",
"types/ip/address/v6/nosubnet/alternative.pp": "b9a6cd5a4c2a2e8013022fd4cfd11a3e",
"types/ip/address/v6/nosubnet/compressed.pp": "ca2f53bcc3f659d994a6e0d3fe17861e",
"types/ip/address/v6/nosubnet/full.pp": "5fa0bb70ed3e72ac52738ba182f22c1c",
"types/ip/address/v6/nosubnet.pp": "612651452cd225ade84fe31750d02903",
"types/ip/address/v6.pp": "1f3c0aa34dbc083d26f135246c8576eb",
"types/ip/address.pp": "9929a758afc9469acbcff0c2050bb0ab",
"types/ip_address.pp": "fdede88de3e8322ed265baf0a0e4229e",
"types/ipv4.pp": "495e86194de9d4e3c17a0abc195bec91",
"types/ipv6.pp": "bec72ad7b5e56ab34b93c61b2e1871a9",
"types/mac.pp": "b6b9a7148111578052bdb34e7ef0ce19",
"types/port/privileged.pp": "c4ce776dd07a3c8dd3379db8cd49e32a",
"types/port/unprivileged.pp": "85359128fa9261fe8bf58c8525574404",
"types/port.pp": "b1edd08c4eff860b3ea8bd84cd48ba81",
"types/unixpath.pp": "b64a48701e7adfda45d31fd80bee4ad0",
"types/windowspath.pp": "4c1eda331ecb43de98c29ed22d0ad448"
}

View File

@@ -1,9 +0,0 @@
# This is a simple smoke test
# of the file_line resource type.
file { '/tmp/dansfile':
ensure => file,
}
-> file_line { 'dans_line':
line => 'dan is awesome',
path => '/tmp/dansfile',
}

View File

@@ -1,9 +0,0 @@
include ::stdlib
info('has_interface_with(\'lo\'):', has_interface_with('lo'))
info('has_interface_with(\'loX\'):', has_interface_with('loX'))
info('has_interface_with(\'ipaddress\', \'127.0.0.1\'):', has_interface_with('ipaddress', '127.0.0.1'))
info('has_interface_with(\'ipaddress\', \'127.0.0.100\'):', has_interface_with('ipaddress', '127.0.0.100'))
info('has_interface_with(\'network\', \'127.0.0.0\'):', has_interface_with('network', '127.0.0.0'))
info('has_interface_with(\'network\', \'128.0.0.0\'):', has_interface_with('network', '128.0.0.0'))
info('has_interface_with(\'netmask\', \'255.0.0.0\'):', has_interface_with('netmask', '255.0.0.0'))
info('has_interface_with(\'netmask\', \'256.0.0.0\'):', has_interface_with('netmask', '256.0.0.0'))

View File

@@ -1,3 +0,0 @@
include ::stdlib
info('has_ip_address(\'192.168.1.256\'):', has_ip_address('192.168.1.256'))
info('has_ip_address(\'127.0.0.1\'):', has_ip_address('127.0.0.1'))

View File

@@ -1,3 +0,0 @@
include ::stdlib
info('has_ip_network(\'127.0.0.0\'):', has_ip_network('127.0.0.0'))
info('has_ip_network(\'128.0.0.0\'):', has_ip_network('128.0.0.0'))

View File

@@ -1 +0,0 @@
include ::stdlib

View File

@@ -1,194 +0,0 @@
# A Facter plugin that loads facts from /etc/facter/facts.d
# and /etc/puppetlabs/facter/facts.d.
#
# Facts can be in the form of JSON, YAML or Text files
# and any executable that returns key=value pairs.
#
# In the case of scripts you can also create a file that
# contains a cache TTL. For foo.sh store the ttl as just
# a number in foo.sh.ttl
#
# The cache is stored in $libdir/facts_dot_d.cache as a mode
# 600 file and will have the end result of not calling your
# fact scripts more often than is needed
class Facter::Util::DotD
require 'yaml'
def initialize(dir = '/etc/facts.d', cache_file = File.join(Puppet[:libdir], 'facts_dot_d.cache'))
@dir = dir
@cache_file = cache_file
@cache = nil
@types = { '.txt' => :txt, '.json' => :json, '.yaml' => :yaml }
end
def entries
Dir.entries(@dir).reject { |f| f =~ %r{^\.|\.ttl$} }.sort.map { |f| File.join(@dir, f) }
rescue
[]
end
def fact_type(file)
extension = File.extname(file)
type = @types[extension] || :unknown
type = :script if type == :unknown && File.executable?(file)
type
end
def txt_parser(file)
File.readlines(file).each do |line|
next unless line =~ %r{^([^=]+)=(.+)$}
var = Regexp.last_match(1)
val = Regexp.last_match(2)
Facter.add(var) do
setcode { val }
end
end
rescue StandardError => e
Facter.warn("Failed to handle #{file} as text facts: #{e.class}: #{e}")
end
def json_parser(file)
begin
require 'json'
rescue LoadError
retry if require 'rubygems'
raise
end
JSON.parse(File.read(file)).each_pair do |f, v|
Facter.add(f) do
setcode { v }
end
end
rescue StandardError => e
Facter.warn("Failed to handle #{file} as json facts: #{e.class}: #{e}")
end
def yaml_parser(file)
require 'yaml'
YAML.load_file(file).each_pair do |f, v|
Facter.add(f) do
setcode { v }
end
end
rescue StandardError => e
Facter.warn("Failed to handle #{file} as yaml facts: #{e.class}: #{e}")
end
def script_parser(file)
result = cache_lookup(file)
ttl = cache_time(file)
if result
Facter.debug("Using cached data for #{file}")
else
result = Facter::Util::Resolution.exec(file)
if ttl > 0
Facter.debug("Updating cache for #{file}")
cache_store(file, result)
cache_save!
end
end
result.split("\n").each do |line|
next unless line =~ %r{^(.+)=(.+)$}
var = Regexp.last_match(1)
val = Regexp.last_match(2)
Facter.add(var) do
setcode { val }
end
end
rescue StandardError => e
Facter.warn("Failed to handle #{file} as script facts: #{e.class}: #{e}")
Facter.debug(e.backtrace.join("\n\t"))
end
def cache_save!
cache = load_cache
File.open(@cache_file, 'w', 0o600) { |f| f.write(YAML.dump(cache)) }
rescue # rubocop:disable Lint/HandleExceptions
end
def cache_store(file, data)
load_cache
@cache[file] = { :data => data, :stored => Time.now.to_i }
rescue # rubocop:disable Lint/HandleExceptions
end
def cache_lookup(file)
cache = load_cache
return nil if cache.empty?
ttl = cache_time(file)
return nil unless cache[file]
now = Time.now.to_i
return cache[file][:data] if ttl == -1
return cache[file][:data] if (now - cache[file][:stored]) <= ttl
return nil
rescue
return nil
end
def cache_time(file)
meta = file + '.ttl'
return File.read(meta).chomp.to_i
rescue
return 0
end
def load_cache
@cache ||= if File.exist?(@cache_file)
YAML.load_file(@cache_file)
else
{}
end
return @cache
rescue
@cache = {}
return @cache
end
def create
entries.each do |fact|
type = fact_type(fact)
parser = "#{type}_parser"
next unless respond_to?("#{type}_parser")
Facter.debug("Parsing #{fact} using #{parser}")
send(parser, fact)
end
end
end
mdata = Facter.version.match(%r{(\d+)\.(\d+)\.(\d+)})
if mdata
(major, minor, _patch) = mdata.captures.map { |v| v.to_i }
if major < 2
# Facter 1.7 introduced external facts support directly
unless major == 1 && minor > 6
Facter::Util::DotD.new('/etc/facter/facts.d').create
Facter::Util::DotD.new('/etc/puppetlabs/facter/facts.d').create
# Windows has a different configuration directory that defaults to a vendor
# specific sub directory of the %COMMON_APPDATA% directory.
if Dir.const_defined? 'COMMON_APPDATA' # rubocop:disable Metrics/BlockNesting : Any attempt to alter this breaks it
windows_facts_dot_d = File.join(Dir::COMMON_APPDATA, 'PuppetLabs', 'facter', 'facts.d')
Facter::Util::DotD.new(windows_facts_dot_d).create
end
end
end
end

View File

@@ -1,21 +0,0 @@
# Fact: package_provider
#
# Purpose: Returns the default provider Puppet will choose to manage packages
# on this system
#
# Resolution: Instantiates a dummy package resource and return the provider
#
# Caveats:
#
require 'puppet/type'
require 'puppet/type/package'
Facter.add(:package_provider) do
setcode do
if defined? Gem && Gem::Version.new(Facter.value(:puppetversion).split(' ')[0]) >= Gem::Version.new('3.6')
Puppet::Type.type(:package).newpackage(:name => 'dummy', :allow_virtual => 'true')[:provider].to_s
else
Puppet::Type.type(:package).newpackage(:name => 'dummy')[:provider].to_s
end
end
end

View File

@@ -1,61 +0,0 @@
# Fact: is_pe, pe_version, pe_major_version, pe_minor_version, pe_patch_version
#
# Purpose: Return various facts about the PE state of the system
#
# Resolution: Uses a regex match against puppetversion to determine whether the
# machine has Puppet Enterprise installed, and what version (overall, major,
# minor, patch) is installed.
#
# Caveats:
#
Facter.add('pe_version') do
setcode do
puppet_ver = Facter.value('puppetversion')
if !puppet_ver.nil?
pe_ver = puppet_ver.match(%r{Puppet Enterprise (\d+\.\d+\.\d+)})
pe_ver[1] if pe_ver
else
nil
end
end
end
Facter.add('is_pe') do
setcode do
if Facter.value(:pe_version).to_s.empty?
false
else
true
end
end
end
Facter.add('pe_major_version') do
confine :is_pe => true
setcode do
pe_version = Facter.value(:pe_version)
if pe_version
pe_version.to_s.split('.')[0]
end
end
end
Facter.add('pe_minor_version') do
confine :is_pe => true
setcode do
pe_version = Facter.value(:pe_version)
if pe_version
pe_version.to_s.split('.')[1]
end
end
end
Facter.add('pe_patch_version') do
confine :is_pe => true
setcode do
pe_version = Facter.value(:pe_version)
if pe_version
pe_version.to_s.split('.')[2]
end
end
end

View File

@@ -1,42 +0,0 @@
# These facter facts return the value of the Puppet vardir and environment path
# settings for the node running puppet or puppet agent. The intent is to
# enable Puppet modules to automatically have insight into a place where they
# can place variable data, or for modules running on the puppet master to know
# where environments are stored.
#
# The values should be directly usable in a File resource path attribute.
#
begin
require 'facter/util/puppet_settings'
rescue LoadError => e
# puppet apply does not add module lib directories to the $LOAD_PATH (See
# #4248). It should (in the future) but for the time being we need to be
# defensive which is what this rescue block is doing.
rb_file = File.join(File.dirname(__FILE__), 'util', 'puppet_settings.rb')
load rb_file if File.exist?(rb_file) || raise(e)
end
# These will be nil if Puppet is not available.
Facter.add(:puppet_vardir) do
setcode do
Facter::Util::PuppetSettings.with_puppet do
Puppet[:vardir]
end
end
end
Facter.add(:puppet_environmentpath) do
setcode do
Facter::Util::PuppetSettings.with_puppet do
Puppet[:environmentpath]
end
end
end
Facter.add(:puppet_server) do
setcode do
Facter::Util::PuppetSettings.with_puppet do
Puppet[:server]
end
end
end

View File

@@ -1,44 +0,0 @@
# A facter fact to determine the root home directory.
# This varies on PE supported platforms and may be
# reconfigured by the end user.
module Facter::Util::RootHome
class << self
def returnt_root_home
root_ent = Facter::Util::Resolution.exec('getent passwd root')
# The home directory is the sixth element in the passwd entry
# If the platform doesn't have getent, root_ent will be nil and we should
# return it straight away.
root_ent && root_ent.split(':')[5]
end
end
end
Facter.add(:root_home) do
setcode { Facter::Util::RootHome.returnt_root_home }
end
Facter.add(:root_home) do
confine :kernel => :darwin
setcode do
str = Facter::Util::Resolution.exec('dscacheutil -q user -a name root')
hash = {}
str.split("\n").each do |pair|
key, value = pair.split(%r{:})
hash[key] = value
end
hash['dir'].strip
end
end
Facter.add(:root_home) do
confine :kernel => :aix
root_home = nil
setcode do
str = Facter::Util::Resolution.exec('lsuser -c -a home root')
str && str.split("\n").each do |line|
next if line =~ %r{^#}
root_home = line.split(%r{:})[1]
end
root_home
end
end

View File

@@ -1,17 +0,0 @@
# Fact: service_provider
#
# Purpose: Returns the default provider Puppet will choose to manage services
# on this system
#
# Resolution: Instantiates a dummy service resource and return the provider
#
# Caveats:
#
require 'puppet/type'
require 'puppet/type/service'
Facter.add(:service_provider) do
setcode do
Puppet::Type.type(:service).newservice(:name => 'dummy')[:provider].to_s
end
end

View File

@@ -1,16 +0,0 @@
# A method to evaluate a Facter code block if puppet is loaded.
module Facter::Util::PuppetSettings
# This method is intended to provide a convenient way to evaluate a
# Facter code block only if Puppet is loaded. This is to account for the
# situation where the fact happens to be in the load path, but Puppet is
# not loaded for whatever reason. Perhaps the user is simply running
# facter without the --puppet flag and they happen to be working in a lib
# directory of a module.
def self.with_puppet
Module.const_get('Puppet')
rescue NameError
nil
else
yield
end
end

View File

@@ -1,32 +0,0 @@
# Function to print deprecation warnings, Logs a warning once for a given key. The uniqueness key - can appear once.
# The msg is the message text including any positional information that is formatted by the user/caller of the method.
# It is affected by the puppet setting 'strict', which can be set to :error (outputs as an error message),
# :off (no message / error is displayed) and :warning (default, outputs a warning) *Type*: String, String.
#
Puppet::Functions.create_function(:deprecation) do
dispatch :deprecation do
param 'String', :key
param 'String', :message
end
def deprecation(key, message)
if defined? Puppet::Pops::PuppetStack.stacktrace
stacktrace = Puppet::Pops::PuppetStack.stacktrace()
file = stacktrace[0]
line = stacktrace[1]
message = "#{message} at #{file}:#{line}"
end
# depending on configuration setting of strict
case Puppet.settings[:strict]
when :off # rubocop:disable Lint/EmptyWhen : Is required to prevent false errors
# do nothing
when :error
raise("deprecation. #{key}. #{message}")
else
unless ENV['STDLIB_LOG_DEPRECATIONS'] == 'false'
Puppet.deprecation_warning(message, key)
end
end
end
end

View File

@@ -1,57 +0,0 @@
# Digs into the facts hash using dot-notation
#
# Example usage:
#
# fact('osfamily')
# fact('os.architecture')
#
# Array indexing:
#
# fact('mountpoints."/dev".options.1')
#
# Fact containing a "." in the name:
#
# fact('vmware."VRA.version"')
#
Puppet::Functions.create_function(:fact) do
dispatch :fact do
param 'String', :fact_name
end
def to_dot_syntax(array_path)
array_path.map { |string|
string.include?('.') ? %("#{string}") : string
}.join('.')
end
def fact(fact_name)
facts = closure_scope['facts']
# Transform the dot-notation string into an array of paths to walk. Make
# sure to correctly extract double-quoted values containing dots as single
# elements in the path.
path = fact_name.scan(%r{([^."]+)|(?:")([^"]+)(?:")}).map { |x| x.compact.first }
walked_path = []
path.reduce(facts) do |d, k|
return nil if d.nil? || k.nil?
if d.is_a?(Array)
begin
result = d[Integer(k)]
rescue ArgumentError => e # rubocop:disable Lint/UselessAssignment : Causes errors if assigment is removed.
Puppet.warning("fact request for #{fact_name} returning nil: '#{to_dot_syntax(walked_path)}' is an array; cannot index to '#{k}'")
result = nil
end
elsif d.is_a?(Hash)
result = d[k]
else
Puppet.warning("fact request for #{fact_name} returning nil: '#{to_dot_syntax(walked_path)}' is not a collection; cannot walk to '#{k}'")
result = nil
end
walked_path << k
result
end
end
end

View File

@@ -1,32 +0,0 @@
# Boolean check to determine whether a variable is of a given data type. This is equivalent to the `=~` type checks.
#
# @example how to check a data type
# # check a data type
# foo = 3
# $bar = [1,2,3]
# $baz = 'A string!'
#
# if $foo.is_a(Integer) {
# notify { 'foo!': }
# }
# if $bar.is_a(Array) {
# notify { 'bar!': }
# }
# if $baz.is_a(String) {
# notify { 'baz!': }
# }
#
# See the documentation for "The Puppet Type System" for more information about types.
# See the `assert_type()` function for flexible ways to assert the type of a value.
#
Puppet::Functions.create_function(:is_a) do
dispatch :is_a do
param 'Any', :value
param 'Type', :type
end
def is_a(value, type) # rubocop:disable Style/PredicateName : Used in to many other places to rename at this time, attempting to refactor caused Rubocop to crash.
# See puppet's lib/puppet/pops/evaluator/evaluator_impl.rb eval_MatchExpression
Puppet::Pops::Types::TypeCalculator.instance?(type, value)
end
end

View File

@@ -1,17 +0,0 @@
Puppet::Functions.create_function(:is_absolute_path) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'is_absolute_path', 'This method is deprecated, please use match expressions with Stdlib::Compat::Absolute_Path instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.')
scope.send('function_is_absolute_path', args)
end
end

View File

@@ -1,17 +0,0 @@
Puppet::Functions.create_function(:is_array) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'is_array', 'This method is deprecated, please use match expressions with Stdlib::Compat::Array instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.')
scope.send('function_is_array', args)
end
end

View File

@@ -1,17 +0,0 @@
Puppet::Functions.create_function(:is_bool) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'is_bool', 'This method is deprecated, please use match expressions with Stdlib::Compat::Bool instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.')
scope.send('function_is_bool', args)
end
end

View File

@@ -1,17 +0,0 @@
Puppet::Functions.create_function(:is_float) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'is_float', 'This method is deprecated, please use match expressions with Stdlib::Compat::Float instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.')
scope.send('function_is_float', args)
end
end

View File

@@ -1,17 +0,0 @@
Puppet::Functions.create_function(:is_ip_address) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'is_ip_address', 'This method is deprecated, please use match expressions with Stdlib::Compat::Ip_address instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.')
scope.send('function_is_ip_address', args)
end
end

View File

@@ -1,17 +0,0 @@
Puppet::Functions.create_function(:is_ipv4_address) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'is_ipv4_address', 'This method is deprecated, please use match expressions with Stdlib::Compat::Ipv4 instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.')
scope.send('function_is_ipv4_address', args)
end
end

View File

@@ -1,17 +0,0 @@
Puppet::Functions.create_function(:is_ipv6_address) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'is_ipv4_address', 'This method is deprecated, please use match expressions with Stdlib::Compat::Ipv6 instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.')
scope.send('function_is_ipv6_address', args)
end
end

View File

@@ -1,17 +0,0 @@
Puppet::Functions.create_function(:is_numeric) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'is_numeric', 'This method is deprecated, please use match expressions with Stdlib::Compat::Numeric instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.')
scope.send('function_is_numeric', args)
end
end

View File

@@ -1,17 +0,0 @@
Puppet::Functions.create_function(:is_string) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'is_string', 'This method is deprecated, please use match expressions with Stdlib::Compat::String instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.')
scope.send('function_is_string', args)
end
end

View File

@@ -1,14 +0,0 @@
# A function to eventually replace the old size() function for stdlib - The original size function did not handle Puppets new type capabilities, so this function is a Puppet 4 compatible solution.
Puppet::Functions.create_function(:length) do
dispatch :length do
param 'Variant[String,Array,Hash]', :value
end
def length(value)
if value.is_a?(String)
result = value.length
elsif value.is_a?(Array) || value.is_a?(Hash)
result = value.size
end
result
end
end

View File

@@ -1,29 +0,0 @@
# Uses sprintf with named references.
#
# The first parameter is format string describing how the rest of the parameters in the hash
# should be formatted. See the documentation for the `Kernel::sprintf` function in Ruby for
# all the details.
#
# In the given argument hash with parameters, all keys are converted to symbols so they work
# with the `sprintf` function.
#
# @example Format a string and number
# $output = sprintf_hash('String: %<foo>s / number converted to binary: %<number>b',
# { 'foo' => 'a string', 'number' => 5 })
# # $output = 'String: a string / number converted to binary: 101'
#
Puppet::Functions.create_function(:sprintf_hash) do
# @param format The format to use.
# @param arguments Hash with parameters.
# @return The formatted string.
dispatch :sprintf_hash do
param 'String', :format
param 'Hash', :arguments
# Disabled for now. This gives issues on puppet 4.7.1.
# return_type 'String'
end
def sprintf_hash(format, arguments)
Kernel.sprintf(format, Hash[arguments.map { |(k, v)| [k.to_sym, v] }])
end
end

View File

@@ -1,21 +0,0 @@
# Take a data structure and output it as JSON
#
# @example how to output JSON
# # output json to a file
# file { '/tmp/my.json':
# ensure => file,
# content => to_json($myhash),
# }
#
#
require 'json'
Puppet::Functions.create_function(:to_json) do
dispatch :to_json do
param 'Any', :data
end
def to_json(data)
data.to_json
end
end

View File

@@ -1,38 +0,0 @@
# Take a data structure and output it as pretty JSON
#
# @example how to output pretty JSON
# # output pretty json to a file
# file { '/tmp/my.json':
# ensure => file,
# content => to_json_pretty($myhash),
# }
#
# @example how to output pretty JSON skipping over keys with undef values
# # output pretty JSON to a file skipping over undef values
# file { '/tmp/my.json':
# ensure => file,
# content => to_json_pretty({
# param_one => 'value',
# param_two => undef,
# }),
# }
#
require 'json'
Puppet::Functions.create_function(:to_json_pretty) do
dispatch :to_json_pretty do
param 'Variant[Hash, Array]', :data
optional_param 'Boolean', :skip_undef
end
def to_json_pretty(data, skip_undef = false)
if skip_undef
if data.is_a? Array
data = data.reject { |value| value.nil? }
elsif data.is_a? Hash
data = data.reject { |_, value| value.nil? }
end
end
JSON.pretty_generate(data) << "\n"
end
end

View File

@@ -1,21 +0,0 @@
# Take a data structure and output it as YAML
#
# @example how to output YAML
# # output yaml to a file
# file { '/tmp/my.yaml':
# ensure => file,
# content => to_yaml($myhash),
# }
#
#
require 'yaml'
Puppet::Functions.create_function(:to_yaml) do
dispatch :to_yaml do
param 'Any', :data
end
def to_yaml(data)
data.to_yaml
end
end

View File

@@ -1,19 +0,0 @@
# Returns the type when passed a value.
#
# @example how to compare values' types
# # compare the types of two values
# if type_of($first_value) != type_of($second_value) { fail("first_value and second_value are different types") }
# @example how to compare against an abstract type
# unless type_of($first_value) <= Numeric { fail("first_value must be Numeric") }
# unless type_of{$first_value) <= Collection[1] { fail("first_value must be an Array or Hash, and contain at least one element") }
#
# See the documentation for "The Puppet Type System" for more information about types.
# See the `assert_type()` function for flexible ways to assert the type of a value.
#
# The built-in type() function in puppet is generally preferred over this function
# this function is provided for backwards compatibility.
Puppet::Functions.create_function(:type_of) do
def type_of(value)
Puppet::Pops::Types::TypeCalculator.infer_set(value)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_absolute_path) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_absolute_path', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::Absolute_Path. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_absolute_path', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_array) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_array', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::Array. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_array', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_bool) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_bool', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_bool', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_hash) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_hash', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::Hash. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_hash', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_integer) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_integer', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::Integer. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_integer', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_ip_address) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_ip_address', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::Ip_Address. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_ip_address', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_ipv4_address) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_ipv4_address', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::Ipv4_Address. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_ipv4_address', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_ipv6_address) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff
# -c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_ipv6_address', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::Ipv6_address. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_ipv6_address', args)
end
end

View File

@@ -1,62 +0,0 @@
Puppet::Functions.create_function(:validate_legacy) do
# The function checks a value against both the target_type (new) and the previous_validation function (old).
dispatch :validate_legacy do
param 'Any', :scope
param 'Type', :target_type
param 'String', :function_name
param 'Any', :value
repeated_param 'Any', :args
end
dispatch :validate_legacy_s do
param 'Any', :scope
param 'String', :type_string
param 'String', :function_name
param 'Any', :value
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-
# c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def validate_legacy_s(scope, type_string, *args)
t = Puppet::Pops::Types::TypeParser.new.parse(type_string, scope)
validate_legacy(scope, t, *args)
end
def validate_legacy(scope, target_type, function_name, value, *prev_args)
if assert_type(target_type, value)
if previous_validation(scope, function_name, value, *prev_args)
# Silently passes
else
Puppet.notice("Accepting previously invalid value for target type '#{target_type}'")
end
else
inferred_type = Puppet::Pops::Types::TypeCalculator.infer_set(value)
error_msg = Puppet::Pops::Types::TypeMismatchDescriber.new.describe_mismatch("validate_legacy(#{function_name})", target_type, inferred_type)
if previous_validation(scope, function_name, value, *prev_args)
call_function('deprecation', 'validate_legacy', error_msg)
else
call_function('fail', error_msg)
end
end
end
def previous_validation(scope, function_name, value, *prev_args)
# Call the previous validation function and catch any errors. Return true if no errors are thrown.
scope.send("function_#{function_name}".to_s, [value, *prev_args])
true
rescue Puppet::ParseError
false
end
def assert_type(type, value)
Puppet::Pops::Types::TypeCalculator.instance?(type, value)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_numeric) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-
# c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_numeric', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::Numeric. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_numeric', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_re) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-
# c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_re', 'This method is deprecated, please use the stdlib validate_legacy function,
with Pattern[]. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_re', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_slength) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-
# c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_slength', 'This method is deprecated, please use the stdlib validate_legacy function,
with String[]. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_slength', args)
end
end

View File

@@ -1,18 +0,0 @@
Puppet::Functions.create_function(:validate_string) do
dispatch :deprecation_gen do
param 'Any', :scope
repeated_param 'Any', :args
end
# Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-
# c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
def call(scope, *args)
manipulated_args = [scope] + args
self.class.dispatcher.dispatch(self, scope, manipulated_args)
end
def deprecation_gen(scope, *args)
call_function('deprecation', 'validate_string', 'This method is deprecated, please use the stdlib validate_legacy function,
with Stdlib::Compat::String. There is further documentation for validate_legacy function in the README.')
scope.send('function_validate_string', args)
end
end

View File

@@ -1,33 +0,0 @@
#
# abs.rb
#
module Puppet::Parser::Functions
newfunction(:abs, :type => :rvalue, :doc => <<-DOC
Returns the absolute value of a number, for example -34.56 becomes
34.56. Takes a single integer and float value as an argument.
DOC
) do |arguments|
raise(Puppet::ParseError, "abs(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
value = arguments[0]
# Numbers in Puppet are often string-encoded which is troublesome ...
if value.is_a?(String)
if value =~ %r{^-?(?:\d+)(?:\.\d+){1}$}
value = value.to_f
elsif value =~ %r{^-?\d+$}
value = value.to_i
else
raise(Puppet::ParseError, 'abs(): Requires float or integer to work with')
end
end
# We have numeric value to handle ...
result = value.abs
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,29 +0,0 @@
#
# any2array.rb
#
module Puppet::Parser::Functions
newfunction(:any2array, :type => :rvalue, :doc => <<-DOC
This converts any object to an array containing that object. Empty argument
lists are converted to an empty array. Arrays are left untouched. Hashes are
converted to arrays of alternating keys and values.
DOC
) do |arguments|
if arguments.empty?
return []
end
return arguments unless arguments.length == 1
return arguments[0] if arguments[0].is_a?(Array)
if arguments[0].is_a?(Hash)
result = []
arguments[0].each do |key, value|
result << key << value
end
return result
end
return arguments
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,53 +0,0 @@
#
# any2bool.rb
#
module Puppet::Parser::Functions
newfunction(:any2bool, :type => :rvalue, :doc => <<-DOC
This converts 'anything' to a boolean. In practise it does the following:
* Strings such as Y,y,1,T,t,TRUE,yes,'true' will return true
* Strings such as 0,F,f,N,n,FALSE,no,'false' will return false
* Booleans will just return their original value
* Number (or a string representation of a number) > 0 will return true, otherwise false
* undef will return false
* Anything else will return true
DOC
) do |arguments|
raise(Puppet::ParseError, "any2bool(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
# If argument is already Boolean, return it
if !!arguments[0] == arguments[0] # rubocop:disable Style/DoubleNegation : Could not find a better way to check if a boolean
return arguments[0]
end
arg = arguments[0]
if arg.nil?
return false
end
if arg == :undef
return false
end
valid_float = begin
!!Float(arg) # rubocop:disable Style/DoubleNegation : Could not find a better way to check if a boolean
rescue
false
end
if arg.is_a?(Numeric)
return function_num2bool([arguments[0]])
end
if arg.is_a?(String)
return function_num2bool([arguments[0]]) if valid_float
return function_str2bool([arguments[0]])
end
return true
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,27 +0,0 @@
#
# assert_private.rb
#
module Puppet::Parser::Functions
newfunction(:assert_private, :doc => <<-DOC
Sets the current class or definition as private.
Calling the class or definition from outside the current module will fail.
DOC
) do |args|
raise(Puppet::ParseError, "assert_private(): Wrong number of arguments given (#{args.size}}) for 0 or 1)") if args.size > 1
scope = self
if scope.lookupvar('module_name') != scope.lookupvar('caller_module_name')
message = nil
if args[0] && args[0].is_a?(String)
message = args[0]
else
manifest_name = scope.source.name
manifest_type = scope.source.type
message = (manifest_type.to_s == 'hostclass') ? 'Class' : 'Definition'
message += " #{manifest_name} is private"
end
raise(Puppet::ParseError, message)
end
end
end

View File

@@ -1,67 +0,0 @@
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
module Puppet::Parser::Functions
newfunction(:base64, :type => :rvalue, :doc => <<-'DOC') do |args|
Base64 encode or decode a string based on the command and the string submitted
Usage:
$encodestring = base64('encode', 'thestring')
$decodestring = base64('decode', 'dGhlc3RyaW5n')
# explicitly define encode/decode method: default, strict, urlsafe
$method = 'default'
$encodestring = base64('encode', 'thestring', $method)
$decodestring = base64('decode', 'dGhlc3RyaW5n', $method)
DOC
require 'base64'
raise Puppet::ParseError, "base64(): Wrong number of arguments (#{args.length}; must be >= 2)" unless args.length >= 2
actions = %w[encode decode]
unless actions.include?(args[0])
raise Puppet::ParseError, "base64(): the first argument must be one of 'encode' or 'decode'"
end
unless args[1].is_a?(String)
raise Puppet::ParseError, 'base64(): the second argument must be a string to base64'
end
method = %w[default strict urlsafe]
chosen_method = if args.length <= 2
'default'
else
args[2]
end
unless method.include?(chosen_method)
raise Puppet::ParseError, "base64(): the third argument must be one of 'default', 'strict', or 'urlsafe'"
end
case args[0]
when 'encode'
case chosen_method
when 'default'
result = Base64.encode64(args[1])
when 'strict'
result = Base64.strict_encode64(args[1])
when 'urlsafe'
result = Base64.urlsafe_encode64(args[1])
end
when 'decode'
case chosen_method
when 'default'
result = Base64.decode64(args[1])
when 'strict'
result = Base64.strict_decode64(args[1])
when 'urlsafe'
result = Base64.urlsafe_decode64(args[1])
end
end
return result
end
end

View File

@@ -1,24 +0,0 @@
#
# basename.rb
#
module Puppet::Parser::Functions
newfunction(:basename, :type => :rvalue, :doc => <<-DOC
Strips directory (and optional suffix) from a filename
DOC
) do |arguments|
raise(Puppet::ParseError, 'basename(): No arguments given') if arguments.empty?
raise(Puppet::ParseError, "basename(): Too many arguments given (#{arguments.size})") if arguments.size > 2
raise(Puppet::ParseError, 'basename(): Requires string as first argument') unless arguments[0].is_a?(String)
rv = File.basename(arguments[0]) if arguments.size == 1
if arguments.size == 2
raise(Puppet::ParseError, 'basename(): Requires string as second argument') unless arguments[1].is_a?(String)
rv = File.basename(arguments[0], arguments[1])
end
return rv
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,24 +0,0 @@
#
# bool2num.rb
#
module Puppet::Parser::Functions
newfunction(:bool2num, :type => :rvalue, :doc => <<-DOC
Converts a boolean to a number. Converts the values:
false, f, 0, n, and no to 0
true, t, 1, y, and yes to 1
Requires a single boolean or string as an input.
DOC
) do |arguments|
raise(Puppet::ParseError, "bool2num(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
value = function_str2bool([arguments[0]])
# We have real boolean values as well ...
result = value ? 1 : 0
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,43 +0,0 @@
#
# bool2str.rb
#
module Puppet::Parser::Functions
newfunction(:bool2str, :type => :rvalue, :doc => <<-DOC
Converts a boolean to a string using optionally supplied arguments. The
optional second and third arguments represent what true and false will be
converted to respectively. If only one argument is given, it will be
converted from a boolean to a string containing 'true' or 'false'.
*Examples:*
bool2str(true) => 'true'
bool2str(true, 'yes', 'no') => 'yes'
bool2str(false, 't', 'f') => 'f'
Requires a single boolean as an input.
DOC
) do |arguments|
unless arguments.size == 1 || arguments.size == 3
raise(Puppet::ParseError, "bool2str(): Wrong number of arguments given (#{arguments.size} for 3)")
end
value = arguments[0]
true_string = arguments[1] || 'true'
false_string = arguments[2] || 'false'
klass = value.class
# We can have either true or false, and nothing else
unless [FalseClass, TrueClass].include?(klass)
raise(Puppet::ParseError, 'bool2str(): Requires a boolean to work with')
end
unless [true_string, false_string].all? { |x| x.is_a?(String) }
raise(Puppet::ParseError, 'bool2str(): Requires strings to convert to')
end
return value ? true_string : false_string
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,31 +0,0 @@
#
# camelcase.rb
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
#
module Puppet::Parser::Functions
newfunction(:camelcase, :type => :rvalue, :doc => <<-DOC
Converts the case of a string or all strings in an array to camel case.
DOC
) do |arguments|
raise(Puppet::ParseError, "camelcase(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
value = arguments[0]
klass = value.class
unless [Array, String].include?(klass)
raise(Puppet::ParseError, 'camelcase(): Requires either array or string to work with')
end
result = if value.is_a?(Array)
# Numbers in Puppet are often string-encoded which is troublesome ...
value.map { |i| i.is_a?(String) ? i.split('_').map { |e| e.capitalize }.join : i }
else
value.split('_').map { |e| e.capitalize }.join
end
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,29 +0,0 @@
#
# capitalize.rb
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
#
module Puppet::Parser::Functions
newfunction(:capitalize, :type => :rvalue, :doc => <<-DOC
Capitalizes the first letter of a string or array of strings.
Requires either a single string or an array as an input.
DOC
) do |arguments|
raise(Puppet::ParseError, "capitalize(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
value = arguments[0]
unless value.is_a?(Array) || value.is_a?(String)
raise(Puppet::ParseError, 'capitalize(): Requires either array or string to work with')
end
result = if value.is_a?(Array)
# Numbers in Puppet are often string-encoded which is troublesome ...
value.map { |i| i.is_a?(String) ? i.capitalize : i }
else
value.capitalize
end
return result
end
end

View File

@@ -1,25 +0,0 @@
#
# ceiling.rb
#
module Puppet::Parser::Functions
newfunction(:ceiling, :type => :rvalue, :doc => <<-DOC
Returns the smallest integer greater or equal to the argument.
Takes a single numeric value as an argument.
DOC
) do |arguments|
raise(Puppet::ParseError, "ceiling(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size != 1
begin
arg = Float(arguments[0])
rescue TypeError, ArgumentError => _e
raise(Puppet::ParseError, "ceiling(): Wrong argument type given (#{arguments[0]} for Numeric)")
end
raise(Puppet::ParseError, "ceiling(): Wrong argument type given (#{arg.class} for Numeric)") if arg.is_a?(Numeric) == false
arg.ceil
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,31 +0,0 @@
#
# chomp.rb
#
module Puppet::Parser::Functions
newfunction(:chomp, :type => :rvalue, :doc => <<-DOC
Removes the record separator from the end of a string or an array of
strings, for example `hello\n` becomes `hello`.
Requires a single string or array as an input.
DOC
) do |arguments|
raise(Puppet::ParseError, "chomp(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
value = arguments[0]
unless value.is_a?(Array) || value.is_a?(String)
raise(Puppet::ParseError, 'chomp(): Requires either array or string to work with')
end
result = if value.is_a?(Array)
# Numbers in Puppet are often string-encoded which is troublesome ...
value.map { |i| i.is_a?(String) ? i.chomp : i }
else
value.chomp
end
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,33 +0,0 @@
#
# chop.rb
#
module Puppet::Parser::Functions
newfunction(:chop, :type => :rvalue, :doc => <<-DOC
Returns a new string with the last character removed. If the string ends
with `\r\n`, both characters are removed. Applying chop to an empty
string returns an empty string. If you wish to merely remove record
separators then you should use the `chomp` function.
Requires a string or array of strings as input.
DOC
) do |arguments|
raise(Puppet::ParseError, "chop(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
value = arguments[0]
unless value.is_a?(Array) || value.is_a?(String)
raise(Puppet::ParseError, 'chop(): Requires either an array or string to work with')
end
result = if value.is_a?(Array)
# Numbers in Puppet are often string-encoded which is troublesome ...
value.map { |i| i.is_a?(String) ? i.chop : i }
else
value.chop
end
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,28 +0,0 @@
#
# clamp.rb
#
module Puppet::Parser::Functions
newfunction(:clamp, :type => :rvalue, :arity => -2, :doc => <<-DOC
Clamps value to a range.
DOC
) do |args|
args.flatten!
raise(Puppet::ParseError, 'clamp(): Wrong number of arguments, need three to clamp') if args.size != 3
# check values out
args.each do |value|
case [value.class]
when [String]
raise(Puppet::ParseError, "clamp(): Required explicit numeric (#{value}:String)") unless value =~ %r{^\d+$}
when [Hash]
raise(Puppet::ParseError, "clamp(): The Hash type is not allowed (#{value})")
end
end
# convert to numeric each element
# then sort them and get a middle value
args.map { |n| n.to_i }.sort[1]
end
end

View File

@@ -1,39 +0,0 @@
#
# concat.rb
#
module Puppet::Parser::Functions
newfunction(:concat, :type => :rvalue, :doc => <<-DOC
Appends the contents of multiple arrays into array 1.
*Example:*
concat(['1','2','3'],['4','5','6'],['7','8','9'])
Would result in:
['1','2','3','4','5','6','7','8','9']
DOC
) do |arguments|
# Check that more than 2 arguments have been given ...
raise(Puppet::ParseError, "concat(): Wrong number of arguments given (#{arguments.size} for < 2)") if arguments.size < 2
a = arguments[0]
# Check that the first parameter is an array
unless a.is_a?(Array)
raise(Puppet::ParseError, 'concat(): Requires array to work with')
end
result = a
arguments.shift
arguments.each do |x|
result += (x.is_a?(Array) ? x : [x])
end
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,36 +0,0 @@
#
# convert_base.rb
#
module Puppet::Parser::Functions
newfunction(:convert_base, :type => :rvalue, :arity => 2, :doc => <<-'DOC') do |args|
Converts a given integer or base 10 string representing an integer to a specified base, as a string.
Usage:
$binary_repr = convert_base(5, 2) # $binary_repr is now set to "101"
$hex_repr = convert_base("254", "16") # $hex_repr is now set to "fe"
DOC
raise Puppet::ParseError, 'convert_base(): First argument must be either a string or an integer' unless args[0].is_a?(Integer) || args[0].is_a?(String)
raise Puppet::ParseError, 'convert_base(): Second argument must be either a string or an integer' unless args[1].is_a?(Integer) || args[1].is_a?(String)
if args[0].is_a?(String)
raise Puppet::ParseError, 'convert_base(): First argument must be an integer or a string corresponding to an integer in base 10' unless args[0] =~ %r{^[0-9]+$}
end
if args[1].is_a?(String)
raise Puppet::ParseError, 'convert_base(): First argument must be an integer or a string corresponding to an integer in base 10' unless args[1] =~ %r{^[0-9]+$}
end
number_to_convert = args[0]
new_base = args[1]
number_to_convert = number_to_convert.to_i
new_base = new_base.to_i
raise Puppet::ParseError, 'convert_base(): base must be at least 2 and must not be greater than 36' unless new_base >= 2 && new_base <= 36
return number_to_convert.to_s(new_base)
end
end

View File

@@ -1,24 +0,0 @@
#
# count.rb
#
module Puppet::Parser::Functions
newfunction(:count, :type => :rvalue, :arity => -2, :doc => <<-DOC
Takes an array as first argument and an optional second argument.
Count the number of elements in array that matches second argument.
If called with only an array it counts the number of elements that are not nil/undef.
DOC
) do |args|
if args.size > 2
raise(ArgumentError, "count(): Wrong number of arguments given #{args.size} for 1 or 2.")
end
collection, item = args
if item
collection.count item
else
collection.count { |obj| !obj.nil? && obj != :undef && obj != '' }
end
end
end

View File

@@ -1,47 +0,0 @@
#
# deep_merge.rb
#
module Puppet::Parser::Functions
newfunction(:deep_merge, :type => :rvalue, :doc => <<-'DOC') do |args|
Recursively merges two or more hashes together and returns the resulting hash.
For example:
$hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
$hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
$merged_hash = deep_merge($hash1, $hash2)
# The resulting hash is equivalent to:
# $merged_hash = { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } }
When there is a duplicate key that is a hash, they are recursively merged.
When there is a duplicate key that is not a hash, the key in the rightmost hash will "win."
DOC
if args.length < 2
raise Puppet::ParseError, "deep_merge(): wrong number of arguments (#{args.length}; must be at least 2)"
end
deep_merge = proc do |hash1, hash2|
hash1.merge(hash2) do |_key, old_value, new_value|
if old_value.is_a?(Hash) && new_value.is_a?(Hash)
deep_merge.call(old_value, new_value)
else
new_value
end
end
end
result = {}
args.each do |arg|
next if arg.is_a?(String) && arg.empty? # empty string is synonym for puppet's undef
# If the argument was not a hash, skip it.
unless arg.is_a?(Hash)
raise Puppet::ParseError, "deep_merge: unexpected argument type #{arg.class}, only expects hash arguments"
end
result = deep_merge.call(result, arg)
end
return(result)
end
end

View File

@@ -1,57 +0,0 @@
# Test whether a given class or definition is defined
require 'puppet/parser/functions'
Puppet::Parser::Functions.newfunction(:defined_with_params,
:type => :rvalue,
:doc => <<-'DOC'
Takes a resource reference and an optional hash of attributes.
Returns true if a resource with the specified attributes has already been added
to the catalog, and false otherwise.
user { 'dan':
ensure => present,
}
if ! defined_with_params(User[dan], {'ensure' => 'present' }) {
user { 'dan': ensure => present, }
}
DOC
) do |vals|
reference, params = vals
raise(ArgumentError, 'Must specify a reference') unless reference
if !params || params == ''
params = {}
end
ret = false
if Puppet::Util::Package.versioncmp(Puppet.version, '4.6.0') >= 0
# Workaround for PE-20308
if reference.is_a?(String)
type_name, title = Puppet::Resource.type_and_title(reference, nil)
type = Puppet::Pops::Evaluator::Runtime3ResourceSupport.find_resource_type_or_class(find_global_scope, type_name.downcase)
elsif reference.is_a?(Puppet::Resource)
type = reference.resource_type
title = reference.title
else
raise(ArgumentError, "Reference is not understood: '#{reference.class}'")
end
# end workaround
else
type = reference.to_s
title = nil
end
resource = findresource(type, title)
if resource
matches = params.map do |key, value|
# eql? avoids bugs caused by monkeypatching in puppet
resource_is_undef = resource[key].eql?(:undef) || resource[key].nil?
value_is_undef = value.eql?(:undef) || value.nil?
(resource_is_undef && value_is_undef) || (resource[key] == value)
end
ret = params.empty? || !matches.include?(false)
end
Puppet.debug("Resource #{reference} was not determined to be defined")
ret
end

View File

@@ -1,42 +0,0 @@
#
# delete.rb
#
module Puppet::Parser::Functions
newfunction(:delete, :type => :rvalue, :doc => <<-DOC
Deletes all instances of a given element from an array, substring from a
string, or key from a hash.
*Examples:*
delete(['a','b','c','b'], 'b')
Would return: ['a','c']
delete({'a'=>1,'b'=>2,'c'=>3}, 'b')
Would return: {'a'=>1,'c'=>3}
delete({'a'=>1,'b'=>2,'c'=>3}, ['b','c'])
Would return: {'a'=>1}
delete('abracadabra', 'bra')
Would return: 'acada'
DOC
) do |arguments|
raise(Puppet::ParseError, "delete(): Wrong number of arguments given #{arguments.size} for 2") unless arguments.size == 2
collection = arguments[0].dup
Array(arguments[1]).each do |item|
case collection
when Array, Hash
collection.delete item
when String
collection.gsub! item, ''
else
raise(TypeError, "delete(): First argument must be an Array, String, or Hash. Given an argument of class #{collection.class}.")
end
end
collection
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,45 +0,0 @@
#
# delete_at.rb
#
module Puppet::Parser::Functions
newfunction(:delete_at, :type => :rvalue, :doc => <<-DOC
Deletes a determined indexed value from an array.
*Examples:*
delete_at(['a','b','c'], 1)
Would return: ['a','c']
DOC
) do |arguments|
raise(Puppet::ParseError, "delete_at(): Wrong number of arguments given (#{arguments.size} for 2)") if arguments.size < 2
array = arguments[0]
unless array.is_a?(Array)
raise(Puppet::ParseError, 'delete_at(): Requires array to work with')
end
index = arguments[1]
if index.is_a?(String) && !index.match(%r{^\d+$})
raise(Puppet::ParseError, 'delete_at(): You must provide non-negative numeric index')
end
result = array.clone
# Numbers in Puppet are often string-encoded which is troublesome ...
index = index.to_i
if index > result.size - 1 # First element is at index 0 is it not?
raise(Puppet::ParseError, 'delete_at(): Given index exceeds size of array given')
end
result.delete_at(index) # We ignore the element that got deleted ...
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,43 +0,0 @@
#
# delete_regex.rb
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
#
module Puppet::Parser::Functions
newfunction(:delete_regex, :type => :rvalue, :doc => <<-DOC
deletes all instances of a given element that match a regular expression
from an array or key from a hash. Multiple regular expressions are assumed
to be matched as an OR.
*Examples:*
delete_regex(['a','b','c','b'], 'b')
Would return: ['a','c']
delete_regex(['a','b','c','b'], ['b', 'c'])
Would return: ['a']
delete_regex({'a'=>1,'b'=>2,'c'=>3}, 'b')
Would return: {'a'=>1,'c'=>3}
delete_regex({'a'=>1,'b'=>2,'c'=>3}, '^a$')
Would return: {'b'=>2,'c'=>3}
DOC
) do |arguments|
raise(Puppet::ParseError, "delete_regex(): Wrong number of arguments given #{arguments.size} for 2") unless arguments.size == 2
collection = arguments[0].dup
Array(arguments[1]).each do |item|
case collection
when Array, Hash, String
collection.reject! { |coll_item| (coll_item =~ %r{\b#{item}\b}) }
else
raise(TypeError, "delete_regex(): First argument must be an Array, Hash, or String. Given an argument of class #{collection.class}.")
end
end
collection
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,34 +0,0 @@
#
# delete_undef_values.rb
#
module Puppet::Parser::Functions
newfunction(:delete_undef_values, :type => :rvalue, :doc => <<-DOC
Returns a copy of input hash or array with all undefs deleted.
*Examples:*
$hash = delete_undef_values({a=>'A', b=>'', c=>undef, d => false})
Would return: {a => 'A', b => '', d => false}
$array = delete_undef_values(['A','',undef,false])
Would return: ['A','',false]
DOC
) do |args|
raise(Puppet::ParseError, "delete_undef_values(): Wrong number of arguments given (#{args.size})") if args.empty?
unless args[0].is_a?(Array) || args[0].is_a?(Hash)
raise(Puppet::ParseError, "delete_undef_values(): expected an array or hash, got #{args[0]} type #{args[0].class} ")
end
result = args[0].dup
if result.is_a?(Hash)
result.delete_if { |_key, val| val.equal? :undef }
elsif result.is_a?(Array)
result.delete :undef
end
result
end
end

View File

@@ -1,26 +0,0 @@
#
# delete_values.rb
#
module Puppet::Parser::Functions
newfunction(:delete_values, :type => :rvalue, :doc => <<-DOC
Deletes all instances of a given value from a hash.
*Examples:*
delete_values({'a'=>'A','b'=>'B','c'=>'C','B'=>'D'}, 'B')
Would return: {'a'=>'A','c'=>'C','B'=>'D'}
DOC
) do |arguments|
raise(Puppet::ParseError, "delete_values(): Wrong number of arguments given (#{arguments.size} of 2)") if arguments.size != 2
hash, item = arguments
unless hash.is_a?(Hash)
raise(TypeError, "delete_values(): First argument must be a Hash. Given an argument of class #{hash.class}.")
end
hash.dup.delete_if { |_key, val| item == val }
end
end

View File

@@ -1,19 +0,0 @@
#
# deprecation.rb
#
module Puppet::Parser::Functions
newfunction(:deprecation, :doc => <<-DOC
Function to print deprecation warnings (this is the 3.X version of it), The uniqueness key - can appear once. The msg is the message text including any positional information that is formatted by the user/caller of the method.).
DOC
) do |arguments|
raise(Puppet::ParseError, "deprecation: Wrong number of arguments given (#{arguments.size} for 2)") unless arguments.size == 2
key = arguments[0]
message = arguments[1]
if ENV['STDLIB_LOG_DEPRECATIONS'] == 'true'
warning("deprecation. #{key}. #{message}")
end
end
end

View File

@@ -1,34 +0,0 @@
#
# difference.rb
#
module Puppet::Parser::Functions
newfunction(:difference, :type => :rvalue, :doc => <<-DOC
This function returns the difference between two arrays.
The returned array is a copy of the original array, removing any items that
also appear in the second array.
*Examples:*
difference(["a","b","c"],["b","c","d"])
Would return: ["a"]
DOC
) do |arguments|
# Two arguments are required
raise(Puppet::ParseError, "difference(): Wrong number of arguments given (#{arguments.size} for 2)") if arguments.size != 2
first = arguments[0]
second = arguments[1]
unless first.is_a?(Array) && second.is_a?(Array)
raise(Puppet::ParseError, 'difference(): Requires 2 arrays')
end
result = first - second
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,15 +0,0 @@
#
# dig.rb
#
module Puppet::Parser::Functions
newfunction(:dig, :type => :rvalue, :doc => <<-DOC
DEPRECATED: This function has been replaced in Puppet 4.5.0, please use dig44() for backwards compatibility or use the new version.
DOC
) do |arguments|
warning('dig() DEPRECATED: This function has been replaced in Puppet 4.5.0, please use dig44() for backwards compatibility or use the new version.')
unless Puppet::Parser::Functions.autoloader.loaded?(:dig44)
Puppet::Parser::Functions.autoloader.load(:dig44)
end
function_dig44(arguments)
end
end

View File

@@ -1,65 +0,0 @@
#
# dig44.rb
#
module Puppet::Parser::Functions
newfunction(
:dig44,
:type => :rvalue,
:arity => -2,
:doc => <<-DOC
DEPRECATED: This function has been replaced in puppet 4.5.0.
Looks up into a complex structure of arrays and hashes and returns a value
or the default value if nothing was found.
Key can contain slashes to describe path components. The function will go down
the structure and try to extract the required value.
$data = {
'a' => {
'b' => [
'b1',
'b2',
'b3',
]
}
}
$value = dig44($data, ['a', 'b', '2'], 'not_found')
=> $value = 'b3'
a -> first hash key
b -> second hash key
2 -> array index starting with 0
not_found -> (optional) will be returned if there is no value or the path
did not match. Defaults to nil.
In addition to the required "key" argument, the function accepts a default
argument. It will be returned if no value was found or a path component is
missing. And the fourth argument can set a variable path separator.
DOC
) do |arguments|
# Two arguments are required
raise(Puppet::ParseError, "dig44(): Wrong number of arguments given (#{arguments.size} for at least 2)") if arguments.size < 2
data, path, default = *arguments
raise(Puppet::ParseError, "dig44(): first argument must be a hash or an array, given #{data.class.name}") unless data.is_a?(Hash) || data.is_a?(Array)
raise(Puppet::ParseError, "dig44(): second argument must be an array, given #{path.class.name}") unless path.is_a? Array
value = path.reduce(data) do |structure, key|
break unless structure.is_a?(Hash) || structure.is_a?(Array)
if structure.is_a? Array
begin
key = Integer key
rescue
break
end
end
break if structure[key].nil? || structure[key] == :undef
structure[key]
end
value.nil? ? default : value
end
end

View File

@@ -1,24 +0,0 @@
#
# dirname.rb
#
module Puppet::Parser::Functions
newfunction(:dirname, :type => :rvalue, :doc => <<-DOC
Returns the dirname of a path.
DOC
) do |arguments|
if arguments.empty?
raise(Puppet::ParseError, 'dirname(): No arguments given')
end
if arguments.size > 1
raise(Puppet::ParseError, "dirname(): Too many arguments given (#{arguments.size})")
end
unless arguments[0].is_a?(String)
raise(Puppet::ParseError, 'dirname(): Requires string as argument')
end
return File.dirname(arguments[0])
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,15 +0,0 @@
# Custom Puppet function to convert dos to unix format
module Puppet::Parser::Functions
newfunction(:dos2unix, :type => :rvalue, :arity => 1, :doc => <<-DOC
Returns the Unix version of the given string.
Takes a single string argument.
DOC
) do |arguments|
unless arguments[0].is_a?(String)
raise(Puppet::ParseError, 'dos2unix(): Requires string as argument')
end
arguments[0].gsub(%r{\r\n}, "\n")
end
end

View File

@@ -1,30 +0,0 @@
#
# downcase.rb
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
#
module Puppet::Parser::Functions
newfunction(:downcase, :type => :rvalue, :doc => <<-DOC
Converts the case of a string or all strings in an array to lower case.
DOC
) do |arguments|
raise(Puppet::ParseError, "downcase(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
value = arguments[0]
unless value.is_a?(Array) || value.is_a?(String)
raise(Puppet::ParseError, 'downcase(): Requires either array or string to work with')
end
result = if value.is_a?(Array)
# Numbers in Puppet are often string-encoded which is troublesome ...
value.map { |i| i.is_a?(String) ? i.downcase : i }
else
value.downcase
end
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,23 +0,0 @@
#
# empty.rb
#
module Puppet::Parser::Functions
newfunction(:empty, :type => :rvalue, :doc => <<-DOC
Returns true if the variable is empty.
DOC
) do |arguments|
raise(Puppet::ParseError, "empty(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
value = arguments[0]
unless value.is_a?(Array) || value.is_a?(Hash) || value.is_a?(String) || value.is_a?(Numeric)
raise(Puppet::ParseError, 'empty(): Requires either array, hash, string or integer to work with')
end
return false if value.is_a?(Numeric)
result = value.empty?
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,41 +0,0 @@
#
# enclose_ipv6.rb
#
module Puppet::Parser::Functions
newfunction(:enclose_ipv6, :type => :rvalue, :doc => <<-DOC
Takes an array of ip addresses and encloses the ipv6 addresses with square brackets.
DOC
) do |arguments|
require 'ipaddr'
rescuable_exceptions = [ArgumentError]
if defined?(IPAddr::InvalidAddressError)
rescuable_exceptions << IPAddr::InvalidAddressError
end
if arguments.size != 1
raise(Puppet::ParseError, "enclose_ipv6(): Wrong number of arguments given #{arguments.size} for 1")
end
unless arguments[0].is_a?(String) || arguments[0].is_a?(Array)
raise(Puppet::ParseError, "enclose_ipv6(): Wrong argument type given #{arguments[0].class} expected String or Array")
end
input = [arguments[0]].flatten.compact
result = []
input.each do |val|
unless val == '*'
begin
ip = IPAddr.new(val)
rescue *rescuable_exceptions
raise(Puppet::ParseError, "enclose_ipv6(): Wrong argument given #{val} is not an ip address.")
end
val = "[#{ip}]" if ip.ipv6?
end
result << val
end
return result.uniq
end
end

View File

@@ -1,50 +0,0 @@
#
# ensure_packages.rb
#
module Puppet::Parser::Functions
newfunction(:ensure_packages, :type => :statement, :doc => <<-DOC
Takes a list of packages and only installs them if they don't already exist.
It optionally takes a hash as a second parameter that will be passed as the
third argument to the ensure_resource() function.
DOC
) do |arguments|
raise(Puppet::ParseError, "ensure_packages(): Wrong number of arguments given (#{arguments.size} for 1 or 2)") if arguments.size > 2 || arguments.empty?
raise(Puppet::ParseError, 'ensure_packages(): Requires second argument to be a Hash') if arguments.size == 2 && !arguments[1].is_a?(Hash)
if arguments[0].is_a?(Hash)
if arguments[1]
defaults = { 'ensure' => 'present' }.merge(arguments[1])
if defaults['ensure'] == 'installed'
defaults['ensure'] = 'present'
end
else
defaults = { 'ensure' => 'present' }
end
Puppet::Parser::Functions.function(:ensure_resources)
function_ensure_resources(['package', arguments[0].dup, defaults])
else
packages = Array(arguments[0])
if arguments[1]
defaults = { 'ensure' => 'present' }.merge(arguments[1])
if defaults['ensure'] == 'installed'
defaults['ensure'] = 'present'
end
else
defaults = { 'ensure' => 'present' }
end
Puppet::Parser::Functions.function(:ensure_resource)
packages.each do |package_name|
raise(Puppet::ParseError, 'ensure_packages(): Empty String provided for package name') if package_name.empty?
unless findresource("Package[#{package_name}]")
function_ensure_resource(['package', package_name, defaults])
end
end
end
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,46 +0,0 @@
# Test whether a given class or definition is defined
require 'puppet/parser/functions'
Puppet::Parser::Functions.newfunction(:ensure_resource,
:type => :statement,
:doc => <<-'DOC'
Takes a resource type, title, and a list of attributes that describe a
resource.
user { 'dan':
ensure => present,
}
This example only creates the resource if it does not already exist:
ensure_resource('user', 'dan', {'ensure' => 'present' })
If the resource already exists but does not match the specified parameters,
this function will attempt to recreate the resource leading to a duplicate
resource definition error.
An array of resources can also be passed in and each will be created with
the type and parameters specified if it doesn't already exist.
ensure_resource('user', ['dan','alex'], {'ensure' => 'present'})
DOC
) do |vals|
type, title, params = vals
raise(ArgumentError, 'Must specify a type') unless type
raise(ArgumentError, 'Must specify a title') unless title
params ||= {}
items = [title].flatten
items.each do |item|
Puppet::Parser::Functions.function(:defined_with_params)
if function_defined_with_params(["#{type}[#{item}]", params])
Puppet.debug("Resource #{type}[#{item}] with params #{params} not created because it already exists")
else
Puppet.debug("Create new resource #{type}[#{item}] with params #{params}")
Puppet::Parser::Functions.function(:create_resources)
function_create_resources([type.capitalize, { item => params }])
end
end
end

View File

@@ -1,50 +0,0 @@
require 'puppet/parser/functions'
Puppet::Parser::Functions.newfunction(:ensure_resources,
:type => :statement,
:doc => <<-'DOC'
Takes a resource type, title (only hash), and a list of attributes that describe a
resource.
user { 'dan':
gid => 'mygroup',
ensure => present,
}
An hash of resources should be passed in and each will be created with
the type and parameters specified if it doesn't already exist.
ensure_resources('user', {'dan' => { gid => 'mygroup', uid => '600' } , 'alex' => { gid => 'mygroup' }}, {'ensure' => 'present'})
From Hiera Backend:
userlist:
dan:
gid: 'mygroup'
uid: '600'
alex:
gid: 'mygroup'
Call:
ensure_resources('user', hiera_hash('userlist'), {'ensure' => 'present'})
DOC
) do |vals|
type, title, params = vals
raise(ArgumentError, 'Must specify a type') unless type
raise(ArgumentError, 'Must specify a title') unless title
params ||= {}
raise(Puppet::ParseError, 'ensure_resources(): Requires second argument to be a Hash') unless title.is_a?(Hash)
resource_hash = title.dup
resources = resource_hash.keys
Puppet::Parser::Functions.function(:ensure_resource)
resources.each do |resource_name|
params_merged = if resource_hash[resource_name]
params.merge(resource_hash[resource_name])
else
params
end
function_ensure_resource([type, resource_name, params_merged])
end
end

View File

@@ -1,31 +0,0 @@
#
# flatten.rb
#
module Puppet::Parser::Functions
newfunction(:flatten, :type => :rvalue, :doc => <<-DOC
This function flattens any deeply nested arrays and returns a single flat array
as a result.
*Examples:*
flatten(['a', ['b', ['c']]])
Would return: ['a','b','c']
DOC
) do |arguments|
raise(Puppet::ParseError, "flatten(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size != 1
array = arguments[0]
unless array.is_a?(Array)
raise(Puppet::ParseError, 'flatten(): Requires array to work with')
end
result = array.flatten
return result
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,25 +0,0 @@
#
# floor.rb
#
module Puppet::Parser::Functions
newfunction(:floor, :type => :rvalue, :doc => <<-DOC
Returns the largest integer less or equal to the argument.
Takes a single numeric value as an argument.
DOC
) do |arguments|
raise(Puppet::ParseError, "floor(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size != 1
begin
arg = Float(arguments[0])
rescue TypeError, ArgumentError => _e
raise(Puppet::ParseError, "floor(): Wrong argument type given (#{arguments[0]} for Numeric)")
end
raise(Puppet::ParseError, "floor(): Wrong argument type given (#{arg.class} for Numeric)") if arg.is_a?(Numeric) == false
arg.floor
end
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,35 +0,0 @@
Puppet::Parser::Functions.newfunction(
:fqdn_rand_string,
:arity => -2,
:type => :rvalue,
:doc => "Usage: `fqdn_rand_string(LENGTH, [CHARSET], [SEED])`. LENGTH is
required and must be a positive integer. CHARSET is optional and may be
`undef` or a string. SEED is optional and may be any number or string.
Generates a random string LENGTH characters long using the character set
provided by CHARSET, combining the `$fqdn` fact and the value of SEED for
repeatable randomness. (That is, each node will get a different random
string from this function, but a given node's result will be the same every
time unless its hostname changes.) Adding a SEED can be useful if you need
more than one unrelated string. CHARSET will default to alphanumeric if
`undef` or an empty string.",
) do |args|
raise(ArgumentError, 'fqdn_rand_string(): wrong number of arguments (0 for 1)') if args.empty?
Puppet::Parser::Functions.function('is_integer')
raise(ArgumentError, 'fqdn_rand_string(): first argument must be a positive integer') unless function_is_integer([args[0]]) && args[0].to_i > 0
raise(ArgumentError, 'fqdn_rand_string(): second argument must be undef or a string') unless args[1].nil? || args[1].is_a?(String)
Puppet::Parser::Functions.function('fqdn_rand')
length = args.shift.to_i
charset = args.shift.to_s.chars.to_a
charset = (0..9).map { |i| i.to_s } + ('A'..'Z').to_a + ('a'..'z').to_a if charset.empty?
rand_string = ''
for current in 1..length # rubocop:disable Style/For : An each loop would not work correctly in this circumstance
rand_string << charset[function_fqdn_rand([charset.size, (args + [current.to_s]).join(':')]).to_i]
end
rand_string
end

View File

@@ -1,59 +0,0 @@
#
# fqdn_rotate.rb
#
Puppet::Parser::Functions.newfunction(
:fqdn_rotate,
:type => :rvalue,
:doc => "Usage: `fqdn_rotate(VALUE, [SEED])`. VALUE is required and
must be an array or a string. SEED is optional and may be any number
or string.
Rotates VALUE a random number of times, combining the `$fqdn` fact and
the value of SEED for repeatable randomness. (That is, each node will
get a different random rotation from this function, but a given node's
result will be the same every time unless its hostname changes.) Adding
a SEED can be useful if you need more than one unrelated rotation.",
) do |args|
raise(Puppet::ParseError, "fqdn_rotate(): Wrong number of arguments given (#{args.size} for 1)") if args.empty?
value = args.shift
require 'digest/md5'
unless value.is_a?(Array) || value.is_a?(String)
raise(Puppet::ParseError, 'fqdn_rotate(): Requires either array or string to work with')
end
result = value.clone
string = value.is_a?(String) ? true : false
# Check whether it makes sense to rotate ...
return result if result.size <= 1
# We turn any string value into an array to be able to rotate ...
result = string ? result.split('') : result
elements = result.size
seed = Digest::MD5.hexdigest([lookupvar('::fqdn'), args].join(':')).hex
# deterministic_rand() was added in Puppet 3.2.0; reimplement if necessary
if Puppet::Util.respond_to?(:deterministic_rand)
offset = Puppet::Util.deterministic_rand(seed, elements).to_i
else
return offset = Random.new(seed).rand(elements) if defined?(Random) == 'constant' && Random.class == Class
old_seed = srand(seed)
offset = rand(elements)
srand(old_seed)
end
offset.times do
result.push result.shift
end
result = string ? result.join : result
return result
end
# vim: set ts=2 sw=2 et :

View File

@@ -1,86 +0,0 @@
require 'digest/sha1'
#
# fqdn_uuid.rb
#
module Puppet::Parser::Functions
newfunction(:fqdn_uuid, :type => :rvalue, :doc => <<-DOC) do |args|
Creates a UUID based on a given string, assumed to be the FQDN
For example, to generate a UUID based on the FQDN of a system:
Usage:
$uuid = fqdn_uuid($::fqdn)
The generated UUID will be the same for the given hostname
The resulting UUID is returned on the form:
1d839dea-5e10-5243-88eb-e66815bd7d5c
(u.e. without any curly braces.)
The generated UUID is a version 5 UUID with the V5 DNS namespace:
6ba7b810-9dad-11d1-80b4-00c04fd430c8
This only supports a the V5 SHA-1 hash, using the DNS namespace.
Please consult http://www.ietf.org/rfc/rfc4122.txt for the details on
UUID generation and example implementation.
No verification is present at the moment as whether the domain name given
is in fact a correct fully-qualified domain name. Therefore any arbitrary
string and/or alpha-numeric value can subside for a domain name.
DOC
raise(ArgumentError, 'fqdn_uuid: No arguments given') if args.empty?
raise(ArgumentError, "fqdn_uuid: Too many arguments given (#{args.length})") unless args.length == 1
fqdn = args[0]
# Code lovingly taken from
# https://github.com/puppetlabs/marionette-collective/blob/master/lib/mcollective/ssl.rb
# This is the UUID version 5 type DNS name space which is as follows:
#
# 6ba7b810-9dad-11d1-80b4-00c04fd430c8
#
uuid_name_space_dns = [0x6b,
0xa7,
0xb8,
0x10,
0x9d,
0xad,
0x11,
0xd1,
0x80,
0xb4,
0x00,
0xc0,
0x4f,
0xd4,
0x30,
0xc8].map { |b| b.chr }.join
sha1 = Digest::SHA1.new
sha1.update(uuid_name_space_dns)
sha1.update(fqdn)
# first 16 bytes..
bytes = sha1.digest[0, 16].bytes.to_a
# version 5 adjustments
bytes[6] &= 0x0f
bytes[6] |= 0x50
# variant is DCE 1.1
bytes[8] &= 0x3f
bytes[8] |= 0x80
bytes = [4, 2, 2, 2, 6].map do |i|
bytes.slice!(0, i).pack('C*').unpack('H*')
end
bytes.join('-')
end
end

View File

@@ -1,18 +0,0 @@
#
# get_module_path.rb
#
module Puppet::Parser::Functions
newfunction(:get_module_path, :type => :rvalue, :doc => <<-DOC
Returns the absolute path of the specified module for the current
environment.
Example:
$module_path = get_module_path('stdlib')
DOC
) do |args|
raise(Puppet::ParseError, 'get_module_path(): Wrong number of arguments, expects one') unless args.size == 1
module_path = Puppet::Module.find(args[0], compiler.environment.to_s)
raise(Puppet::ParseError, "Could not find module #{args[0]} in environment #{compiler.environment}") unless module_path
module_path.path
end
end

View File

@@ -1,36 +0,0 @@
# Test whether a given class or definition is defined
require 'puppet/parser/functions'
Puppet::Parser::Functions.newfunction(:getparam,
:type => :rvalue,
:doc => <<-'DOC'
Takes a resource reference and name of the parameter and
returns value of resource's parameter.
*Examples:*
define example_resource($param) {
}
example_resource { "example_resource_instance":
param => "param_value"
}
getparam(Example_resource["example_resource_instance"], "param")
Would return: param_value
DOC
) do |vals|
reference, param = vals
raise(ArgumentError, 'Must specify a reference') unless reference
raise(ArgumentError, 'Must specify name of a parameter') unless param && param.instance_of?(String)
return '' if param.empty?
resource = findresource(reference.to_s)
if resource
return resource[param] unless resource[param].nil?
end
return ''
end

Some files were not shown because too many files have changed in this diff Show More