mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Added prefix parameter to the vmpooler configuration
This commit is contained in:
parent
ad4e760f56
commit
10e507c262
3 changed files with 6 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ module Vmpooler
|
|||
parsed_config[:config]['task_limit'] ||= 10
|
||||
parsed_config[:config]['vm_checktime'] ||= 15
|
||||
parsed_config[:config]['vm_lifetime'] ||= 24
|
||||
parsed_config[:config]['prefix'] ||= ''
|
||||
|
||||
# Create an index of pool aliases
|
||||
parsed_config[:pools].each do |pool|
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ module Vmpooler
|
|||
|
||||
# Generate a randomized hostname
|
||||
o = [('a'..'z'), ('0'..'9')].map(&:to_a).flatten
|
||||
vm['hostname'] = o[rand(25)] + (0...14).map { o[rand(o.length)] }.join
|
||||
vm['hostname'] = $config[:config]['prefix'] + o[rand(25)] + (0...14).map { o[rand(o.length)] }.join
|
||||
|
||||
# Add VM to Redis inventory ('pending' pool)
|
||||
$redis.sadd('vmpooler__pending__' + vm['template'], vm['hostname'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue