summaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/compile.rb
blob: 3cdd5dd8b6469e7ca45ce1df5360deb4e231ae40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

module LeapCli
  module Commands

    desc 'Compiles node configuration files into hiera files used for deployment.'
    command :compile do |c|
      c.action do |global_options,options,args|
        compile_hiera_files
      end
    end

    def compile_hiera_files(nodes=nil)
      # these must come first
      update_compiled_ssh_configs

      # export generated files
      manager.export_nodes(nodes)
      manager.export_secrets(nodes.nil?) # only do a "clean" export if we are examining all the nodes
    end

    def update_compiled_ssh_configs
      update_authorized_keys
      update_known_hosts
    end

  end
end