mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Merge pull request #149 from frozenfoxx/master
Added prefix parameter to the vmpooler configuration
This commit is contained in:
commit
9e8a7d034b
3 changed files with 8 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ module Vmpooler
|
||||||
parsed_config[:config]['task_limit'] ||= 10
|
parsed_config[:config]['task_limit'] ||= 10
|
||||||
parsed_config[:config]['vm_checktime'] ||= 15
|
parsed_config[:config]['vm_checktime'] ||= 15
|
||||||
parsed_config[:config]['vm_lifetime'] ||= 24
|
parsed_config[:config]['vm_lifetime'] ||= 24
|
||||||
|
parsed_config[:config]['prefix'] ||= ''
|
||||||
|
|
||||||
# Create an index of pool aliases
|
# Create an index of pool aliases
|
||||||
parsed_config[:pools].each do |pool|
|
parsed_config[:pools].each do |pool|
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ module Vmpooler
|
||||||
|
|
||||||
# Generate a randomized hostname
|
# Generate a randomized hostname
|
||||||
o = [('a'..'z'), ('0'..'9')].map(&:to_a).flatten
|
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)
|
# Add VM to Redis inventory ('pending' pool)
|
||||||
$redis.sadd('vmpooler__pending__' + vm['template'], vm['hostname'])
|
$redis.sadd('vmpooler__pending__' + vm['template'], vm['hostname'])
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,11 @@
|
||||||
#
|
#
|
||||||
# - domain
|
# - domain
|
||||||
# If set, returns a top-level 'domain' JSON key in POST requests
|
# If set, returns a top-level 'domain' JSON key in POST requests
|
||||||
|
#
|
||||||
|
# - prefix
|
||||||
|
# If set, prefixes all created VMs with this string. This should include
|
||||||
|
# a separator.
|
||||||
|
# (optional; default: '')
|
||||||
|
|
||||||
# Example:
|
# Example:
|
||||||
|
|
||||||
|
|
@ -176,6 +181,7 @@
|
||||||
- 'created_by'
|
- 'created_by'
|
||||||
- 'project'
|
- 'project'
|
||||||
domain: 'company.com'
|
domain: 'company.com'
|
||||||
|
prefix: 'poolvm-'
|
||||||
|
|
||||||
# :pools:
|
# :pools:
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue