Convert hyphens to underscores for service names
The Chef Style Guide[1] does not recommend using hyphens for cookbook or resource names. To maintain consistency, we should follow best practices. [1]: https://docs.chef.io/ruby.html#use-of-hyphens Depends-On: Ic2b6d8f1cdf719791faaebdbd7e29e789eb3f31c Change-Id: Ib8b6ed53f2d4e97ea5bfc89f5fb8fac42308b3b7
This commit is contained in:
4
.gitreview
Normal file
4
.gitreview
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[gerrit]
|
||||||
|
host=review.openstack.org
|
||||||
|
port=29418
|
||||||
|
project=openstack/cookbook-openstack-bare-metal.git
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
default['openstack']['baremetal']['conductor']['periodic_max_workers'] = 8
|
default['openstack']['bare_metal']['conductor']['periodic_max_workers'] = 8
|
||||||
default['openstack']['baremetal']['conductor']['workers_pool_size'] = 100
|
default['openstack']['bare_metal']['conductor']['workers_pool_size'] = 100
|
||||||
|
|||||||
@@ -20,92 +20,92 @@
|
|||||||
|
|
||||||
# Set to some text value if you want templated config files
|
# Set to some text value if you want templated config files
|
||||||
# to contain a custom banner at the top of the written file
|
# to contain a custom banner at the top of the written file
|
||||||
default['openstack']['baremetal']['custom_template_banner'] = "
|
default['openstack']['bare_metal']['custom_template_banner'] = "
|
||||||
# This file is managed by Chef
|
# This file is managed by Chef
|
||||||
# Do not edit, changes will be overwritten
|
# Do not edit, changes will be overwritten
|
||||||
"
|
"
|
||||||
|
|
||||||
%w(admin internal public).each do |ep_type|
|
%w(admin internal public).each do |ep_type|
|
||||||
# host for openstack admin/internal/public bare metal endpoint
|
# host for openstack admin/internal/public bare metal endpoint
|
||||||
default['openstack']['endpoints'][ep_type]['baremetal']['host'] = '127.0.0.1'
|
default['openstack']['endpoints'][ep_type]['bare_metal']['host'] = '127.0.0.1'
|
||||||
# scheme for openstack admin/internal/public bare metal endpoint
|
# scheme for openstack admin/internal/public bare metal endpoint
|
||||||
default['openstack']['endpoints'][ep_type]['baremetal']['scheme'] = 'http'
|
default['openstack']['endpoints'][ep_type]['bare_metal']['scheme'] = 'http'
|
||||||
# port for openstack admin/internal/public bare metal endpoint
|
# port for openstack admin/internal/public bare metal endpoint
|
||||||
default['openstack']['endpoints'][ep_type]['baremetal']['port'] = 6385
|
default['openstack']['endpoints'][ep_type]['bare_metal']['port'] = 6385
|
||||||
# path for openstack admin/internal/public bare metal endpoint
|
# path for openstack admin/internal/public bare metal endpoint
|
||||||
default['openstack']['endpoints'][ep_type]['baremetal']['path'] = ''
|
default['openstack']['endpoints'][ep_type]['bare_metal']['path'] = ''
|
||||||
end
|
end
|
||||||
|
|
||||||
default['openstack']['baremetal']['verbose'] = 'false'
|
default['openstack']['bare_metal']['verbose'] = 'false'
|
||||||
default['openstack']['baremetal']['debug'] = 'false'
|
default['openstack']['bare_metal']['debug'] = 'false'
|
||||||
|
|
||||||
# Maximum number of worker threads that can be started
|
# Maximum number of worker threads that can be started
|
||||||
# simultaneously by a periodic task. Should be less than RPC
|
# simultaneously by a periodic task. Should be less than RPC
|
||||||
# thread pool size. (integer value)
|
# thread pool size. (integer value)
|
||||||
default['openstack']['baremetal']['conductor']['periodic_max_workers'] = 8
|
default['openstack']['bare_metal']['conductor']['periodic_max_workers'] = 8
|
||||||
|
|
||||||
# The size of the workers greenthread pool. (integer value)
|
# The size of the workers greenthread pool. (integer value)
|
||||||
default['openstack']['baremetal']['conductor']['workers_pool_size'] = 100
|
default['openstack']['bare_metal']['conductor']['workers_pool_size'] = 100
|
||||||
|
|
||||||
# Common rpc definitions
|
# Common rpc definitions
|
||||||
default['openstack']['baremetal']['rpc_thread_pool_size'] = 64
|
default['openstack']['bare_metal']['rpc_thread_pool_size'] = 64
|
||||||
default['openstack']['baremetal']['rpc_conn_pool_size'] = 30
|
default['openstack']['bare_metal']['rpc_conn_pool_size'] = 30
|
||||||
default['openstack']['baremetal']['rpc_response_timeout'] = 60
|
default['openstack']['bare_metal']['rpc_response_timeout'] = 60
|
||||||
|
|
||||||
# The name of the Chef role that knows about the message queue server
|
# The name of the Chef role that knows about the message queue server
|
||||||
# that Ironic uses
|
# that Ironic uses
|
||||||
default['openstack']['baremetal']['rabbit_server_chef_role'] = 'os-ops-messaging'
|
default['openstack']['bare_metal']['rabbit_server_chef_role'] = 'os-ops-messaging'
|
||||||
|
|
||||||
default['openstack']['baremetal']['rpc_backend'] = 'rabbit'
|
default['openstack']['bare_metal']['rpc_backend'] = 'rabbit'
|
||||||
|
|
||||||
# Logging stuff
|
# Logging stuff
|
||||||
default['openstack']['baremetal']['log_dir'] = '/var/log/ironic'
|
default['openstack']['bare_metal']['log_dir'] = '/var/log/ironic'
|
||||||
|
|
||||||
default['openstack']['baremetal']['syslog']['use'] = false
|
default['openstack']['bare_metal']['syslog']['use'] = false
|
||||||
default['openstack']['baremetal']['syslog']['facility'] = 'LOG_LOCAL1'
|
default['openstack']['bare_metal']['syslog']['facility'] = 'LOG_LOCAL1'
|
||||||
default['openstack']['baremetal']['syslog']['config_facility'] = 'local1'
|
default['openstack']['bare_metal']['syslog']['config_facility'] = 'local1'
|
||||||
|
|
||||||
default['openstack']['baremetal']['region'] = node['openstack']['region']
|
default['openstack']['bare_metal']['region'] = node['openstack']['region']
|
||||||
|
|
||||||
# Keystone settings
|
# Keystone settings
|
||||||
default['openstack']['baremetal']['api']['auth_strategy'] = 'keystone'
|
default['openstack']['bare_metal']['api']['auth_strategy'] = 'keystone'
|
||||||
|
|
||||||
default['openstack']['baremetal']['api']['auth']['version'] = node['openstack']['api']['auth']['version']
|
default['openstack']['bare_metal']['api']['auth']['version'] = node['openstack']['api']['auth']['version']
|
||||||
|
|
||||||
# Whether to allow the client to perform insecure SSL (https) requests
|
# Whether to allow the client to perform insecure SSL (https) requests
|
||||||
default['openstack']['baremetal']['api']['auth']['insecure'] = false
|
default['openstack']['bare_metal']['api']['auth']['insecure'] = false
|
||||||
|
|
||||||
default['openstack']['baremetal']['service_user'] = 'ironic'
|
default['openstack']['bare_metal']['service_user'] = 'ironic'
|
||||||
default['openstack']['baremetal']['project'] = 'service'
|
default['openstack']['bare_metal']['project'] = 'service'
|
||||||
default['openstack']['baremetal']['service_role'] = 'service'
|
default['openstack']['bare_metal']['service_role'] = 'service'
|
||||||
default['openstack']['baremetal']['service_name'] = 'ironic'
|
default['openstack']['bare_metal']['service_name'] = 'ironic'
|
||||||
default['openstack']['baremetal']['service_type'] = 'baremetal'
|
default['openstack']['bare_metal']['service_type'] = 'bare_metal'
|
||||||
|
|
||||||
default['openstack']['baremetal']['user'] = 'ironic'
|
default['openstack']['bare_metal']['user'] = 'ironic'
|
||||||
default['openstack']['baremetal']['group'] = 'ironic'
|
default['openstack']['bare_metal']['group'] = 'ironic'
|
||||||
|
|
||||||
# Setup the tftp variables
|
# Setup the tftp variables
|
||||||
default['openstack']['baremetal']['tftp']['enabled'] = false
|
default['openstack']['bare_metal']['tftp']['enabled'] = false
|
||||||
# IP address of Ironic compute node's tftp server
|
# IP address of Ironic compute node's tftp server
|
||||||
default['openstack']['baremetal']['tftp']['server'] = '127.0.0.1'
|
default['openstack']['bare_metal']['tftp']['server'] = '127.0.0.1'
|
||||||
# Ironic compute node's tftp root path
|
# Ironic compute node's tftp root path
|
||||||
default['openstack']['baremetal']['tftp']['root_path'] = '/var/lib/tftpboot'
|
default['openstack']['bare_metal']['tftp']['root_path'] = '/var/lib/tftpboot'
|
||||||
# Directory where master tftp images are stored on disk
|
# Directory where master tftp images are stored on disk
|
||||||
default['openstack']['baremetal']['tftp']['master_path'] = "#{node['openstack']['baremetal']['tftp']['root_path']}/master_images"
|
default['openstack']['bare_metal']['tftp']['master_path'] = "#{node['openstack']['bare_metal']['tftp']['root_path']}/master_images"
|
||||||
|
|
||||||
# Ironic WSGI app SSL settings
|
# Ironic WSGI app SSL settings
|
||||||
default['openstack']['baremetal']['ssl']['enabled'] = false
|
default['openstack']['bare_metal']['ssl']['enabled'] = false
|
||||||
default['openstack']['baremetal']['ssl']['certfile'] = ''
|
default['openstack']['bare_metal']['ssl']['certfile'] = ''
|
||||||
default['openstack']['baremetal']['ssl']['chainfile'] = ''
|
default['openstack']['bare_metal']['ssl']['chainfile'] = ''
|
||||||
default['openstack']['baremetal']['ssl']['keyfile'] = ''
|
default['openstack']['bare_metal']['ssl']['keyfile'] = ''
|
||||||
default['openstack']['baremetal']['ssl']['ca_certs_path'] = ''
|
default['openstack']['bare_metal']['ssl']['ca_certs_path'] = ''
|
||||||
default['openstack']['baremetal']['ssl']['cert_required'] = false
|
default['openstack']['bare_metal']['ssl']['cert_required'] = false
|
||||||
default['openstack']['baremetal']['ssl']['protocol'] = ''
|
default['openstack']['bare_metal']['ssl']['protocol'] = ''
|
||||||
default['openstack']['baremetal']['ssl']['ciphers'] = ''
|
default['openstack']['bare_metal']['ssl']['ciphers'] = ''
|
||||||
|
|
||||||
case node['platform_family']
|
case node['platform_family']
|
||||||
when 'fedora', 'rhel'
|
when 'fedora', 'rhel'
|
||||||
default['openstack']['baremetal']['platform'] = {
|
default['openstack']['bare_metal']['platform'] = {
|
||||||
'ironic_api_packages' => ['openstack-ironic-api'],
|
'ironic_api_packages' => ['openstack-ironic-api'],
|
||||||
'ironic_api_service' => 'openstack-ironic-api',
|
'ironic_api_service' => 'openstack-ironic-api',
|
||||||
'ironic_conductor_packages' => ['openstack-ironic-conductor', 'ipmitool'],
|
'ironic_conductor_packages' => ['openstack-ironic-conductor', 'ipmitool'],
|
||||||
@@ -113,7 +113,7 @@ when 'fedora', 'rhel'
|
|||||||
'ironic_common_packages' => ['openstack-ironic-common', 'python-ironicclient'],
|
'ironic_common_packages' => ['openstack-ironic-common', 'python-ironicclient'],
|
||||||
}
|
}
|
||||||
when 'debian'
|
when 'debian'
|
||||||
default['openstack']['baremetal']['platform'] = {
|
default['openstack']['bare_metal']['platform'] = {
|
||||||
'ironic_api_packages' => ['ironic-api'],
|
'ironic_api_packages' => ['ironic-api'],
|
||||||
'ironic_api_service' => 'ironic-api',
|
'ironic_api_service' => 'ironic-api',
|
||||||
'ironic_conductor_packages' => ['ironic-conductor', 'ipmitool'],
|
'ironic_conductor_packages' => ['ironic-conductor', 'ipmitool'],
|
||||||
@@ -126,18 +126,18 @@ end
|
|||||||
|
|
||||||
# The OpenStack Bare Metal (Ironic) API endpoint
|
# The OpenStack Bare Metal (Ironic) API endpoint
|
||||||
%w(public internal admin).each do |ep_type|
|
%w(public internal admin).each do |ep_type|
|
||||||
default['openstack']['endpoints'][ep_type]['baremetal']['scheme'] = 'http'
|
default['openstack']['endpoints'][ep_type]['bare_metal']['scheme'] = 'http'
|
||||||
default['openstack']['endpoints'][ep_type]['baremetal']['path'] = ''
|
default['openstack']['endpoints'][ep_type]['bare_metal']['path'] = ''
|
||||||
default['openstack']['endpoints'][ep_type]['baremetal']['host'] = '127.0.0.1'
|
default['openstack']['endpoints'][ep_type]['bare_metal']['host'] = '127.0.0.1'
|
||||||
default['openstack']['endpoints'][ep_type]['baremetal']['port'] = '6385'
|
default['openstack']['endpoints'][ep_type]['bare_metal']['port'] = '6385'
|
||||||
end
|
end
|
||||||
default['openstack']['bind_service']['all']['baremetal']['host'] = '127.0.0.1'
|
default['openstack']['bind_service']['all']['bare_metal']['host'] = '127.0.0.1'
|
||||||
default['openstack']['bind_service']['all']['baremetal']['port'] = '6385'
|
default['openstack']['bind_service']['all']['bare_metal']['port'] = '6385'
|
||||||
# ============================= rootwrap Configuration ===================
|
# ============================= rootwrap Configuration ===================
|
||||||
# use ironic root wrap
|
# use ironic root wrap
|
||||||
default['openstack']['baremetal']['use_rootwrap'] = true
|
default['openstack']['bare_metal']['use_rootwrap'] = true
|
||||||
# rootwrap.conf
|
# rootwrap.conf
|
||||||
default['openstack']['baremetal']['rootwrap']['conf'].tap do |conf|
|
default['openstack']['bare_metal']['rootwrap']['conf'].tap do |conf|
|
||||||
conf['DEFAULT']['filters_path'] = '/etc/ironic/rootwrap.d,/usr/share/ironic/rootwrap'
|
conf['DEFAULT']['filters_path'] = '/etc/ironic/rootwrap.d,/usr/share/ironic/rootwrap'
|
||||||
conf['DEFAULT']['exec_dirs'] = '/sbin,/usr/sbin,/bin,/usr/bin'
|
conf['DEFAULT']['exec_dirs'] = '/sbin,/usr/sbin,/bin,/usr/bin'
|
||||||
conf['DEFAULT']['use_syslog'] = false
|
conf['DEFAULT']['use_syslog'] = false
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
default['openstack']['baremetal']['conf_secrets'] = {}
|
default['openstack']['bare_metal']['conf_secrets'] = {}
|
||||||
|
|
||||||
default['openstack']['baremetal']['conf'].tap do |conf|
|
default['openstack']['bare_metal']['conf'].tap do |conf|
|
||||||
if node['openstack']['baremetal']['syslog']['use']
|
if node['openstack']['bare_metal']['syslog']['use']
|
||||||
conf['DEFAULT']['log_config'] = '/etc/openstack/logging.conf'
|
conf['DEFAULT']['log_config'] = '/etc/openstack/logging.conf'
|
||||||
end
|
end
|
||||||
conf['DEFAULT']['auth_strategy'] = 'keystone'
|
conf['DEFAULT']['auth_strategy'] = 'keystone'
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ end
|
|||||||
|
|
||||||
include_recipe 'openstack-bare-metal::ironic-common'
|
include_recipe 'openstack-bare-metal::ironic-common'
|
||||||
|
|
||||||
platform_options = node['openstack']['baremetal']['platform']
|
platform_options = node['openstack']['bare_metal']['platform']
|
||||||
|
|
||||||
platform_options['ironic_api_packages'].each do |pkg|
|
platform_options['ironic_api_packages'].each do |pkg|
|
||||||
package pkg do
|
package pkg do
|
||||||
@@ -35,8 +35,8 @@ platform_options['ironic_api_packages'].each do |pkg|
|
|||||||
end
|
end
|
||||||
|
|
||||||
directory '/var/cache/ironic' do
|
directory '/var/cache/ironic' do
|
||||||
owner node['openstack']['baremetal']['user']
|
owner node['openstack']['bare_metal']['user']
|
||||||
group node['openstack']['baremetal']['group']
|
group node['openstack']['bare_metal']['group']
|
||||||
mode 00700
|
mode 00700
|
||||||
action :create
|
action :create
|
||||||
end
|
end
|
||||||
@@ -58,7 +58,7 @@ apache_config 'ironic-wsgi' do
|
|||||||
enable false
|
enable false
|
||||||
end
|
end
|
||||||
|
|
||||||
bind_service = node['openstack']['bind_service']['all']['baremetal']
|
bind_service = node['openstack']['bind_service']['all']['bare_metal']
|
||||||
|
|
||||||
web_app 'ironic-api' do
|
web_app 'ironic-api' do
|
||||||
template 'wsgi-template.conf.erb'
|
template 'wsgi-template.conf.erb'
|
||||||
@@ -68,14 +68,14 @@ web_app 'ironic-api' do
|
|||||||
server_entry '/usr/bin/ironic-api-wsgi'
|
server_entry '/usr/bin/ironic-api-wsgi'
|
||||||
log_dir node['apache']['log_dir']
|
log_dir node['apache']['log_dir']
|
||||||
run_dir node['apache']['run_dir']
|
run_dir node['apache']['run_dir']
|
||||||
user node['openstack']['baremetal']['user']
|
user node['openstack']['bare_metal']['user']
|
||||||
group node['openstack']['baremetal']['group']
|
group node['openstack']['bare_metal']['group']
|
||||||
use_ssl node['openstack']['baremetal']['ssl']['enabled']
|
use_ssl node['openstack']['bare_metal']['ssl']['enabled']
|
||||||
cert_file node['openstack']['baremetal']['ssl']['certfile']
|
cert_file node['openstack']['bare_metal']['ssl']['certfile']
|
||||||
chain_file node['openstack']['baremetal']['ssl']['chainfile']
|
chain_file node['openstack']['bare_metal']['ssl']['chainfile']
|
||||||
key_file node['openstack']['baremetal']['ssl']['keyfile']
|
key_file node['openstack']['bare_metal']['ssl']['keyfile']
|
||||||
ca_certs_path node['openstack']['baremetal']['ssl']['ca_certs_path']
|
ca_certs_path node['openstack']['bare_metal']['ssl']['ca_certs_path']
|
||||||
cert_required node['openstack']['baremetal']['ssl']['cert_required']
|
cert_required node['openstack']['bare_metal']['ssl']['cert_required']
|
||||||
protocol node['openstack']['baremetal']['ssl']['protocol']
|
protocol node['openstack']['bare_metal']['ssl']['protocol']
|
||||||
ciphers node['openstack']['baremetal']['ssl']['ciphers']
|
ciphers node['openstack']['bare_metal']['ssl']['ciphers']
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ end
|
|||||||
|
|
||||||
include_recipe 'openstack-bare-metal::ironic-common'
|
include_recipe 'openstack-bare-metal::ironic-common'
|
||||||
|
|
||||||
platform_options = node['openstack']['baremetal']['platform']
|
platform_options = node['openstack']['bare_metal']['platform']
|
||||||
|
|
||||||
platform_options['ironic_conductor_packages'].each do |pkg|
|
platform_options['ironic_conductor_packages'].each do |pkg|
|
||||||
package pkg do
|
package pkg do
|
||||||
|
|||||||
@@ -28,22 +28,22 @@ identity_endpoint = internal_endpoint 'identity'
|
|||||||
auth_url = ::URI.decode identity_endpoint.to_s
|
auth_url = ::URI.decode identity_endpoint.to_s
|
||||||
|
|
||||||
interfaces = {
|
interfaces = {
|
||||||
public: { url: public_endpoint('baremetal') },
|
public: { url: public_endpoint('bare_metal') },
|
||||||
internal: { url: internal_endpoint('baremetal') },
|
internal: { url: internal_endpoint('bare_metal') },
|
||||||
admin: { url: admin_endpoint('baremetal') },
|
admin: { url: admin_endpoint('bare_metal') },
|
||||||
}
|
}
|
||||||
service_pass = get_password 'service', 'openstack-bare-metal'
|
service_pass = get_password 'service', 'openstack-bare-metal'
|
||||||
region = node['openstack']['baremetal']['region']
|
region = node['openstack']['bare_metal']['region']
|
||||||
service_project_name = node['openstack']['baremetal']['conf']['keystone_authtoken']['project_name']
|
service_project_name = node['openstack']['bare_metal']['conf']['keystone_authtoken']['project_name']
|
||||||
service_user = node['openstack']['baremetal']['service_user']
|
service_user = node['openstack']['bare_metal']['service_user']
|
||||||
admin_user = node['openstack']['identity']['admin_user']
|
admin_user = node['openstack']['identity']['admin_user']
|
||||||
admin_pass = get_password 'user', node['openstack']['identity']['admin_user']
|
admin_pass = get_password 'user', node['openstack']['identity']['admin_user']
|
||||||
admin_project = node['openstack']['identity']['admin_project']
|
admin_project = node['openstack']['identity']['admin_project']
|
||||||
admin_domain = node['openstack']['identity']['admin_domain_name']
|
admin_domain = node['openstack']['identity']['admin_domain_name']
|
||||||
service_domain_name = node['openstack']['baremetal']['conf']['keystone_authtoken']['user_domain_name']
|
service_domain_name = node['openstack']['bare_metal']['conf']['keystone_authtoken']['user_domain_name']
|
||||||
service_role = node['openstack']['baremetal']['service_role']
|
service_role = node['openstack']['bare_metal']['service_role']
|
||||||
service_name = node['openstack']['baremetal']['service_name']
|
service_name = node['openstack']['bare_metal']['service_name']
|
||||||
service_type = node['openstack']['baremetal']['service_type']
|
service_type = node['openstack']['bare_metal']['service_type']
|
||||||
|
|
||||||
connection_params = {
|
connection_params = {
|
||||||
openstack_auth_url: "#{auth_url}/auth/tokens",
|
openstack_auth_url: "#{auth_url}/auth/tokens",
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ class ::Chef::Recipe
|
|||||||
include ::Openstack
|
include ::Openstack
|
||||||
end
|
end
|
||||||
|
|
||||||
if node['openstack']['baremetal']['syslog']['use']
|
if node['openstack']['bare_metal']['syslog']['use']
|
||||||
include_recipe 'openstack-common::logging'
|
include_recipe 'openstack-common::logging'
|
||||||
end
|
end
|
||||||
|
|
||||||
platform_options = node['openstack']['baremetal']['platform']
|
platform_options = node['openstack']['bare_metal']['platform']
|
||||||
|
|
||||||
platform_options['ironic_common_packages'].each do |pkg|
|
platform_options['ironic_common_packages'].each do |pkg|
|
||||||
package pkg do
|
package pkg do
|
||||||
@@ -34,43 +34,43 @@ platform_options['ironic_common_packages'].each do |pkg|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
db_type = node['openstack']['db']['baremetal']['service_type']
|
db_type = node['openstack']['db']['bare_metal']['service_type']
|
||||||
node['openstack']['db']['python_packages'][db_type].each do |pkg|
|
node['openstack']['db']['python_packages'][db_type].each do |pkg|
|
||||||
package pkg do
|
package pkg do
|
||||||
action :upgrade
|
action :upgrade
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
db_user = node['openstack']['db']['baremetal']['username']
|
db_user = node['openstack']['db']['bare_metal']['username']
|
||||||
db_pass = get_password 'db', 'ironic'
|
db_pass = get_password 'db', 'ironic'
|
||||||
|
|
||||||
node.default['openstack']['baremetal']['conf_secrets']
|
node.default['openstack']['bare_metal']['conf_secrets']
|
||||||
.[]('database')['connection'] =
|
.[]('database')['connection'] =
|
||||||
db_uri('baremetal', db_user, db_pass)
|
db_uri('bare_metal', db_user, db_pass)
|
||||||
if node['openstack']['endpoints']['db']['enabled_slave']
|
if node['openstack']['endpoints']['db']['enabled_slave']
|
||||||
node.default['openstack']['baremetal']['conf_secrets']
|
node.default['openstack']['bare_metal']['conf_secrets']
|
||||||
.[]('database')['slave_connection'] =
|
.[]('database')['slave_connection'] =
|
||||||
db_uri('baremetal', db_user, db_pass, true)
|
db_uri('bare_metal', db_user, db_pass, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
if node['openstack']['mq']['service_type'] == 'rabbit'
|
if node['openstack']['mq']['service_type'] == 'rabbit'
|
||||||
node.default['openstack']['baremetal']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'baremetal'
|
node.default['openstack']['bare_metal']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'bare_metal'
|
||||||
end
|
end
|
||||||
|
|
||||||
# merge all config options and secrets to be used in ironic.conf
|
# merge all config options and secrets to be used in ironic.conf
|
||||||
ironic_conf_options = merge_config_options 'baremetal'
|
ironic_conf_options = merge_config_options 'bare_metal'
|
||||||
|
|
||||||
directory '/etc/ironic' do
|
directory '/etc/ironic' do
|
||||||
owner node['openstack']['baremetal']['user']
|
owner node['openstack']['bare_metal']['user']
|
||||||
group node['openstack']['baremetal']['group']
|
group node['openstack']['bare_metal']['group']
|
||||||
mode 00750
|
mode 00750
|
||||||
action :create
|
action :create
|
||||||
end
|
end
|
||||||
|
|
||||||
template '/etc/ironic/ironic.conf' do
|
template '/etc/ironic/ironic.conf' do
|
||||||
source 'ironic.conf.erb'
|
source 'ironic.conf.erb'
|
||||||
owner node['openstack']['baremetal']['user']
|
owner node['openstack']['bare_metal']['user']
|
||||||
group node['openstack']['baremetal']['group']
|
group node['openstack']['bare_metal']['group']
|
||||||
mode 00640
|
mode 00640
|
||||||
variables(
|
variables(
|
||||||
service_config: ironic_conf_options
|
service_config: ironic_conf_options
|
||||||
@@ -78,14 +78,14 @@ template '/etc/ironic/ironic.conf' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
# delete all secrets saved in the attribute
|
# delete all secrets saved in the attribute
|
||||||
# node['openstack']['baremetal']['conf_secrets'] after creating the config file
|
# node['openstack']['bare_metal']['conf_secrets'] after creating the config file
|
||||||
ruby_block "delete all attributes in node['openstack']['baremetal']['conf_secrets']" do
|
ruby_block "delete all attributes in node['openstack']['bare_metal']['conf_secrets']" do
|
||||||
block do
|
block do
|
||||||
node.rm(:openstack, :baremetal, :conf_secrets)
|
node.rm(:openstack, :bare_metal, :conf_secrets)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if node['openstack']['baremetal']['use_rootwrap']
|
if node['openstack']['bare_metal']['use_rootwrap']
|
||||||
template '/etc/ironic/rootwrap.conf' do
|
template '/etc/ironic/rootwrap.conf' do
|
||||||
source 'openstack-service.conf.erb'
|
source 'openstack-service.conf.erb'
|
||||||
cookbook 'openstack-common'
|
cookbook 'openstack-common'
|
||||||
@@ -93,7 +93,7 @@ if node['openstack']['baremetal']['use_rootwrap']
|
|||||||
group 'root'
|
group 'root'
|
||||||
mode 0o0644
|
mode 0o0644
|
||||||
variables(
|
variables(
|
||||||
service_config: node['openstack']['baremetal']['rootwrap']['conf']
|
service_config: node['openstack']['bare_metal']['rootwrap']['conf']
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ describe 'openstack-bare-metal::identity_registration' do
|
|||||||
openstack_project_name: 'admin',
|
openstack_project_name: 'admin',
|
||||||
openstack_domain_name: 'default',
|
openstack_domain_name: 'default',
|
||||||
}
|
}
|
||||||
service_name = 'baremetal'
|
service_name = 'bare_metal'
|
||||||
service_project = 'ironic'
|
service_project = 'ironic'
|
||||||
service_user = 'ironic'
|
service_user = 'ironic'
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ describe 'openstack-bare-metal::ironic-common' do
|
|||||||
context 'template contents' do
|
context 'template contents' do
|
||||||
context 'syslog use' do
|
context 'syslog use' do
|
||||||
it 'sets the log_config value when syslog is in use' do
|
it 'sets the log_config value when syslog is in use' do
|
||||||
node.override['openstack']['baremetal']['syslog']['use'] = true
|
node.override['openstack']['bare_metal']['syslog']['use'] = true
|
||||||
|
|
||||||
expect(chef_run).to render_file(file.name)
|
expect(chef_run).to render_file(file.name)
|
||||||
.with_content(%r{^log_config = /etc/openstack/logging.conf$})
|
.with_content(%r{^log_config = /etc/openstack/logging.conf$})
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ shared_context 'bare-metal-stubs' do
|
|||||||
.with('service', 'openstack-bare-metal')
|
.with('service', 'openstack-bare-metal')
|
||||||
.and_return('ironic_pass')
|
.and_return('ironic_pass')
|
||||||
allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url)
|
allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url)
|
||||||
.with('baremetal')
|
.with('bare_metal')
|
||||||
.and_return('rabbit://guest:mypass@127.0.0.1:5672')
|
.and_return('rabbit://guest:mypass@127.0.0.1:5672')
|
||||||
stub_command('/usr/sbin/httpd -t').and_return(true)
|
stub_command('/usr/sbin/httpd -t').and_return(true)
|
||||||
stub_command('/usr/sbin/apache2 -t').and_return(true)
|
stub_command('/usr/sbin/apache2 -t').and_return(true)
|
||||||
@@ -149,7 +149,7 @@ end
|
|||||||
shared_examples 'logging' do
|
shared_examples 'logging' do
|
||||||
context 'with logging enabled' do
|
context 'with logging enabled' do
|
||||||
before do
|
before do
|
||||||
node.override['openstack']['baremetal']['syslog']['use'] = true
|
node.override['openstack']['bare_metal']['syslog']['use'] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'runs logging recipe if node attributes say to' do
|
it 'runs logging recipe if node attributes say to' do
|
||||||
@@ -159,7 +159,7 @@ shared_examples 'logging' do
|
|||||||
|
|
||||||
context 'with logging disabled' do
|
context 'with logging disabled' do
|
||||||
before do
|
before do
|
||||||
node.override['openstack']['baremetal']['syslog']['use'] = false
|
node.override['openstack']['bare_metal']['syslog']['use'] = false
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not run logging recipe' do
|
it 'does not run logging recipe' do
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<%= node['openstack']['baremetal']['custom_template_banner'] %>
|
<%= node['openstack']['bare_metal']['custom_template_banner'] %>
|
||||||
<% @service_config.each do |section, values| -%>
|
<% @service_config.each do |section, values| -%>
|
||||||
[<%= section %>]
|
[<%= section %>]
|
||||||
<% values.each do |key, value| -%>
|
<% values.each do |key, value| -%>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<%= node['openstack']['baremetal']['custom_template_banner'] %>
|
<%= node['openstack']['bare_metal']['custom_template_banner'] %>
|
||||||
|
|
||||||
# Configuration for ironic-rootwrap
|
# Configuration for ironic-rootwrap
|
||||||
# This file should be owned by (and only-writeable by) the root user
|
# This file should be owned by (and only-writeable by) the root user
|
||||||
@@ -6,24 +6,24 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
# List of directories to load filter definitions from (separated by ',').
|
# List of directories to load filter definitions from (separated by ',').
|
||||||
# These directories MUST all be only writeable by root !
|
# These directories MUST all be only writeable by root !
|
||||||
filters_path=<%= node['openstack']['baremetal']['rootwrap']['filters_path'] %>
|
filters_path=<%= node['openstack']['bare_metal']['rootwrap']['filters_path'] %>
|
||||||
|
|
||||||
# List of directories to search executables in, in case filters do not
|
# List of directories to search executables in, in case filters do not
|
||||||
# explicitely specify a full path (separated by ',')
|
# explicitely specify a full path (separated by ',')
|
||||||
# If not specified, defaults to system PATH environment variable.
|
# If not specified, defaults to system PATH environment variable.
|
||||||
# These directories MUST all be only writeable by root !
|
# These directories MUST all be only writeable by root !
|
||||||
exec_dirs=<%= node['openstack']['baremetal']['rootwrap']['exec_dirs'] %>
|
exec_dirs=<%= node['openstack']['bare_metal']['rootwrap']['exec_dirs'] %>
|
||||||
|
|
||||||
# Enable logging to syslog
|
# Enable logging to syslog
|
||||||
# Default value is False
|
# Default value is False
|
||||||
use_syslog=<%= node['openstack']['baremetal']['rootwrap']['use_syslog'] %>
|
use_syslog=<%= node['openstack']['bare_metal']['rootwrap']['use_syslog'] %>
|
||||||
|
|
||||||
# Which syslog facility to use.
|
# Which syslog facility to use.
|
||||||
# Valid values include auth, authpriv, syslog, local0, local1...
|
# Valid values include auth, authpriv, syslog, local0, local1...
|
||||||
# Default value is 'syslog'
|
# Default value is 'syslog'
|
||||||
syslog_log_facility=<%= node['openstack']['baremetal']['rootwrap']['syslog_log_facility'] %>
|
syslog_log_facility=<%= node['openstack']['bare_metal']['rootwrap']['syslog_log_facility'] %>
|
||||||
|
|
||||||
# Which messages to log.
|
# Which messages to log.
|
||||||
# INFO means log all usage
|
# INFO means log all usage
|
||||||
# ERROR means only log unsuccessful attempts
|
# ERROR means only log unsuccessful attempts
|
||||||
syslog_log_level=<%= node['openstack']['baremetal']['rootwrap']['syslog_log_level'] %>
|
syslog_log_level=<%= node['openstack']['bare_metal']['rootwrap']['syslog_log_level'] %>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<%= node['openstack']['baremetal']['custom_template_banner'] %>
|
<%= node['openstack']['bare_metal']['custom_template_banner'] %>
|
||||||
|
|
||||||
Listen <%= @params[:server_host] %>:<%= @params[:server_port] %>
|
Listen <%= @params[:server_host] %>:<%= @params[:server_port] %>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user