summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-10-13Merge remote-tracking branch 'origin/master' into leap_masterHEADmasterVarac
2017-09-29(maint) Clarify docs and add new testsAlex Harvey
Based on a Stack Overflow question, it was noted that the documentation for `file_line` isn't complete and the underlying behaviour somewhat confusing. https://stackoverflow.com/questions/46468922/how-to-change-the-contents-of-a-file-by-using-puppet/46473458 In this patch I add additional unit tests and better examples and complete documentation.
2017-09-25Merge pull request #777 from alexjfisher/fix_test_filenamesTP Honey
Fix filenames of two function spec tests
2017-08-31Merge pull request #810 from eputnam/pw_hash_fixHunter Haugen
(MODULES-5546) add check for pw_hash
2017-08-28(MODULES-5546) add check for pw_hashEric Putnam
Older versions of Puppet end up choking on the sensitive data type check in the pw_hash function added in 42d4ea7af9197f77a3062727eb166c719ca6296a. this adds a check for the Sensitive class and then the type of the arg, so that if the class has not been declared, it will just move on.
2017-08-25Added to_json function with tests and READMEWhatsARanjit
2017-07-31Merge pull request #753 from frapex/masterTP Honey
Add validate_domain_name function
2017-07-27(maint) move/rewrite round() as ruby functionEric Putnam
2017-07-26Merge pull request #717 from ripclawffb/filelineoptionEric Putnam
Add new file_line option append_on_no_match
2017-07-21Merge pull request #787 from reidmv/fact_functionHunter Haugen
(FACT-932) Add new function, fact()
2017-07-18Add new file_line option append_on_no_matchasif.shaikh
2017-07-18(MODULES-4908) adds support for sensitive data type to pw_hashEric Putnam
Also includes a small fix to integer_spec so tests pass.
2017-07-14Merge pull request #794 from ↵TP Honey
tkishel/MODULES-5003-file_line_does_not_change_multiple_lines_when_one_matches (MODULES-5003) file_line does not change multiple lines when one matches
2017-07-14FM-6239 clean up for puppet 5.tests/deprecationtphoney
2017-07-13(MODULES-5003) file_line_does_not_change_multiple_lines_when_one_matchestkishel
The exists? method is called to determine the need to call the create and destroy methods. When the ensure, match, and multiple attributes are defined, the exists? method needs to return false unless all the lines that match the match attribute equal the line attribute. The first commit is minimal, and implements this change. The second commit normalizes the code, which I needed for comprehension.
2017-07-13(MODULES-5003) file_line_does_not_change_multiple_lines_when_one_matchestkishel
The exists? method is called to determine the need to call the create and destroy methods. When the ensure, match, and multiple attributes are defined, the exists? method needs to return false unless all the lines that match the match attribute equal the line attribute. The first commit is minimal, and implements this change. The second commit normalizes the code, which I needed for comprehension.
2017-07-11Fix filenames of two function spec testsAlexander Fisher
The tests weren't being run. Total tests increase from 2742 to 2769. Also fix 'when using a class extending String' test. It had been failing with... ``` RuntimeError: can't modify frozen AlsoString ```
2017-07-08Add validate_domain_name functionFrank de Jong
2017-07-07Merge pull request #716 from EmersonPrado/MODULES-4377TP Honey
(Modules 4377) Causes ensure_packages to accept concurrent declarations with ensure => 'present' and 'installed'
2017-07-07Merge pull request #788 from tphoney/MODULES-5003Eric Putnam
(MODULES-5003) file_line fix all broken lines
2017-07-03Revert "Allow use of fact() on other hashes"Reid Vandewiele
This reverts commit 409a974095a3f5b637e091494b5d14b451c5de78. After thinking about this, use case, and function naming, I think it's probably best for now to keep things simple and let `fact()` be single-purpose for looking up facts with no potentially confusing extensions. The only use case where the name makes sense is where it's being used on the `$facts` hash, and I think we'd rather in that circumstance promote the raw use of `fact()`.
2017-07-03(MODULES-5003) file_line fix all broken linestphoney
2017-06-30(FACT-932) Allow use of fact() on other hashesReid Vandewiele
Because sometimes people want to use an alternative data set, but treat it like it's a set of facts.
2017-06-30(FACT-932) Add new function, fact()Reid Vandewiele
The fact() function allows dot-notation reference to facts. It is an alternative to using $facts directly with array-indexing. Array-indexing is often onerous to use since it doesn't align with how structured facts are accessed elsewhere in the ecosystem and if any element in a multi-step path doesn't exist, array indexing can cause a compilation failure. Example usage: fact('os.family')
2017-06-28(MODULES-5113) Make line support SensitiveReid Vandewiele
Do this by making it a property. The idea is to get rid of the warning that appears when a Sensitive value is passed to the line attribute.
2017-06-14(MODULES-5095) Workaround for PUP-7650Thomas Hallgren
This commit adds a simple workaround for the problem described in PUP-7650. The workaround is harmless and can remain in place regardless of if the fix for PUP-7650 is in place or not.
2017-05-09Fix issue where the following causes obscure catalog compilation errors:Alex Dacre
``` file { '/tmp/somefile': ensure => 'file', } File['/tmp/somefile'] -> Package <| |> ensure_packages($somearray) ``` If $somearray is undefined or one of the elements contains an empty string, an error like the following is thrown: Could not find resource 'Package[]' for relationship from 'File[/tmp/somefile]' on node $::fqdn
2017-05-09(PE-20308) Also fix defined type strings & referencesHunter Haugen
2017-04-26(PE-20308) Correct boundary for 4.5 vs 4.6Hunter Haugen
2017-04-25(PE-20308) Pass a literal type and not a string to findresourceHunter Haugen
- `defined_with_params` calls `findresource(reference.to_s)` - `findresource` is https://github.com/puppetlabs/puppet/blob/4.8.1/lib/puppet/parser/compiler.rb#L407 and points to https://github.com/puppetlabs/puppet/blob/4.8.1/lib/puppet/resource/catalog.rb#L352 - This calls `Puppet::Resource.new` with the type https://github.com/puppetlabs/puppet/blob/4.8.1/lib/puppet/resource/catalog.rb#L366 - This ends up calling `resource_type` via https://github.com/puppetlabs/puppet/blob/4.8.1/lib/puppet/resource.rb#L317-L319 and that ends up declaring the type via the autoloader api at https://github.com/puppetlabs/puppet/blob/4.8.1/lib/puppet/resource.rb#L390 - But why does the autoloader API fail to find it in the current environment? - Okay, so when the autoloader is trying to find the type, it uses the typeloader to look it up in the current environment https://github.com/puppetlabs/puppet/blob/4.8.1/lib/puppet/metatype/manager.rb#L171 - this calls `get_file` and `mark_loaded` https://github.com/puppetlabs/puppet/blob/4.8.1/lib/puppet/util/autoload.rb#L64-L67 Suggested workaround is to pass a literal type instead of a string to `findresource` to fix in stdlib, and also to fix loading/requiring of type in core puppet. This seems to affect more recent versions of puppet, so fallback to original behavior on pre-4.5
2017-04-18Ruby 1.8 doesn't support open_argsMathieu Parent
Regression from #726
2017-03-21Merge pull request #718 from sspreitzer/master_globWilson McCoubrey
Add glob function
2017-03-15(FM-6051) Adds comments to warn for UTF8 incompatibilityHelen Campbell
2017-03-14Merge pull request #736 from HelenCampbell/lengthfunctDavid Schmitt
Addition of new length function
2017-03-14Addition of new length functionHelen Campbell
2017-03-13Merge pull request #729 from eputnam/i18n_prepGlenn Sarti
(MODULES-4473) join strings for i18n parser
2017-03-13(#FM-6068) allow file encoding to be specified (#726)Geoff Williams
* (#FM-6068) allow file encoding to be specified Add 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. * (#FM-6068) allow file encoding to be specified Added docs and tests as requested
2017-03-10Should only try to aplpy the resource if it not definedmbakerbp
2017-03-01(MODULES-4473) join strings for i18n parserEric Putnam
This commit joins all strings that are split over two lines with a plus, backslash, or double less than so that our magical i18n parser can wave over the module and mark every ruby string with our i18n function.
2017-02-05Add glob functionSascha Spreitzer
2017-02-03Include routine to converge ensure values 'present' and 'installed'Emerson Prado
If user declares ensure_package concurrently with ensure values 'present' and 'installed', function fails as if values were different Change causes function to interpret ensure => 'installed' as 'present', effectively elliminating the error Also works if user doesn't specify ensure value, since 'present' is the default
2017-01-13Merge remote-tracking branch 'origin/master' into leap_mastervarac
2016-12-20Merge pull request #613 from reidmv/add_puppet_server_factWilson McCoubrey
Add puppet_server fact to return agent's server
2016-12-15Merge pull request #640 from hunner/add_pryBryan Jen
Add pry() function from hunner-pry
2016-12-13Merge pull request #700 from petems/MODULES-4188-uuid_functionBryan Jen
(MODULES-4188) Add UUID generation function
2016-12-09Merge pull request #697 from ↵David Schmitt
HAIL9000/issue/master/MODULES-3829_add_tests_for_ensure_resources (MODULES-3829) Add tests for ensure_resources
2016-12-09(MODULES-3829) Make ensure_packages work with < 2.0Hailee Kenney
Prior to this commit, if a hash was passed in as an argument to the ensure_packages function a method of hash duplication would be used that is not supported with versions of ruby older than 2.0. In order to ensure the method is compatible with older ruby versions, switch to a different method of duplication. Additionally add tests to prevent further regressions.
2016-12-09(MODULES-4188) Add FQDN UUID generation functionPeter Souter
* Generates UUID based on a given FQDN string and the DNS namespace (6ba7b810-9dad-11d1-80b4-00c04fd430c8)
2016-12-08Add pry() function from hunner-pryHunter Haugen
2016-12-01Indicate that the type function is preferred (#695)Nick Walker
Prior to this commit, users coming to the type_of function would not realize that the type function in puppet does the same thing and is preferred over type_of. After this commit, we have a comment indicating the above.