diff options
author | elijah <elijah@riseup.net> | 2015-06-16 15:12:01 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-06-16 15:12:01 -0700 |
commit | cded07db0df92883df3f38151bc2ceb6336165c3 (patch) | |
tree | 7fe88eebf8773a096cf4ee4344bc44ce1f6a72b4 /lib/leap_cli/commands | |
parent | d3ea29bbf4ab2b23a0b5fc43ad803d882d2366b6 (diff) |
fix problem with default environment and secrets.json generation
Diffstat (limited to 'lib/leap_cli/commands')
-rw-r--r-- | lib/leap_cli/commands/compile.rb | 19 | ||||
-rw-r--r-- | lib/leap_cli/commands/deploy.rb | 2 |
2 files changed, 10 insertions, 11 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 diff --git a/lib/leap_cli/commands/deploy.rb b/lib/leap_cli/commands/deploy.rb index 03240ce..f5c47fe 100644 --- a/lib/leap_cli/commands/deploy.rb +++ b/lib/leap_cli/commands/deploy.rb @@ -51,7 +51,7 @@ module LeapCli end # compile hiera files for all the nodes in every environment that is # being deployed and only those environments. - compile_hiera_files(manager.filter(environments)) + compile_hiera_files(manager.filter(environments), false) # update server certificates if needed update_certificates(nodes) |