Skip to content

Commit

Permalink
qeng1721: added AIO windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
kevpl committed Feb 17, 2015
1 parent 84400ed commit 6f8deb7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
9 changes: 8 additions & 1 deletion lib/beaker/dsl/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,14 @@ def stop_agent_on(agent)
# In all the case that it is different, this init script will exist. So we can assume
# that if the script doesn't exist, we should just use `pe-puppet`
result = on agent, "[ -e /etc/init.d/pe-puppet-agent ]", :acceptable_exit_codes => [0,1]
agent_service = (result.exit_code == 0) ? 'pe-puppet-agent' : 'pe-puppet'
agent_service = 'pe-puppet-agent'
if result.exit_code != 0
if agent['pe_ver'] && !version_is_less(agent['pe_ver'], '4.0')
agent_service = 'puppet'
else
agent_service = 'pe-puppet'
end
end

# Under a number of stupid circumstances, we can't stop the
# agent using puppet. This is usually because of issues with
Expand Down
9 changes: 8 additions & 1 deletion lib/beaker/dsl/install_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,18 @@ def do_install hosts, opts = {}
host['dist'] = "puppet-enterprise-#{version}-#{host['platform']}"
elsif host['platform'] =~ /windows/
version = host[:pe_ver] || opts['pe_ver_win']
should_install_64bit = !(version_is_less(version, '3.4')) && host.is_x86_64? && !host['install_32'] && !opts['install_32']
#only install 64bit builds if
# - we are on pe version 3.4+
# - we do not have install_32 set on host
# - we do not have install_32 set globally
if !(version_is_less(version, '3.4')) and host.is_x86_64? and not host['install_32'] and not opts['install_32']
if !(version_is_less(version, '4.0'))
if should_install_64bit
host['dist'] = "puppet-agent-#{version}-x64"
else
host['dist'] = "puppet-agent-#{version}-x86"
end
elsif should_install_64bit
host['dist'] = "puppet-enterprise-#{version}-x64"
else
host['dist'] = "puppet-enterprise-#{version}"
Expand Down
10 changes: 7 additions & 3 deletions lib/beaker/host/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,23 @@ def self.foss_defaults
'user' => 'Administrator',
'group' => 'Administrators',
'puppetpath' => '`cygpath -smF 35`/PuppetLabs/puppet/etc',
'puppetconfdir' => '`cygpath -smF 35`/PuppetLabs/puppet/etc',
'puppetcodedir' => '`cygpath -smF 35`/PuppetLabs/puppet/etc',
'puppetconfdir' => '`cygpath -smF 35`/PuppetLabs/puppet/etc',
'puppetcodedir' => '`cygpath -smF 35`/PuppetLabs/puppet/etc',
'hieraconf' => '`cygpath -smF 35`/Puppetlabs/puppet/etc/hiera.yaml',
'puppetvardir' => '`cygpath -smF 35`/PuppetLabs/puppet/var',
'distmoduledir' => '`cygpath -smF 35`/PuppetLabs/puppet/etc/modules',
'sitemoduledir' => 'C:/usr/share/puppet/modules',
'hieralibdir' => '`cygpath -w /opt/puppet-git-repos/hiera/lib`',
'hierapuppetlibdir' => '`cygpath -w /opt/puppet-git-repos/hiera-puppet/lib`',
#let's just add both potential bin dirs to the path, include ruby too for `gem`, `ruby`, etc
'puppetbindir' => '/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/bin:/cygdrive/c/Program Files/Puppet Labs/Puppet/bin:/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/sys/ruby/bin:/cygdrive/c/Program Files/Puppet Labs/Puppet/sys/ruby/bin',
'puppetbindir' => '/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/bin:/cygdrive/c/Program Files/Puppet Labs/Puppet/bin:/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/sys/ruby/bin:/cygdrive/c/Program Files/Puppet Labs/Puppet/sys/ruby/bin',
'hierabindir' => '/opt/puppet-git-repos/hiera/bin',
'pathseparator' => ';',
})
end

def self.aio_defaults
self.foss_defaults
end
end
end
1 change: 1 addition & 0 deletions spec/beaker/dsl/install_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ def logger
allow( subject ).to receive( :sign_certificate_for ).and_return( true )
allow( subject ).to receive( :stop_agent_on ).and_return( true )
allow( subject ).to receive( :sleep_until_puppetdb_started ).and_return( true )
allow( subject ).to receive( :version_is_less ).with('3.0', '4.0').and_return( true )
allow( subject ).to receive( :version_is_less ).with('3.0', '3.4').and_return( true )
allow( subject ).to receive( :version_is_less ).with('3.0', '3.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with('3.0', '3.4').and_return( true )
Expand Down

0 comments on commit 6f8deb7

Please sign in to comment.