Allow setting enabled drivers in the configuration
For it to work, disable HTML escaping in the rendered (we're not dealing with HTML anyway). Related to blueprint switch-to-virtualbmc Change-Id: Ib649ffb402d3b01192a20354a17bc76e07ece80e
This commit is contained in:
parent
3c366c9d71
commit
c677aa81ce
|
@ -22,7 +22,7 @@ import pystache
|
|||
|
||||
from instack_undercloud import undercloud
|
||||
|
||||
renderer = pystache.Renderer()
|
||||
renderer = pystache.Renderer(escape=lambda s: s)
|
||||
template = os.path.join(os.path.dirname(__file__),
|
||||
'..',
|
||||
'puppet-stack-config.yaml.template')
|
||||
|
|
|
@ -361,11 +361,7 @@ nova::keystone::auth::configure_ec2_endpoint: false
|
|||
# Ironic
|
||||
ironic::debug: "%{hiera('debug')}"
|
||||
ironic::my_ip: {{LOCAL_IP}}
|
||||
ironic::enabled_drivers:
|
||||
- 'pxe_ipmitool'
|
||||
- 'pxe_ssh'
|
||||
- 'pxe_drac'
|
||||
- 'pxe_ilo'
|
||||
ironic::enabled_drivers: {{ENABLED_DRIVERS}}
|
||||
ironic::rpc_response_timeout: 600
|
||||
ironic::api::authtoken::password: {{UNDERCLOUD_IRONIC_PASSWORD}}
|
||||
ironic::api::authtoken::auth_uri: "%{hiera('keystone_auth_uri')}"
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
import collections
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
@ -279,6 +280,11 @@ class TestGenerateEnvironment(BaseTestCase):
|
|||
'default,extra-hardware,logs')
|
||||
self.assertEqual('192.0.2.1/24', env['PUBLIC_INTERFACE_IP'])
|
||||
self.assertEqual('192.0.2.1', env['LOCAL_IP'])
|
||||
# The list is generated from a set, so we can't rely on ordering.
|
||||
# Instead make sure that it looks like a valid list by parsing it.
|
||||
drivers = json.loads(env['ENABLED_DRIVERS'])
|
||||
self.assertEqual(sorted(drivers), ['pxe_drac', 'pxe_ilo',
|
||||
'pxe_ipmitool', 'pxe_ssh'])
|
||||
|
||||
def test_generate_endpoints(self):
|
||||
env = undercloud._generate_environment('.')
|
||||
|
|
|
@ -328,6 +328,10 @@ _opts = [
|
|||
default=False,
|
||||
help=('Whether to clean overcloud nodes (wipe the hard drive) '
|
||||
'between deployments and after the introspection.')),
|
||||
cfg.ListOpt('enabled_drivers',
|
||||
default=['pxe_ipmitool', 'pxe_drac', 'pxe_ilo', 'pxe_ssh'],
|
||||
help=('List of enabled bare metal drivers.')),
|
||||
|
||||
]
|
||||
|
||||
# Passwords, tokens, hashes
|
||||
|
@ -895,6 +899,10 @@ def _generate_environment(instack_root):
|
|||
|
||||
instack_env['INSPECTION_KERNEL_ARGS'] = ' '.join(inspection_kernel_args)
|
||||
|
||||
# Ensure correct rendering of the list and uniqueness of the items
|
||||
instack_env['ENABLED_DRIVERS'] = (
|
||||
'[%s]' % ', '.join('"%s"' % drv for drv in set(CONF.enabled_drivers)))
|
||||
|
||||
instack_env['PUBLIC_INTERFACE_IP'] = instack_env['LOCAL_IP']
|
||||
instack_env['LOCAL_IP'] = instack_env['LOCAL_IP'].split('/')[0]
|
||||
if instack_env['UNDERCLOUD_SERVICE_CERTIFICATE']:
|
||||
|
|
|
@ -177,6 +177,9 @@
|
|||
# deployments and after the introspection. (boolean value)
|
||||
#clean_nodes = false
|
||||
|
||||
# List of enabled bare metal drivers. (list value)
|
||||
#enabled_drivers = pxe_ipmitool,pxe_drac,pxe_ilo,pxe_ssh
|
||||
|
||||
|
||||
[auth]
|
||||
|
||||
|
|
Loading…
Reference in New Issue