summaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/compile.rb
blob: c5bb93e015bd224f4d0337406b98e39c773e65f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

module LeapCli
  module Commands

    desc 'Compile json files to hiera configs'
    command :compile do |c|
      c.action do |global_options,options,args|
        update_compiled_ssh_configs                     # this must come first, hiera configs import these files.
        manager.export Path.named_path(:hiera_dir)      # generate a hiera .yaml config for each node
      end
    end

    def update_compiled_ssh_configs
      update_authorized_keys
      update_known_hosts
    end

  end
end