From d3807847b78c9441f2089cb383f2e74a612108e4 Mon Sep 17 00:00:00 2001 From: Micah Date: Tue, 28 Jun 2016 21:56:31 -0400 Subject: Fix for when tor is not an array. When tor is not configured, then its possible to get this error on deploy: Error: tor is not a hash or array when accessing it with hidden_service at /srv/leap/puppet/modules/site_static/manifests/init.pp:16 on node rewdevstatic1.rewire.org This commit only accesses the array when its enabled. Change-Id: Ia75ac7a51179da980966adba0cc614b9cd642b0c --- puppet/modules/site_static/manifests/init.pp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/puppet/modules/site_static/manifests/init.pp b/puppet/modules/site_static/manifests/init.pp index 5b432f29..ab08f8e3 100644 --- a/puppet/modules/site_static/manifests/init.pp +++ b/puppet/modules/site_static/manifests/init.pp @@ -11,10 +11,7 @@ class site_static { $domains = $static['domains'] $formats = $static['formats'] $bootstrap = $static['bootstrap_files'] - $tor = hiera('tor', false) - $hidden_service = $tor['hidden_service'] - $tor_domain = "${hidden_service['address']}.onion" if $bootstrap['enabled'] { $bootstrap_domain = $bootstrap['domain'] @@ -61,6 +58,8 @@ class site_static { } if $tor { + $hidden_service = $tor['hidden_service'] + $tor_domain = "${hidden_service['address']}.onion" if $hidden_service['active'] { include site_static::hidden_service } -- cgit v1.2.3