|
70 | 70 | $create_resources.each |$type, $resources| {
|
71 | 71 | $resources.each |$title, $attributes| {
|
72 | 72 | case $type {
|
73 |
| - 'file': { |
| 73 | + 'file', 'concat::fragment': { |
74 | 74 | # sanity checks
|
75 | 75 | # epp, erb and content are exclusive
|
76 | 76 | if 'epp' in $attributes and 'content' in $attributes {
|
77 |
| - fail("You can not set 'epp' and 'content' for file ${title}") |
| 77 | + fail("You can not set 'epp' and 'content' for ${type} ${title}") |
78 | 78 | }
|
79 | 79 | if 'erb' in $attributes and 'content' in $attributes {
|
80 |
| - fail("You can not set 'erb' and 'content' for file ${title}") |
| 80 | + fail("You can not set 'erb' and 'content' for ${type} ${title}") |
81 | 81 | }
|
82 | 82 | if 'erb' in $attributes and 'epp' in $attributes {
|
83 |
| - fail("You can not set 'erb' and 'epp' for file ${title}") |
| 83 | + fail("You can not set 'erb' and 'epp' for ${type} ${title}") |
84 | 84 | }
|
85 | 85 |
|
86 | 86 | if 'epp' in $attributes {
|
|
91 | 91 | $content = epp($attributes['epp']['template'])
|
92 | 92 | }
|
93 | 93 | } else {
|
94 |
| - fail("No template configured for epp for file ${title}") |
| 94 | + fail("No template configured for epp for ${type} ${title}") |
95 | 95 | }
|
96 | 96 | } elsif 'erb' in $attributes {
|
97 | 97 | if 'template' in $attributes['erb'] {
|
98 | 98 | $content = template($attributes['erb']['template'])
|
99 | 99 | } else {
|
100 |
| - fail("No template configured for erb for file ${title}") |
| 100 | + fail("No template configured for erb for ${type} ${title}") |
101 | 101 | }
|
102 | 102 | } elsif 'content' in $attributes {
|
103 | 103 | $content = $attributes['content']
|
104 | 104 | } else {
|
105 | 105 | $content = undef
|
106 | 106 | }
|
107 |
| - file { $title: |
| 107 | + $type { $title: |
108 | 108 | * => $attributes - 'erb' - 'epp' - 'content',
|
109 | 109 | content => $content,
|
110 | 110 | }
|
|
0 commit comments