Commit graph

148 commits

Author SHA1 Message Date
Dmitry Ilyin
eb948c4a0d [MODULES-2462] Improve parseyaml function
* Add default value support
  Second argument will be returned if yaml cannot be parsed
  instead of false value
* Update tests
2015-08-25 21:41:03 +03:00
Jetroid
ba345abfb7 Add consistent *Type* information
Remove trailing whitespace

Two functions had not been given any *Type* information. This commit fixes that.
2015-08-25 10:35:57 +01:00
Jetroid
1d9189d860 (MODULE-2456) Modify union to accept more than two arrays
Add spec tests to test the new functionality:
 *Case for 3 arrays.
 *Case for 4 arrays.
Modify README to note new functionality.

This is for issue MODULE-2456, follow the precedent of MODULE-444.

This change allows union to be much more useful, unioning many arrays
in one line rather than in n lines. Additionally, as this is only added
functionality, and does not affect the 2 array case that all modules
currently using array are using, it should not affect any existing
modules utilizing union.

This is now useful, for example, for merging many arrays of resources
(eg: packages.) to generate just one list with no duplicates, to avoid
duplicate resource declarations.
2015-08-24 14:24:10 +01:00
Nigel Gibbs
4cbe846750 (MODULES-2410) Add new functions dos2unix and unix2dos 2015-08-14 13:30:01 +01:00
Hunter Haugen
e815da5962 Merge pull request #483 from nibalizer/load_metadata_json
Add load_metadata_json function
2015-07-31 14:12:56 -07:00
Spencer Krum
f411ee7119 Add load_metadata_json function
This function loads the metadata.json into a puppet variable. This enables a number of neat things such as:

* Which version of the module am I using? 2.x? 3.x?
* Which author of the module am I using? puppetlabs? example42?
2015-07-30 15:51:54 -07:00
Zee Alexander
aca29129cb Remove colorful language from module. 2015-07-30 15:11:26 -07:00
Raymond Maika
35e92645f7 (MODULES-2024) Adding replace attribute to file_line 2015-07-30 14:55:32 -04:00
gcmalloc
5c79107863 adding support for hash in the size function 2015-07-22 12:11:52 +02:00
Garrett Honeycutt
f485e6e2eb Clarify that third argument to ensure_resource() is a hash 2015-07-12 20:11:36 -04:00
TP Honey
a2026bf13b Merge pull request #475 from DavidS/document-puppet4-compat
Document puppet 4 compatability in 4.6
2015-07-09 18:30:26 +01:00
Alexander Fisher
c64ecfb0c3 Add validate_slength's optional 3rd arg to README 2015-07-09 18:13:19 +01:00
David Schmitt
771320a830 Document puppet 4 compatability in 4.6 2015-06-18 14:51:35 +01:00
Eli Young
d7c8460353 fqdn_rotate: Improve documentation 2015-06-01 16:19:07 -07:00
Raymond Maika
72089f3d13 (MODULES-2071) Refactor file_line provider to contain logic to handle parameter multiple in function handle_create_with_after
Without this, file_line resource without the `match` parameter but with the `after` param will throw an error if there are multiple matches for the after expression. This patch creates the handling for the `multiple` parameter in handle_create_with_after. This allows you to add a line after the `after` expression if it appears at multiple points in a file.

Updated reference to `file_line` in the README to reflect that the multiple parameter can be set when using `after` and/or `match` as the matching regex.
2015-05-29 00:30:44 -04:00
Jorie Tappa
593f74ced7 DOC-1504: README edits 2015-05-14 15:03:23 -07:00
Hunter Haugen
8fba5c058b Merge pull request #405 from elyscape/feature/fqdn_rand_strings
(MODULES-1715) Add FQDN-based random string generator
2015-04-09 10:45:38 -07:00
Eli Young
23be4020dd (MODULES-1737) Add pw_hash() function 2015-04-05 17:21:17 -07:00
Eli Young
a82266c256 (MODULES-1715) Add fqdn_rand string generators 2015-03-31 17:33:04 -07:00
Spencer Krum
c297bd80e3 Make each function a link in the readme
Using a ####, github will create a link. This makes it so I can link
someone directly to the function I want to show them.
2015-03-28 20:34:42 -07:00
TP Honey
bf8e5b0573 Merge pull request #422 from cyberious/assert_private
Assert private
2015-03-05 19:15:41 +00:00
Franz Pletz
56d815bcfc Rename private() to assert_private()
As mentioned in #270, private is a reserved keyword in the future parser
which is to be released with Puppet 4. As it stands, this function is
not useable with the future parser so it needs to renamed.

This is a breaking change.
2015-03-05 10:59:31 -08:00
Hunter Haugen
41965fd2c9 Merge pull request #375 from poikilotherm/feature/master/validate_integer_and_numeric
(MODULES-560) Add new functions validate_numeric() and validate_integer().
2015-03-05 10:57:43 -08:00
TP Honey
706b9e8205 Merge pull request #420 from mhaskel/improveprefix
Add support for hashes in the prefix function
2015-03-05 15:45:39 +00:00
robruma
380cb02a65 Adding markdown for the range() function's 3rd argument
Adding markdown for the range() function's 3rd argument

Adding markdown for the range() function's 3rd argument
2015-03-04 18:01:29 -05:00
Stefan Goethals
0236cd51bc Add support for hashes in the prefix function
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2015-03-03 16:20:55 -08:00
Morgan Haskel
055083c117 Merge pull request #407 from adamcrews/ceiling_function
Add a ceiling function to complement the floor function.
2015-03-03 15:59:06 -08:00
Travis Fields
85e81f9bdf Loosen the restrictions of upcase and allow for recursion of the objects and only worry if the object responds to upcase 2015-03-02 10:45:43 -08:00
Spencer Krum
ef539388cb Remove travis badge 2015-02-19 13:58:14 -08:00
Adam Crews
53b1802a92 Add a ceiling function to complement the floor function. 2015-02-01 22:46:16 -08:00
Hunter Haugen
7c8ae311ca (MODULES-1473) Deprecate type() function for new parser
The `type()` function will cease to work on the new parser because 'type'
is a reserved keyword. The `type3x()` function may be used to continue
similar functionality, but will be deprecated in favor of the built-in
typing system.

The `type_of()` function has been included to introspect types in the
new parser.
2015-01-07 16:40:06 -08:00
Peter Souter
c125a08994 README fixes for recent merges
* (MODULES-444) Update README for concat changes
* (MODULES-1582) Update `validate_cmd` readme
* Plus some Whitespace fixes
2014-12-20 21:10:20 +00:00
Travis Fields
f6e20d2068 Update docs to reflect new behavior of delete function taking array in second argument 2014-12-19 10:41:07 -08:00
Hunter Haugen
1ae0a10707 Merge pull request #388 from mhaskel/merge_4.5.x_into_master
Merge 4.5.x into master
2014-12-18 15:55:33 -08:00
Morgan Haskel
696c89de99 Merge pull request #372 from poikilotherm/feature/master/validate_absolute_path_allow_arrays
Allow array of pathes in validate_absolute_path
2014-12-17 14:19:30 -08:00
Morgan Haskel
841b0df210 Merge pull request #368 from rfugina/basename
Basename implementation
2014-12-17 11:00:23 -08:00
Rob Fugina
ef3d42f7bb Added basename() based on Ruby's File.basename
Based on dirname code.  Includes RSpec tests and docs.
2014-12-17 12:39:40 -06:00
jbondpdx
44596dcf3c DOC-1095: edit file_line resource, match parameter
Was unclear and not accurate; rewrote the parameter, moved file_line from function list to resource section, added missing parameters for this resource.
2014-12-16 14:33:42 -08:00
jbondpdx
cff7645648 Added a note that stdlib no longer ships with PE 3.7+
Users didn't realize we stopped shipping stdlib module with PE. I added this information to the stdlib readme.
2014-12-16 10:15:14 -08:00
Morgan Haskel
ec08c60749 Update README for updated member() functionality 2014-12-15 16:21:28 -08:00
Oliver Bertuch
260c1f4b92 Add new functions validate_numeric() and validate_integer(). 2014-12-04 22:33:15 +01:00
jbondpdx
294b8b572d Added a note that stdlib no longer ships with PE 3.7+
Users didn't realize we stopped shipping stdlib module with PE. I added this information to the stdlib readme.
2014-11-25 11:32:12 -08:00
Oliver Bertuch
89995e4db0 Allow array of pathes in validate_absolute_path 2014-11-25 12:45:23 +01:00
jbondpdx
2fcc1ef189 DOC-248 Revised and updated readme for stdlib module
Reorganized and edited stdlib module readme.
2014-10-08 11:42:31 -07:00
Raphaël Pinson
2062f9734b Add private() function 2014-06-11 16:35:32 +02:00
Ashley Penney
0b59dfe642 Merge pull request #222 from mfoo/fix/master/concat-primitives
Allow concat to take non-array second parameters
2014-04-24 13:41:42 -04:00
Yanis Guenane
d9b5e912bb (MODULES-603) Add defaults arguments to ensure_packages()
Without this patch one can not specify package resource specific
parameters. All the ensure_packages() function does it makes sure
the named packages are installed. This patch allows one to pass
default as a second argument and allow greater flexibility on
packages installations.

Use case like the following are now possible :
  * ensure_packages(['r10k', 'serverspec'], {'provider' => 'gem'})
  * ensure_packages(['ntp'], {'require' => 'Exec[foobar]'})
2014-03-30 18:47:36 -04:00
GoT
d20cf40697 Update README.markdown
Add code block for validate_slength.
2014-03-27 11:56:17 +01:00
Martin Foot
35bf5fd8c9 Allow concat to take non-array second parameters
Also improve and extend concat tests to lock down functionality
2014-02-21 15:48:27 +00:00
Juan Treminio
908db6d403 hash example has misplaced comas 2014-02-19 23:37:38 -06:00
Ashley Penney
ab981422a6 Merge pull request #217 from teancom/fix/master/file_line
(DOCUMENT-21) add docs for file_line to README.markdown
2014-02-11 12:51:37 -05:00
Peter Souter
d4722d7af5 Fix strftime documentation in README
Markdown was barfing due to typo
2014-02-11 15:57:22 +00:00
Sharif Nassar
a972e0645b Remove trailing whitespace 2014-02-05 15:01:45 -08:00
David Bishop
dbba655c10 (DOCUMENT-21) add docs for file_line to README.markdown
Without this, you have to look at the source file
(lib/puppet/type/file_line.rb) to know what it does. This adds that
documentation.
2014-01-25 13:30:50 -05:00
Andrew Parker
bce5b76f66 (doc) Update to point to Jira
Since we've moved from Redmine to Jira the links need to be updated so
that people know where to look for issues.

At the moment stdlib is being tracked with puppet in the PUP project.
This doesn't seem like a good, long term solution, but it is where we
are right now.
2013-12-23 15:35:08 -08:00
Andrew Parker
1cf4b04b33 Merge pull request #211 from jhoblitt/function_is_bool
(#23381) add is_bool() function
2013-12-18 10:49:39 -08:00
Josh Cooper
ef2cfd7982 Merge pull request #207 from ghoneycutt/remove_unintentional_link
Remove unintentional link from README
2013-12-18 10:38:40 -08:00
Jeff McCune
5d4c95ec50 (maint) Update README stating stdlib 4.x supports Puppet 2.7.x
Without this patch there is a disconnect between the documentation in
the README and our decision to not merge pull requests into the 4.x
series that break compatibility with Puppet 2.7.x

For example:

    @jeffmccune I think the real issue here is that "policy" is out of sync with
    the documentation. The README claims that 4.x does not support puppet 2.7.x,
    yet the "policy" is not to merge patches that break 2.7.x. Due to that I'm sure
    there are a lot of 2.7.x installations out there that have a 4.x version of
    stdlib installed. That's going to cause a rather rude surprise if some future
    version of 4.x stops working where a prior minor release was functioning.

    I'd like to suggest that the documentation be changed to reflect 4.x supporting
    2.7.x and that a new major version bump is made when 2.7.x support can in fact
    be dropped. An alternative solution would be update the README with a note to
    developers about the kinda/sorta/maybe/fishy/quasi support of 2.7.x.

Please also see this discussion:
https://github.com/puppetlabs/puppetlabs-stdlib/pull/176#issuecomment-30251414
2013-12-12 11:15:13 -05:00
Joshua Hoblitt
1077881873 (#23381) add is_bool() function 2013-12-09 11:50:03 -07:00
Garrett Honeycutt
ec8aaeecfa Remove unintentional link from README
Markdown interprets [] folowed by () as a link, which was a 404 and not
the intention of the original author. This patch ensures that the
document reads as intended, without the link.
2013-11-30 10:40:27 -05:00
Tehmasp Chaudhri
753801537f Fixed 'separator' typos 2013-10-25 15:26:21 -06:00
Spencer Krum
6bd2b4874c Minor grammar fix 2013-09-11 15:37:59 -07:00
floatingatoll
34944a78f9 (maint) fix RST formatting of has_interface_with code examples 2013-09-04 10:30:38 -07:00
Paweł Tomulik
bb9f7d1726 small fix to delete_values_spec.rb and README.markdown 2013-08-14 02:23:36 +02:00
Paweł Tomulik
2069415204 added delete_values() and delete_undef_values() functions 2013-08-05 22:12:26 +02:00
Chris Boot
7f98203f18 ensure_resource: fix documentation typo 2013-06-27 17:51:36 +01:00
fiddyspence
3707c47dcd Adding base64 function
Adding base64 function and spec test.  Included a bonus fix to
validate_slength_spec.rb to put the expectation message in the right
place.
2013-05-24 16:33:24 +01:00
Rohan Sheth
ad9079e35b Trivial documentation fix 2013-05-18 11:48:41 -07:00
Alex Cline
737aa31546 (#20684) Add array comparison functions, difference, intersection and union.
Included is code, tests and documentation for the difference, intersection
and union functions for comparing arrays.
2013-05-13 12:14:15 -04:00
Alex Cline
e08734af5a (#20548) Allow an array of resource titles to be passed into the ensure_resource function
This patch allows an array of resource titles to be passed into
the ensure_resource function.  Each item in the array will be
checked for existence and will be created if it doesn't already
exist.
2013-05-03 15:47:27 -04:00
Raphaël Pinson
2ba9e4721b Add a dirname function 2013-05-02 15:17:35 +02:00
Mark Smith-Guerrero
928036ac53 (maint) Fix a small typo in hash() description 2013-04-29 17:17:46 -07:00
Garrett Honeycutt
5a2d4c4a68 adds compatibility matrix 2013-04-12 13:04:15 +02:00
Jeff McCune
ab3e30c025 Fix README function documentation
Without this patch some core puppet functions leaked into the
documentation for the functions contained in stdlib.  This patch removes
them and cleans up some of the formatting.
2013-04-11 14:29:57 -07:00
Jeff McCune
ddfafc4a85 Update function documentation for 4.0.0
Without this patch the function documentation is out of sync with the
functions contained in the standard library.  This commit updates the
functions.  I generated the list using this sequence:

    cd ~/src/puppet
    git checkout 3.1.1
    bundle exec puppet doc -r function > /tmp/puppet_functions.txt
    cd ~/src/stdlib
    bundle exec puppet doc -r function > /tmp/stdlib_functions.txt
    diff -U2 puppet_functions.txt stdlib_functions.txt | grep '^+' | perl -ple 's/^\+//' > functions.txt

I then replaced the README function documentation with the contents of
functions.txt which contains only the functions contained in stdlib.
2013-04-11 14:04:31 -07:00
Jeff McCune
25b670e6f6 Update Modulefile, README, CHANGELOG for stdlib-4.0.0 2013-04-11 13:52:49 -07:00
Richard Soderberg
a83318d3ee prefix: fix doc typo Examles -> Examples 2013-03-26 15:49:09 -07:00
Richard Soderberg
88a93ac6cd add suffix function to accompany the prefix function 2013-03-26 15:46:55 -07:00
Kristof Willaert
05273419e1 Add floor function implementation and unit tests 2013-03-19 10:00:57 +01:00
Raphaël Pinson
a1510a1e71 Add missing documentation for validate_augeas and validate_cmd to README.markdown 2013-03-04 23:37:57 +01:00
fatmcgav
3cef5d9e33 (#19201) Add concat function to join two arrays
Without this patch applied there is no easy way to append one array to
another.  This is a problem because it is often desirable to join two
arrays without flattening the contents into a single, one dimensional
array.

This patch addresses the problem by adding a `concat()` function which
takes two arguments.  The arguments will be concatenated together and a
new array returned to the caller.

Reviewed-by: Jeff McCune <jeff@puppetlabs.com>
2013-02-12 10:00:09 -08:00
Jaka Hudoklin
20e0e07090 Add getparam function to get defined resource parameters
As far as i know there's no other puppet-dsl-like way to get parameter of
defined resource, so that's why i implemented getparam function, which takes
resource reference and parameter name and returns parameter value.

    Here's another example why this function is really useful:

    define config($path, $config_param1, $config_param2) { }

    define example_resource($config) {
        $path = getparam($config, "path")

        notice("Path is $path")
    }

    define example_resource2($example_resource, $config = getparam($example_resource, "config")) {
        $config_param1 = getparam($config, "config_param1")

        notice("Config parameter is $config_param1")
    }

    define example_resource3($example_resource, $config = getparam($example_resource, "config")) {
        $config_param2 = getparam($config, "config_param2")

        notice("Config parameter is $config_param2")
    }

    class test_getparam {

        config { "config_instance":
            path => "/some/config/path",
            config_param1 => "someconfigtext1",
            config_param2 => "someconfigtext2",
        }

        example_resource { "example_resource_instance":
            config => Config["config_instance"]
        }

        example_resource2 { "example_resource_instance":
            example_resource => Example_resource["example_resource_instance"]
        }

        example_resource3 { "example_resource_instance":
            example_resource => Example_resource2["example_resource_instance"]
        }
    }

    class { "test_getparam": }
2013-01-09 17:51:12 -08:00
Jeff McCune
d0820469b4 (maint) Add Travis CI Support
Without this patch stdlib has Travis CI configuration files, but they
don't seem to completely specify the dependency versions and the build
matrix.  This patch addresses the problem by putting the dependency
information in the conventional Gemfile location.

This patch should coincide with enabling Travis CI support for pull
requests.  A build status image is also included in the project README.
2013-01-05 15:32:43 -08:00
Jeff McCune
3a6085fa80 Clarify that stdlib 3 supports Puppet 3
Minor clarification to the compatibility section of the README.
2012-12-04 15:07:53 -08:00
Jeff McCune
6961179007 Merge branch '3.x'
* 3.x:
  (Maint) Remove core function documentation from README

Conflicts:
	README.markdown
2012-08-30 14:57:55 -07:00
Jeff McCune
c761b32e0a (Maint) Remove core function documentation from README
Without this patch the README contains the documentation for core
functions shipped in Puppet in addition to the functions shipped in
stdlib.

This is a problem because it's confusing for end users trying to get
started with puppet.

This patch makes it so only the stdlib functions are included.
2012-08-30 14:50:00 -07:00
Paul Tötterman
4169e77224 Fix some logical inconsistencies in README 2012-08-30 13:40:12 +03:00
Eric Sorenson
258287941b (#14422) Update README to include the bug tracker URL.
As reported, it is indeed difficult to navigate directly to the correct
part of Redmine for a particular sub-project. This commit puts the
issue tracker URL front and center.
2012-08-19 16:28:32 -07:00
Eric Sorenson
af22a40679 (#14422) Update README to include the bug tracker URL.
As reported, it is indeed difficult to navigate directly to the correct
part of Redmine for a particular sub-project. This commit puts the
issue tracker URL front and center.
2012-08-17 15:15:26 -07:00
Jeff McCune
436ba53168 (Maint) Update README for 3.0.0
This commit updates the README for 3.0.0 by taking a function list
produced with `puppet doc -r function` _without_ stdlib in the
`$LOAD_PATH` and then filtering out the native functions by executing
`puppet doc -r function` _with_ stdlib/lib in the `$LOAD_PATH` and then
running `comm -13 core_functions.txt all_functions.txt`
2012-08-16 10:59:31 -07:00
Jeff McCune
eb94e17635 (#2157) Update README about facts_dot_d 2012-07-12 17:51:55 -07:00
Jeff McCune
a8d4bbd9e2 (maint) Add semantic versioning info to README
This patch adds semantic versioning information to the README of this
module.  This information is missing and unclear without this patch.
This should help clarify the support matrix for the Standard Library as
it relates to Puppet Enterprise released versions.
2011-12-30 11:46:21 -08:00
Jeff McCune
ad5316f561 Update CHANGELOG, README and Modulefile for v2.1.1 2011-08-18 12:06:44 -07:00
Jeff McCune
06b549b028 Update CHANGELOG, Modulefile and README for 2.1.0 2011-08-17 16:37:20 -07:00
Jeff McCune
0466e1bc6f Update CHANGELOG and README for 1.0.0 2011-08-04 17:24:46 -07:00
Jeff McCune
0ea7a0ffde Update README with getvar() and validate_hash()
The README now provides quick examples of how to take advantage of the
getvar() and validate_hash() functions included in this release of the
stdlib.
2011-06-21 17:06:46 -07:00
Jeff McCune
6964d13b26 Update README with target versions
Also add the list of things this module will
likely contain.
2011-05-24 11:23:16 -07:00
Jeff McCune
6e9d0465bc Initial commit 2011-05-24 11:06:30 -07:00