Commit graph

1453 commits

Author SHA1 Message Date
bob
8f1efdad22 Add a missing s in the ensure_packages hash example 2016-05-11 10:52:25 +01:00
Bryan Jen
b2165dfc34 Merge pull request #601 from petems/MODULES-1439-any2bool_added
(MODULES-1439) Adds any2bool function
2016-05-05 10:13:10 -07:00
Bryan Jen
f46c9fdbce Merge pull request #592 from jyaworski/fix_delete
Use reject instead of delete_if
2016-05-04 09:13:20 -07:00
Joseph Yaworski
540546b9b4 Use reject instead of delete_if 2016-05-04 11:32:10 -04:00
Bryan Jen
f48747b8af Merge pull request #603 from puppetlabs/4.12.x
Mergeback 4.12.x
2016-05-03 15:09:33 -07:00
Peter Souter
420f76d8dc (MODULES-1439) Adds any2bool function
* Basically a combination of `string2bool` and `num2bool`
2016-05-02 20:04:56 +01:00
Joris
9e1f74f3fc Expose the functions of ruby's built-in Shellwords module (#580)
* Add shell_escape function, shell_join function & shell_split function
2016-04-28 18:44:30 +01:00
Jean B
2a75ed08a1 Merge pull request #602 from hunner/unbreakline
Remove hard linebreaks
2016-04-28 10:38:00 -07:00
Hunter Haugen
db6e2f81b4 Remove hard linebreaks 2016-04-27 15:34:19 -07:00
Helen
fc18517905 Merge pull request #599 from hunner/fix_delete
Undo changing delete() to delete regex matches
2016-04-26 16:24:32 +01:00
Hunter Haugen
19752a7ff3 Remove todo for delete() and update spec
This spec should verify that substring matches are not removed in the
future
2016-04-25 14:36:53 -07:00
Hunter Haugen
232de137f1 Revert "Add support for regular expressions to delete"
This reverts commit 0d46515b57.

It introduced backwards-incompatible functionality.
2016-04-25 14:33:43 -07:00
Greg Hardy
24797bb5ad Merge pull request #593 from puppetlabs/update-msync
Update to newest modulesync_configs [9ca280f]
2016-04-19 11:45:08 +01:00
David Schmitt
ee6413b95a Update to newest modulesync_configs [9ca280f] 2016-04-18 20:15:09 +01:00
Helen
27236a73b2 Merge pull request #598 from DavidS/MODULES-3271-legacy-ruby
(MODULES-3271) Ensure that is_email_address works on unsupported rubies
2016-04-18 11:52:26 +01:00
David Schmitt
79c871322f (MODULES-3271) Ensure that is_email_address works on unsupported rubies 2016-04-18 09:46:30 +01:00
Helen
768b6ce9f4 Merge pull request #596 from tphoney/4.12.0_release_prep
4.12.0 release prep
2016-04-15 13:33:49 +01:00
tphoney
cf171a7279 4.12.0 release prep 2016-04-15 13:32:04 +01:00
Helen
d9f65387c9 Merge pull request #595 from tphoney/4.12.0_release
master to 4.12.x
2016-04-15 13:29:23 +01:00
Bryan Jen
085035dcce (FM-5000) Release prep for 4.12.0. 2016-04-15 13:21:44 +01:00
Hunter Haugen
733508677d Merge pull request #591 from jyaworski/delete_regex
Add support for regular expressions to delete
2016-04-12 10:41:48 -07:00
Joseph Yaworski
0d46515b57 Add support for regular expressions to delete 2016-04-12 13:10:39 -04:00
Hunter Haugen
e3a6e2c601 Merge pull request #590 from alext/fix_concat_with_hash
(MODULES-3246) Fix concat with Hash arguments.
2016-04-11 15:02:58 -07:00
TP Honey
60864fd39b Merge pull request #583 from jyaworski/validate_email_address
Add validate_email_address function
2016-04-11 16:04:25 +01:00
Joseph Yaworski
bfe6cf68b3 Add validate_email_address function 2016-04-10 22:28:03 -04:00
Alex Tomlins
44596e73da (MODULES-3246) Fix concat with Hash arguments.
85d5ead Updated the concat function so that it wouldn't modify the
original array. A side-effect of this change is that it now always calls
`Array()` on the second argument. If thit is a Hash, this results in
`to_a` being called on the hash, which converts it to an array or
tuples. This is undesired.

Update the behaviour so that it doesn't (indirectly) call `to_a` on
anything, instead test for the type of the argument, wrapping it in an
array if it's not already an array.
2016-04-08 13:42:13 +01:00
Hunter Haugen
be1ff3f09e Merge pull request #585 from jearls/MODULES-2370-update-validate-to-not-require-line-when-matching-for-absence
[MODULES-2370] file_line.rb: Fix `line` attribute validation
2016-04-07 15:10:07 -07:00
Hunter Haugen
6248d241bc Merge pull request #582 from derekmceachern/bug/master/spec_test_typo
MODULES-3201 - Fixed typo 'absense' to 'absence'
2016-04-07 14:53:02 -07:00
TP Honey
0624c3f806 Merge pull request #589 from puppetlabs/modulesync-update
Multiple updates to stdlib and its testsuite
2016-04-07 16:01:25 +01:00
David Schmitt
5639828bff (maint) also catch Psych::SyntaxError
Psych::SyntaxError is a RuntimeException. This still needs to
catch that. This was uncovered by the recent move to catch StandardError
rather than the catchall Exception that was here before.
2016-04-07 12:31:06 +01:00
David Schmitt
3860512d56 (maint) remove failing test
This removes the failing test special casing for puppet 4.
2016-04-07 12:31:06 +01:00
David Schmitt
27458aff98 (maint) Update to current modulesync_configs [953280c]
This removes much of the assorted cruft that accumulated in the
unmanaged files and moves the remaining necessary parts to
spec_helper_local.
2016-04-07 12:31:06 +01:00
Bryan Jen
c5486aba62 Merge pull request #586 from ffrank/dont_catch_exception
catch StandardError rather than the gratuitous Exception
2016-03-29 09:13:46 -07:00
Hunter Haugen
29961218a7 Merge pull request #587 from bmjen/4.12.0_prep
(FM-5000) Release prep for 4.12.0.
2016-03-28 17:46:45 -07:00
Bryan Jen
e6a3436fd0 (FM-5000) Release prep for 4.12.0. 2016-03-28 17:42:22 -07:00
Felix Frank
0cea94a82e catch StandardError rather than the gratuitous Exception 2016-03-29 01:59:54 +02:00
Johnson Earls
7e408ca797 [MODULES-2370] file_line.rb: Fix line attribute validation
`file_line` type: During validation, do not require `line` attribute if:
* `ensure` is `absent`,
* `match` is not empty,
* and `match_for_absence` is `true`.

Also update `spec` tests to reflect this.
2016-03-28 21:26:01 +00:00
Bryan Jen
b63849c786 Merge pull request #579 from sulaweyo/patch-2
Add check if Gem is defined
2016-03-28 11:44:00 -07:00
Derek McEachern
eca43f41cd Fixed typo 'absense' to 'absence' 2016-03-24 14:23:05 -05:00
Bryan Jen
db2a321434 Merge pull request #581 from vicinus/master
improve suffix function to support the same feature set as prefix
2016-03-23 08:24:37 -07:00
Reinhard Vicinus
85ff2a28a8 improve suffix function to support the same feature set as prefix 2016-03-22 16:24:09 +01:00
Hunter Haugen
b6383d259c Merge pull request #576 from yadavnikhil/master
ensure_packages.rb: Modifed to pass hiera parameters (as hash,array) as first argument
2016-03-17 09:25:38 -07:00
Sledge Sulaweyo
be6d4d2ffb Add check if Gem is defined
On e.g. Ubuntu 12.04 LTS Gem is not there by default so i added a check to not fail in that fact if this is the case.
2016-03-17 07:36:44 +01:00
Hunter Haugen
52f6af3acc Merge pull request #578 from bmjen/fqdn-rand-fix
(maint) Fixes fqdn_rand_string tests
2016-03-16 14:06:15 -07:00
Bryan Jen
7943b25ec1 (maint) Fixes fqdn_rand_string tests
Puppet 4.4.0 and later has changed fqdn_rand to use a higher ceiling
(PUP-5646), the tests for fqdn_rand_string needed to be updated to
reflect the new expected output.
2016-03-16 13:57:36 -07:00
Hunter Haugen
72f6e379a6 Merge pull request #577 from EmilienM/enclose_ipv6
Add enclose_ipv6 function
2016-03-15 16:48:50 -07:00
Nikhil Yadav
0da9ca7e4a Add ensure_resources() function
New function "ensure_resources()" to support passing hash as parameter OR from hiera backend

This new function is extension of ensure_resource() which will now support to pass multiple values as hash/array OR from hiera backend variables in title argument with additional parameters needed.

It will
process multiple values for a resource type from the passed argument & pass each entry (type, title, params) to ensure_resource() in required format for further processing.
Now user can have duplicate resource check functionality extended to multiple entries with this new function.

Use:
For multiple resources using
hash:
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'})

ensure_packages()
Modified to also support Hash type argument for packages

This modification will call newly added ensure_resources() for processing Hash as second argument.
The original functionality remains same for Array type arguments.

Use:
hiera:

packagelist:
  ksh:
    ensure: latest
  mlocate: {}
  myrpm:
    provider: rpm
    source: "/tmp/myrpm-1.0.0.x86_64.rpm"
    install_options:
      --prefix:
        /users/home
  openssl:
    provider: rpm
    source: "/tmp/openssl-1.0.1e-42.el7.x86_64.rpm"

Call:
ensure_packages($packagelist)
2016-03-15 09:29:38 +05:30
Emilien Macchi
0378336f9c Add enclose_ipv6 function
Copy a function from puppetlabs/apache, created by Benedikt Bock by
55cc3b4e8f4bc859a1255cb57be2c7923005d822 .

This function enclose IPv6 addresses in square brackets.
It takes an array of ip addresses and encloses the ipv6 addresses with
square brackets.

Co-Authored-By: Benedikt Bock <benedikt_bock@web.de>
2016-03-13 18:20:49 -04:00
Hunter Haugen
69ca8d09c6 Merge pull request #570 from gfidente/master
Add is_ipv4_address and is_ipv6_address functions
2016-02-18 10:32:25 -08:00
TP Honey
2c3beace24 Merge pull request #575 from guessi/extend_base64_function_support
Extend Base64() function support
2016-02-18 15:47:04 +00:00