File: cfengine_install.rb

package info (click to toggle)
vagrant 2.2.14%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,800 kB
  • sloc: ruby: 97,301; sh: 375; makefile: 16; lisp: 1
file content (21 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module VagrantPlugins
  module CFEngine
    module Cap
      module Debian
        module CFEngineInstall
          def self.cfengine_install(machine, config)
            machine.communicate.tap do |comm|
              comm.sudo("mkdir -p #{File.dirname(config.deb_repo_file)} && /bin/echo #{config.deb_repo_line} > #{config.deb_repo_file}")
              comm.sudo("GPGFILE=`tempfile`; wget -O $GPGFILE #{config.repo_gpg_key_url} && apt-key add $GPGFILE; rm -f $GPGFILE")
              
              comm.sudo("apt-get install -y --force-yes apt-transport-https");
              
              comm.sudo("apt-get update")
              comm.sudo("apt-get install -y #{config.package_name}")
            end
          end
        end
      end
    end
  end
end