Sha256: 2359562733f5dfd2e6b7831fe16172065a0ec2b92a7b9239d76f78c6272b4a36

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

require 'pe_build/on_machine'
class PEBuild::Cap::RunInstall::POSIX

  extend PEBuild::OnMachine

  def self.run_install(machine, config, archive)

    # NOTE: This test for both the 3.x and 4.x installation locations. Should
    # probably refactor this into something cleaner.
    if machine.communicate.test('test -f /opt/puppet/pe_version || test -f /opt/puppetlabs/server/pe_version')
      machine.ui.warn I18n.t('pebuild.cap.run_install.already_installed'),
                      :name  => machine.name
      return
    end

    root = File.join('/vagrant', PEBuild::WORK_DIR)

    cmd_path = []
    cmd_path << root

    cmd_path << archive.installer_dir
    cmd_path << "puppet-enterprise-installer"

    cmd     = File.join(cmd_path)
    answers = File.join(root, 'answers', "#{machine.name}.txt")

    argv = "#{cmd} -a #{answers}"

    on_machine(machine, argv)


    if machine.communicate.test('which at')
      machine.ui.info I18n.t('pebuild.cap.run_install.scheduling_run')
      machine.communicate.sudo("echo 'PATH=/opt/puppet/bin:/opt/puppetlabs/puppet/bin:$PATH puppet agent -t --waitforcert 10' | at now '+ 1min'")
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vagrant-pe_build-0.13.7 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.13.6 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.13.5 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.13.4 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.13.3 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.13.2 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.13.1 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.13.0 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.12.0 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.11.0 lib/pe_build/cap/run_install/posix.rb
vagrant-pe_build-0.10.4 lib/pe_build/cap/run_install/posix.rb