diff --git a/spec/type_aliases/createresources_spec.rb b/spec/type_aliases/createresources_spec.rb new file mode 100644 index 000000000..fac70bb77 --- /dev/null +++ b/spec/type_aliases/createresources_spec.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Stdlib::CreateResources' do + it { is_expected.to allow_value({ 'name' => { 'ensure' => 'present', 'key' => 1 } }) } +end diff --git a/types/createresources.pp b/types/createresources.pp new file mode 100644 index 000000000..f78443cde --- /dev/null +++ b/types/createresources.pp @@ -0,0 +1,17 @@ +# @summary A type description used for the create_resources function +# +# @example As a class parameter +# class myclass ( +# Stdlib::CreateResources $myresources = {}, +# ) { +# # Using create_resources +# create_resources('myresource', $myresources) +# +# # Using iteration +# $myresources.each |$myresource_name, $myresource_attrs| { +# myresource { $myresource_name: +# * => $myresource_attrs, +# } +# } +# } +type Stdlib::CreateResources = Hash[String[1], Hash[String[1], Any]]