From 69aa88000fcd34379ce8f8f8b30d461d9911f60e Mon Sep 17 00:00:00 2001 From: Thomas Hufschmidt Date: Tue, 11 Aug 2015 08:36:47 +0200 Subject: [PATCH 1/2] Update hiera.md Improvement to non-hiera usage example. * Fixed potention dependendy-cicle issue with example. --- docs/hiera.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/hiera.md b/docs/hiera.md index 5ae67275a..a4a53f234 100644 --- a/docs/hiera.md +++ b/docs/hiera.md @@ -30,20 +30,30 @@ Maybe for some reason, Hiera isn't being used in your organization. Or, you like Assume the same code block as before: ```ruby -class { 'nginx': - gzip => false, +class { 'nginx' : + manage_repo => false, + confd_purge => true, + vhost_purge => true, } ``` Should become... ```ruby -include nginx -class { 'nginx::config': - gzip => false, +Anchor['nginx::begin'] +-> +class { 'nginx::config' : + confd_purge => true, + vhost_purge => true, +} + +class { 'nginx' : + manage_repo => false, } ``` +The order in which this commands are parsed is important, since nginx looks for nginx::config via a defined(nginx::config) statement, which as of puppet 3.x is still parse-order dependent. + # Why again are you doing this? Well, the fact of the matter, the old Package/Config/Service pattern has served us well, but times are a-changin. Many users are starting to manage their packages and service seperately outside of the traditional pattern (Docker, anyone?). This means that in order to stay true to the goals of Configuration Management, it is becoming necessary to make less assumptions about how an organizations graph is composed, and allow the end-user additional flexibility. This is requring a re-think about how to best consume this module. From 5fa81822b30ca7737f14d2c38e0dce013a2682a2 Mon Sep 17 00:00:00 2001 From: Thomas Hufschmidt Date: Tue, 11 Aug 2015 08:38:13 +0200 Subject: [PATCH 2/2] Update hiera.md Improved wording on non-hiera example. --- docs/hiera.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/hiera.md b/docs/hiera.md index a4a53f234..f6b5d8525 100644 --- a/docs/hiera.md +++ b/docs/hiera.md @@ -27,7 +27,7 @@ Magically, it's all done! Work through these until the deprecation notices go aw Maybe for some reason, Hiera isn't being used in your organization. Or, you like to keep a certain amount of composibilty in you modules. Or, hidden option #3! Regardless, the recommended path is to instantiate your own copy of Class[nginx::config] and move on with life. Let's do another example. -Assume the same code block as before: +Assume you have the following code block: ```ruby class { 'nginx' : @@ -37,7 +37,7 @@ class { 'nginx' : } ``` -Should become... +This should become... ```ruby Anchor['nginx::begin']