Class: RSpecSystem::Helpers::PuppetMasterInstall

Inherits:
RSpecSystem::Helper
  • Object
show all
Defined in:
lib/rspec-system-puppet/helpers/puppet_master_install.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rspec-system-puppet/helpers/puppet_master_install.rb', line 7

def execute
  node = opts[:node]
  facts = node.facts

  if facts['osfamily'] == 'RedHat'
    shell :c => 'yum install -y puppet-server', :n => node
    if facts['operatingsystemrelease'] =~ /^5\./
      shell :c => '/etc/init.d/puppetmaster start', :n => node
    else
      shell :c => 'service puppetmaster start', :n => node
    end
  elsif facts['osfamily'] == 'Debian'
    shell :c => 'apt-get install -y puppetmaster', :n => node
    shell :c => 'service puppetmaster start', :n => node
  end

  {}
end