Module: Beaker::DSL::InstallUtils::AIODefaults
- Included in:
- FOSSUtils, BeakerPuppet::InstallUtils
- Defined in:
- lib/beaker-puppet/install_utils/aio_defaults.rb
Overview
This module contains default values for aio paths and directorys per-platform
Constant Summary collapse
- AIO_DEFAULTS =
Here be the pathing and default values for AIO installs
{ 'unix' => { 'puppetbindir' => '/opt/puppetlabs/bin', 'privatebindir' => '/opt/puppetlabs/puppet/bin', 'distmoduledir' => '/etc/puppetlabs/code/modules', 'sitemoduledir' => '/opt/puppetlabs/puppet/modules', }, 'windows' => { #windows 'puppetbindir' => '/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/bin:/cygdrive/c/Program Files/Puppet Labs/Puppet/bin', 'privatebindir' => '/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/sys/ruby/bin:/cygdrive/c/Program Files/Puppet Labs/Puppet/sys/ruby/bin', 'distmoduledir' => '`cygpath -smF 35`/PuppetLabs/code/modules', # sitemoduledir not included (check PUP-4049 for more info) }, 'pwindows' => { #pure windows 'puppetbindir' => '"C:\\Program Files (x86)\\Puppet Labs\\Puppet\\bin";"C:\\Program Files\\Puppet Labs\\Puppet\\bin"', 'privatebindir' => '"C:\\Program Files (x86)\\Puppet Labs\\Puppet\\sys\\ruby\\bin";"C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin"', 'distmoduledir' => 'C:\\ProgramData\\PuppetLabs\\code\\modules', } }
Instance Method Summary collapse
-
#add_aio_defaults_on(hosts) ⇒ Object
Add the appropriate aio defaults to an array of hosts.
- #add_platform_aio_defaults(host, platform) ⇒ Object
-
#remove_aio_defaults_on(hosts) ⇒ Object
Remove the appropriate aio defaults from an array of hosts.
- #remove_platform_aio_defaults(host, platform) ⇒ Object
Instance Method Details
#add_aio_defaults_on(hosts) ⇒ Object
Add the appropriate aio defaults to an array of hosts
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/beaker-puppet/install_utils/aio_defaults.rb', line 49 def add_aio_defaults_on(hosts) block_on hosts do | host | if host.is_powershell? platform = 'pwindows' elsif host['platform'] =~ /windows/ platform = 'windows' else platform = 'unix' end add_platform_aio_defaults(host, platform) end end |
#add_platform_aio_defaults(host, platform) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/beaker-puppet/install_utils/aio_defaults.rb', line 34 def add_platform_aio_defaults(host, platform) AIO_DEFAULTS[platform].each_pair do |key, val| host[key] = val end # add group and type here for backwards compatability if host['platform'] =~ /windows/ host['group'] = 'Administrators' else host['group'] = 'puppet' end end |
#remove_aio_defaults_on(hosts) ⇒ Object
Remove the appropriate aio defaults from an array of hosts
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/beaker-puppet/install_utils/aio_defaults.rb', line 75 def remove_aio_defaults_on(hosts) block_on hosts do | host | if host.is_powershell? platform = 'pswindows' elsif host['platform'] =~ /windows/ platform = 'windows' else platform = 'unix' end remove_platform_aio_defaults(host, platform) end end |
#remove_platform_aio_defaults(host, platform) ⇒ Object
65 66 67 68 69 70 |
# File 'lib/beaker-puppet/install_utils/aio_defaults.rb', line 65 def remove_platform_aio_defaults(host, platform) AIO_DEFAULTS[platform].each_pair do |key, val| host.delete(key) end host['group'] = nil end |