aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/remote/tasks.rb
blob: f967db1514eb274a2f860cd7137e17974f8b0e2a (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
28
29
30
31
32
33
#
# This file is evaluated just the same as a typical capistrano "deploy.rb"
# For DSL manual, see https://github.com/capistrano/capistrano/wiki
#

MAX_HOSTS = 10

task :install_authorized_keys, :max_hosts => MAX_HOSTS do
  leap.log :updating, "authorized_keys" do
    leap.mkdirs '/root/.ssh'
    upload LeapCli::Path.named_path(:authorized_keys), '/root/.ssh/authorized_keys', :mode => '600'
  end
end

task :install_prerequisites, :max_hosts => MAX_HOSTS do
  leap.mkdirs LeapCli::PUPPET_DESTINATION
  run "echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen; locale-gen"
  leap.log :updating, "package list" do
    run "apt-get update"
  end
  leap.log :installing, "required packages" do
    run "DEBIAN_FRONTEND=noninteractive apt-get -q -y -o DPkg::Options::=--force-confold install #{leap.required_packages}"
  end
  leap.mkdirs("/etc/leap", "/srv/leap")
  leap.mark_initialized
end

#task :apply_puppet, :max_hosts => MAX_HOSTS do
#  raise "now such directory #{puppet_source}" unless File.directory?(puppet_source)
#  leap.log :applying, "puppet" do
#    puppet.apply
#  end
#end