summaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/compile.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-06-16 15:12:01 -0700
committerelijah <elijah@riseup.net>2015-06-16 15:12:01 -0700
commitcded07db0df92883df3f38151bc2ceb6336165c3 (patch)
tree7fe88eebf8773a096cf4ee4344bc44ce1f6a72b4 /lib/leap_cli/commands/compile.rb
parentd3ea29bbf4ab2b23a0b5fc43ad803d882d2366b6 (diff)
fix problem with default environment and secrets.json generation
Diffstat (limited to 'lib/leap_cli/commands/compile.rb')
-rw-r--r--lib/leap_cli/commands/compile.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/leap_cli/commands/compile.rb b/lib/leap_cli/commands/compile.rb
index cfafc74..374e199 100644
--- a/lib/leap_cli/commands/compile.rb
+++ b/lib/leap_cli/commands/compile.rb
@@ -14,12 +14,13 @@ module LeapCli
end
if environment
if manager.environment_names.include?(environment)
- compile_hiera_files(manager.filter([environment]))
+ compile_hiera_files(manager.filter([environment]), false)
else
bail! "There is no environment named `#{environment}`."
end
else
- compile_hiera_files(manager.filter)
+ clean_export = LeapCli.leapfile.environment.nil?
+ compile_hiera_files(manager.filter, clean_export)
end
end
end
@@ -36,15 +37,13 @@ module LeapCli
protected
- def compile_hiera_files(nodes=nil)
- # these must come first
- update_compiled_ssh_configs
-
- # export generated files
+ #
+ # a "clean" export of secrets will also remove keys that are no longer used,
+ # but this should not be done if we are not examining all possible nodes.
+ #
+ def compile_hiera_files(nodes, clean_export)
+ update_compiled_ssh_configs # must come first
manager.export_nodes(nodes)
- # a "clean" export of secrets will also remove keys that are no longer used,
- # but this should not be done if we are not examining all possible nodes.
- clean_export = nodes.nil?
manager.export_secrets(clean_export)
end