summaryrefslogtreecommitdiff
path: root/lib/leap_cli/remote
diff options
context:
space:
mode:
Diffstat (limited to 'lib/leap_cli/remote')
-rw-r--r--lib/leap_cli/remote/leap_plugin.rb11
-rw-r--r--lib/leap_cli/remote/puppet_plugin.rb2
-rw-r--r--lib/leap_cli/remote/tasks.rb5
3 files changed, 15 insertions, 3 deletions
diff --git a/lib/leap_cli/remote/leap_plugin.rb b/lib/leap_cli/remote/leap_plugin.rb
index af88c2a..e425842 100644
--- a/lib/leap_cli/remote/leap_plugin.rb
+++ b/lib/leap_cli/remote/leap_plugin.rb
@@ -6,6 +6,10 @@
module LeapCli; module Remote; module LeapPlugin
def required_packages
+ "puppet rsync lsb-release locales"
+ end
+
+ def required_wheezy_packages
"puppet ruby-hiera-puppet rsync lsb-release locales"
end
@@ -61,6 +65,13 @@ module LeapCli; module Remote; module LeapPlugin
end
#
+ # dumps the recent deploy history to the console
+ #
+ def history
+ run "(test -s /var/log/leap/deploy-summary.log && tail /var/log/leap/deploy-summary.log) || (test -s /var/log/leap/deploy-summary.log.1 && tail /var/log/leap/deploy-summary.log.1) || (echo 'no history')"
+ end
+
+ #
# This is a hairy ugly hack, exactly the kind of stuff that makes ruby
# dangerous and too much fun for its own good.
#
diff --git a/lib/leap_cli/remote/puppet_plugin.rb b/lib/leap_cli/remote/puppet_plugin.rb
index e3f6be2..77bb4a3 100644
--- a/lib/leap_cli/remote/puppet_plugin.rb
+++ b/lib/leap_cli/remote/puppet_plugin.rb
@@ -18,7 +18,7 @@ module LeapCli; module Remote; module PuppetPlugin
elsif item[1] === true
str << "--" + item[0].to_s
else
- str << "--" + item[0].to_s + " " + item[1].to_s
+ str << "--" + item[0].to_s + " " + item[1].inspect
end
}.join(' ')
end
diff --git a/lib/leap_cli/remote/tasks.rb b/lib/leap_cli/remote/tasks.rb
index 7fd8d64..ab60a51 100644
--- a/lib/leap_cli/remote/tasks.rb
+++ b/lib/leap_cli/remote/tasks.rb
@@ -34,10 +34,11 @@ BAD_APT_GET_UPDATE = /(BADSIG|NO_PUBKEY|KEYEXPIRED|REVKEYSIG|NODATA)/
task :install_prerequisites, :max_hosts => MAX_HOSTS do
apt_get = "DEBIAN_FRONTEND=noninteractive apt-get -q -y -o DPkg::Options::=--force-confold"
+ apt_get_update = "apt-get update -o Acquire::Languages=none"
leap.mkdirs Leap::Platform.leap_dir
run "echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen"
leap.log :updating, "package list" do
- run "apt-get update" do |channel, stream, data|
+ run apt_get_update do |channel, stream, data|
# sadly exitcode is unreliable measure if apt-get update hit a failure.
if data =~ BAD_APT_GET_UPDATE
LeapCli::Util.bail! do
@@ -57,7 +58,7 @@ task :install_prerequisites, :max_hosts => MAX_HOSTS do
run "( test -f /etc/init.d/ntp && /etc/init.d/ntp start ) || true"
end
leap.log :installing, "required packages" do
- run "#{apt_get} install #{leap.required_packages}"
+ run %[#{apt_get} install $( (grep -q wheezy /etc/debian_version && echo #{leap.required_wheezy_packages}) || echo #{leap.required_packages} )]
end
#run "locale-gen"
leap.mkdirs("/etc/leap", "/srv/leap")