Skip to content

Commit

Permalink
Changed class creation behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
tedivm committed Apr 2, 2015
1 parent e011ddc commit 7b3f897
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 20 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
##2015-03-29 - Release 0.6.0
## 2015-04-01 - Release 0.6.1

### Summary

This release changes the way classes are created to work around "defined"
issues.


## 2015-03-29 - Release 0.6.0

### Summary

Expand Down Expand Up @@ -26,7 +34,7 @@



##2015-03-22 - Release 0.5.2
## 2015-03-22 - Release 0.5.2

### Summary

Expand Down
29 changes: 13 additions & 16 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
$firewall_post_label = 'firewall_post',
$firewall_post_enabled = false,
$firewall_post_defaults = {},
$class_label =
'class',
$class_defaults = {},
$class_enabled = false,
$acl_label =
'acl',
$acl_defaults = {},
Expand Down Expand Up @@ -120,10 +124,6 @@
'augeas',
$augeas_defaults = {},
$augeas_enabled = false,
$class_label =
'class',
$class_defaults = {},
$class_enabled = false,
$computers_label =
'computers',
$computers_defaults = {},
Expand Down Expand Up @@ -630,18 +630,6 @@
$augeas_config)
}

if(defined('class')
and ($class_enabled
or $global_enable)) {

$class_config =
hiera_hash("${prefix}${class_label}",
$class_defaults)

create_resources('class',
$class_config)
}

if(defined('computers')
and ($computers_enabled
or $global_enable)) {
Expand Down Expand Up @@ -1580,6 +1568,15 @@



if($class_enabled or $global_enable) {
$class_config =
hiera_hash("${prefix}${class_label}",
$class_defaults)

create_resources('class',
$class_config)
}

class { 'hieratic::firewall':
global_enable => $global_enable,
firewall_label => "${prefix}${firewall_label}",
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tedivm-hieratic",
"version": "0.6.0",
"version": "0.6.1",
"author": "tedivm",
"summary": "Hieratic allows Puppet Resources to be created directly in Hiera.",
"license": "MIT",
Expand Down
1 change: 0 additions & 1 deletion resources/typelist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
augeas
class
computers
cron
exec
Expand Down
13 changes: 13 additions & 0 deletions src/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
$firewall_post_label = 'firewall_post',
$firewall_post_enabled = false,
$firewall_post_defaults = {},
$class_label =
'class',
$class_defaults = {},
$class_enabled = false,
"""

for puppet_type in puppet_types:
Expand All @@ -48,6 +52,15 @@

hieratic_class += """
if($class_enabled or $global_enable) {
$class_config =
hiera_hash("${prefix}${class_label}",
$class_defaults)
create_resources('class',
$class_config)
}
class { 'hieratic::firewall':
global_enable => $global_enable,
firewall_label => "${prefix}${firewall_label}",
Expand Down

0 comments on commit 7b3f897

Please sign in to comment.