]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
use new hardcoded paths /etc/leap and /srv/leap
authorelijah <elijah@riseup.net>
Wed, 24 Oct 2012 11:08:21 +0000 (04:08 -0700)
committerelijah <elijah@riseup.net>
Wed, 24 Oct 2012 11:08:21 +0000 (04:08 -0700)
lib/leap_cli/commands/deploy.rb
lib/leap_cli/commands/util.rb
lib/leap_cli/remote/plugin.rb

index c5efed5de0c83a0ff1b48a784cd56998e979128e..8febe4db97e66ff2f81d56f19a81fe4d240af4fc 100644 (file)
@@ -13,13 +13,34 @@ module LeapCli
             quit! "OK. Bye."
           end
         end
-        leap_root = '/root/leap'
         ssh_connect(nodes) do |ssh|
-          ssh.leap.mkdir_leap leap_root
+          # directory setup
+          ssh.leap.mkdir("/etc/leap")
+          ssh.leap.mkdir("/srv/leap")
+          ssh.leap.chown_root("/etc/leap")
+          ssh.leap.chown_root("/srv/leap")
+
+          # sync hiera conf
           ssh.leap.rsync_update do |server|
             node = manager.node(server.host)
-            {:source => Path.named_path([:hiera, node.name]), :dest => "#{leap_root}/config/#{node.name}.yaml"}
+            {:source => Path.named_path([:hiera, node.name]), :dest => "/etc/leap/hiera.yaml"}
           end
+
+          # sync puppet
+          #
+          # what we want:
+          #     puppet apply --confdir /srv/leap/puppet /srv/leap/puppet/manifests/site.pp | grep -v 'warning:.*is deprecated'
+          #
+          # what we get currently:
+          #
+          #
+          ssh.set :puppet_source, [Path.platform, 'puppet'].join('/')
+          ssh.set :puppet_destination, '/srv/leap'
+          #cap.set :puppet_command, 'puppet apply'
+          ssh.set :puppet_lib, "puppet/modules"
+          ssh.set :puppet_parameters, '--confdir puppet puppet/manifests/site.pp'
+          #cap.set :puppet_stream_output, false
+          #puppet_cmd = "cd #{puppet_destination} && #{sudo_cmd} #{puppet_command} --modulepath=#{puppet_lib} #{puppet_parameters}"
           ssh.apply_puppet
         end
       end
index 852d22c60f6e9935826ec034e1593a17a27b0da7..46fe44b12b853fd14c4285a1b31e74a71eebaf5d 100644 (file)
@@ -52,15 +52,15 @@ module LeapCli; module Commands
     cap.set :ssh_options, ssh_options
     cap.set :use_sudo, false # we may want to change this in the future
 
-    # supply drop options
-    cap.set :puppet_source, [Path.platform, 'puppet'].join('/')
-    cap.set :puppet_destination, '/root/leap'
-    #cap.set :puppet_command, 'puppet apply'
-    cap.set :puppet_lib, "puppet/modules"
-    cap.set :puppet_parameters, '--confdir=puppet puppet/manifests/site.pp'
-    #cap.set :puppet_stream_output, false
-    #puppet apply --confdir=puppet puppet/manifests/site.pp  | grep -v 'warning:.*is deprecated'
-    #puppet_cmd = "cd #{puppet_destination} && #{sudo_cmd} #{puppet_command} --modulepath=#{puppet_lib} #{puppet_parameters}"
+    # supply drop options
+    cap.set :puppet_source, [Path.platform, 'puppet'].join('/')
+    cap.set :puppet_destination, '/root/leap'
+    # #cap.set :puppet_command, 'puppet apply'
+    cap.set :puppet_lib, "puppet/modules"
+    cap.set :puppet_parameters, '--confdir=puppet puppet/manifests/site.pp'
+    # #cap.set :puppet_stream_output, false
+    # #puppet apply --confdir=puppet puppet/manifests/site.pp  | grep -v 'warning:.*is deprecated'
+    # #puppet_cmd = "cd #{puppet_destination} && #{sudo_cmd} #{puppet_command} --modulepath=#{puppet_lib} #{puppet_parameters}"
 
     #
     # allow password authentication when we are bootstraping a single node.
index 22ffe34530472a6b1decfb18f2603659af4ec242..3fb516027a2481df192dcb50ba5833bd17b7bbe6 100644 (file)
@@ -4,8 +4,12 @@
 
 module LeapCli; module Remote; module Plugin
 
-  def mkdir_leap(base_dir)
-    run "mkdir -p #{base_dir}/config && chown -R root #{base_dir} && chmod -R ag-rwx,u+rwX #{base_dir}"
+  def mkdir(dir)
+    run "mkdir -p #{dir}"
+  end
+
+  def chown_root(dir)
+    run "chown root -R #{dir} && chmod -R ag-rwx,u+rwX #{dir}"
   end
 
   #