diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/leap_cli/commands/deploy.rb | 27 | ||||
-rw-r--r-- | lib/leap_cli/commands/util.rb | 18 | ||||
-rw-r--r-- | lib/leap_cli/remote/plugin.rb | 8 |
3 files changed, 39 insertions, 14 deletions
diff --git a/lib/leap_cli/commands/deploy.rb b/lib/leap_cli/commands/deploy.rb index c5efed5..8febe4d 100644 --- a/lib/leap_cli/commands/deploy.rb +++ b/lib/leap_cli/commands/deploy.rb @@ -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 diff --git a/lib/leap_cli/commands/util.rb b/lib/leap_cli/commands/util.rb index 852d22c..46fe44b 100644 --- a/lib/leap_cli/commands/util.rb +++ b/lib/leap_cli/commands/util.rb @@ -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. diff --git a/lib/leap_cli/remote/plugin.rb b/lib/leap_cli/remote/plugin.rb index 22ffe34..3fb5160 100644 --- a/lib/leap_cli/remote/plugin.rb +++ b/lib/leap_cli/remote/plugin.rb @@ -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 # |