Skip to content

Commit 909061c

Browse files
authored
Merge pull request #1267 from ekohl/add-creatersources-type
Add a Stdlib::CreateResources type
2 parents e86363c + e8ba623 commit 909061c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
describe 'Stdlib::CreateResources' do
6+
it { is_expected.to allow_value({ 'name' => { 'ensure' => 'present', 'key' => 1 } }) }
7+
end

types/createresources.pp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# @summary A type description used for the create_resources function
2+
#
3+
# @example As a class parameter
4+
# class myclass (
5+
# Stdlib::CreateResources $myresources = {},
6+
# ) {
7+
# # Using create_resources
8+
# create_resources('myresource', $myresources)
9+
#
10+
# # Using iteration
11+
# $myresources.each |$myresource_name, $myresource_attrs| {
12+
# myresource { $myresource_name:
13+
# * => $myresource_attrs,
14+
# }
15+
# }
16+
# }
17+
type Stdlib::CreateResources = Hash[String[1], Hash[String[1], Any]]

0 commit comments

Comments
 (0)