Sha256: 8971d234e25d9585085094a9021e6fe0d876c31a525b8e7a8005dd7820f867c5

Contents?: true

Size: 963 Bytes

Versions: 3

Compression:

Stored size: 963 Bytes

Contents

Dir.glob("#{File.dirname(__FILE__)}/*.rake").each { |r| load r }
Dir.glob("#{File.dirname(__FILE__)}/config/*.rake").each { |r| load r }

## Common libraries
def template(template_name, target_path)
  begin
    file = File.read("#{File.dirname(__FILE__)}/config/templates/#{template_name}.erb")
  rescue
    file = File.read("lib/capistrano/config/templates/#{template_name}.erb")
  end

  template = ERB.new file, nil, trim_mode: "%"
  rendered = template.result(binding)
  tmp_file = "/tmp/#{SecureRandom.hex}.#{template_name}"
  upload! StringIO.new(rendered), tmp_file
  execute "sudo cp #{tmp_file} #{target_path}"
  execute  "rm #{tmp_file}"
end

## Bastion config
def bastion(host, user:)
  require 'net/ssh/proxy/command'
  ssh_command = "ssh -W %h:%p -o StrictHostKeyChecking=no #{user}@#{host}"
  set :ssh_options, proxy: Net::SSH::Proxy::Command.new(ssh_command)
end

def apt_nointeractive
  'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
prun-ops-0.3.4 lib/capistrano/prun-ops.rb
prun-ops-0.3.3 lib/capistrano/prun-ops.rb
prun-ops-0.3.2 lib/capistrano/prun-ops.rb