summaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/compile.rb
blob: df2149d0a45072a813eda88bbe38e7fef584cdd2 (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
    end

    def update_compiled_ssh_configs
      update_authorized_keys
      update_known_hosts
    end

  end
end