aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/remote/tasks.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-11-28 01:40:20 -0800
committerelijah <elijah@riseup.net>2012-11-28 01:40:20 -0800
commitc76221182ca98ed804cc0c5259982250fa45f67c (patch)
treecdc3385f04eadc793274c4943e21fe419b406ccb /lib/leap_cli/remote/tasks.rb
parentc91b94d10ae5540c5d4128f8ca8748bd897f2cfb (diff)
downloadleap_cli-c76221182ca98ed804cc0c5259982250fa45f67c.tar.gz
leap_cli-c76221182ca98ed804cc0c5259982250fa45f67c.tar.bz2
give the user a nice error if 'init-node' has not yet been run (or if there are required packages that are missing).
Diffstat (limited to 'lib/leap_cli/remote/tasks.rb')
-rw-r--r--lib/leap_cli/remote/tasks.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/leap_cli/remote/tasks.rb b/lib/leap_cli/remote/tasks.rb
index 4a29517..ef41cb0 100644
--- a/lib/leap_cli/remote/tasks.rb
+++ b/lib/leap_cli/remote/tasks.rb
@@ -9,30 +9,23 @@ MAX_HOSTS = 10
task :install_authorized_keys, :max_hosts => MAX_HOSTS do
leap.log :updating, "authorized_keys" do
- run 'mkdir -p /root/.ssh && chmod 700 /root/.ssh'
+ 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
- packages = "puppet ruby-hiera-puppet rsync lsb-release"
- run "mkdir -p #{puppet_destination}"
+ leap.mkdirs puppet_destination
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 #{packages}"
+ 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 :update_platform, :max_hosts => MAX_HOSTS do
-# puppet.update_code
-#end
-
-#task :mk_leap_dir, :max_hosts => MAX_HOSTS do
-# run 'mkdir -p /root/leap/config && chown -R root /root/leap && chmod -R ag-rwx,u+rwX /root/leap'
-#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