No longer creating variables per attribute
Just use node in the templates... no need to map to a variables... :/
This commit is contained in:
@@ -128,7 +128,6 @@ template "/etc/nova/api-paste.ini" do
|
||||
group "root"
|
||||
mode 00644
|
||||
variables(
|
||||
:custom_template_banner => node["nova"]["custom_template_banner"],
|
||||
:identity_admin_endpoint => identity_admin_endpoint,
|
||||
:identity_endpoint => identity_endpoint,
|
||||
:admin_token => keystone["admin_token"]
|
||||
|
||||
@@ -64,7 +64,6 @@ template "/etc/nova/api-paste.ini" do
|
||||
group "root"
|
||||
mode 00644
|
||||
variables(
|
||||
:custom_template_banner => node["nova"]["custom_template_banner"],
|
||||
:identity_admin_endpoint => identity_admin_endpoint,
|
||||
:identity_endpoint => identity_endpoint,
|
||||
:admin_token => keystone["admin_token"]
|
||||
|
||||
@@ -127,7 +127,6 @@ template "/etc/nova/api-paste.ini" do
|
||||
group "root"
|
||||
mode 00644
|
||||
variables(
|
||||
:custom_template_banner => node["nova"]["custom_template_banner"],
|
||||
:identity_admin_endpoint => identity_admin_endpoint,
|
||||
:identity_endpoint => identity_endpoint,
|
||||
:admin_token => keystone["admin_token"]
|
||||
|
||||
@@ -64,7 +64,6 @@ template "/etc/nova/api-paste.ini" do
|
||||
group "root"
|
||||
mode 00644
|
||||
variables(
|
||||
:custom_template_banner => node["nova"]["custom_template_banner"],
|
||||
:identity_admin_endpoint => identity_admin_endpoint,
|
||||
:identity_endpoint => identity_endpoint,
|
||||
:admin_token => keystone["admin_token"]
|
||||
|
||||
@@ -75,7 +75,6 @@ template "/etc/libvirt/libvirtd.conf" do
|
||||
group "root"
|
||||
mode 00644
|
||||
variables(
|
||||
:custom_template_banner => node["nova"]["custom_template_banner"],
|
||||
:auth_tcp => node["nova"]["libvirt"]["auth_tcp"]
|
||||
)
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ keystone_service_role = node["nova"]["keystone_service_chef_role"]
|
||||
keystone = get_settings_by_role keystone_service_role, "keystone"
|
||||
|
||||
# find the node attribute endpoint settings for the server holding a given role
|
||||
identity_admin_endpoint = endpoint_uri "identity-admin"
|
||||
identity_endpoint = endpoint_uri "identity-api"
|
||||
xvpvnc_endpoint = endpoint "compute-xvpvnc" || {}
|
||||
novnc_endpoint = endpoint "compute-novnc-server" || {}
|
||||
@@ -84,9 +85,6 @@ template "/etc/nova/nova.conf" do
|
||||
group "root"
|
||||
mode 00644
|
||||
variables(
|
||||
:custom_template_banner => node["nova"]["custom_template_banner"],
|
||||
:use_syslog => node["nova"]["syslog"]["use"],
|
||||
:log_facility => node["nova"]["syslog"]["facility"],
|
||||
:sql_connection => db_uri("compute", db_user, db_pass),
|
||||
:vncserver_listen => "0.0.0.0",
|
||||
:vncserver_proxyclient_address => novnc_proxy_endpoint["host"],
|
||||
@@ -103,30 +101,7 @@ template "/etc/nova/nova.conf" do
|
||||
:glance_api_ipaddress => image_endpoint["host"],
|
||||
:glance_api_port => image_endpoint["port"],
|
||||
:iscsi_helper => platform_options["iscsi_helper"],
|
||||
:public_interface => node["nova"]["network"]["public_interface"],
|
||||
:vlan_interface => node["nova"]["network"]["vlan_interface"],
|
||||
:network_manager => node["nova"]["network"]["network_manager"],
|
||||
:scheduler_driver => node["nova"]["scheduler"]["scheduler_driver"],
|
||||
:scheduler_default_filters => node["nova"]["scheduler"]["default_filters"].join(","),
|
||||
:availability_zone => node["nova"]["config"]["availability_zone"],
|
||||
:default_schedule_zone => node["nova"]["config"]["default_schedule_zone"],
|
||||
:virt_type => node["nova"]["libvirt"]["virt_type"],
|
||||
:remove_unused_base_images => node["nova"]["libvirt"]["remove_unused_base_images"],
|
||||
:remove_unused_resized_minimum_age_seconds => node["nova"]["libvirt"]["remove_unused_resized_minimum_age_seconds"],
|
||||
:remove_unused_original_minimum_age_seconds => node["nova"]["libvirt"]["remove_unused_original_minimum_age_seconds"],
|
||||
:checksum_base_images => node["nova"]["libvirt"]["checksum_base_images"],
|
||||
:fixed_range => node["nova"]["network"]["fixed_range"],
|
||||
:force_raw_images => node["nova"]["config"]["force_raw_images"],
|
||||
:dmz_cidr => node["nova"]["network"]["dmz_cidr"],
|
||||
:allow_same_net_traffic => node["nova"]["config"]["allow_same_net_traffic"],
|
||||
:osapi_max_limit => node["nova"]["config"]["osapi_max_limit"],
|
||||
:cpu_allocation_ratio => node["nova"]["config"]["cpu_allocation_ratio"],
|
||||
:ram_allocation_ratio => node["nova"]["config"]["ram_allocation_ratio"],
|
||||
:snapshot_image_format => node["nova"]["config"]["snapshot_image_format"],
|
||||
:start_guests_on_host_boot => node["nova"]["config"]["start_guests_on_host_boot"],
|
||||
:resume_guests_state_on_host_boot => node["nova"]["config"]["resume_guests_state_on_host_boot"],
|
||||
:quota_security_groups => node["nova"]["config"]["quota_security_groups"],
|
||||
:quota_security_group_rules => node["nova"]["config"]["quota_security_group_rules"]
|
||||
:scheduler_default_filters => node["nova"]["scheduler"]["default_filters"].join(",")
|
||||
)
|
||||
end
|
||||
|
||||
@@ -137,19 +112,14 @@ template "/root/openrc" do
|
||||
group "root"
|
||||
mode 00600
|
||||
variables(
|
||||
:custom_template_banner => node["nova"]["custom_template_banner"],
|
||||
:user => keystone["admin_user"],
|
||||
:tenant => keystone["users"][keystone["admin_user"]]["default_tenant"],
|
||||
:password => keystone["users"][keystone["admin_user"]]["password"],
|
||||
:keystone_api_ipaddress => identity_endpoint["host"],
|
||||
:keystone_service_port => identity_endpoint["port"],
|
||||
:identity_admin_endpoint => identity_admin_endpoint,
|
||||
:nova_api_ipaddress => nova_api_endpoint["host"],
|
||||
:nova_api_version => "1.1",
|
||||
:keystone_region => node["nova"]["compute"]["region"],
|
||||
:auth_strategy => "keystone",
|
||||
:ec2_url => ec2_public_endpoint["uri"],
|
||||
:ec2_access_key => node["credentials"]["EC2"]["admin"]["access"],
|
||||
:ec2_secret_key => node["credentials"]["EC2"]["admin"]["secret"]
|
||||
:ec2_url => ec2_public_endpoint["uri"]
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
$DirGroup adm
|
||||
$DirCreateMode 0755
|
||||
$FileGroup adm
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
############
|
||||
# Metadata #
|
||||
############
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
LoadPlugin "<%= @name %>"
|
||||
|
||||
<Plugin "<%= @name %>">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
LoadPlugin "<%= @name %>"
|
||||
|
||||
<% if not @options.empty? %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
|
||||
# Defaults for libvirt-bin initscript (/etc/init.d/libvirt-bin)
|
||||
# This is a POSIX shell fragment
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
Host *
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile=/dev/null
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
<%= @private_key %>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
<%= @public_key %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
|
||||
# Master libvirt daemon configuration file
|
||||
#
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
# Override the default config file
|
||||
# NOTE: This setting is no longer honoured if using
|
||||
# systemd. Set '--config /etc/libvirt/libvirtd.conf'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
[DEFAULT]
|
||||
|
||||
# LOGS/STATE
|
||||
@@ -7,9 +7,9 @@ auth_strategy=keystone
|
||||
dhcpbridge_flagfile=/etc/nova/nova.conf
|
||||
dhcpbridge=/usr/bin/nova-dhcpbridge
|
||||
logdir=/var/log/nova
|
||||
<% if @use_syslog == true %>
|
||||
use_syslog=<%= @use_syslog %>
|
||||
syslog_log_facility=<%= @log_facility %>
|
||||
<% if node["nova"]["syslog"]["use"] == true %>
|
||||
use_syslog=<%= node["nova"]["syslog"]["use"] %>
|
||||
syslog_log_facility=<%= node["nova"]["syslog"]["facility"] %>
|
||||
<% end %>
|
||||
state_path=/var/lib/nova
|
||||
lock_path=/var/lock/nova
|
||||
@@ -21,18 +21,18 @@ rabbit_host=<%= @rabbit_ipaddress %>
|
||||
|
||||
##### SCHEDULER #####
|
||||
# scheduler_manager=nova.scheduler.manager.SchedulerManager
|
||||
compute_scheduler_driver=<%= @scheduler_driver %>
|
||||
compute_scheduler_driver=<%= node["nova"]["scheduler"]["scheduler_driver"] %>
|
||||
scheduler_available_filters=nova.scheduler.filters.standard_filters
|
||||
# which filter class names to use for filtering hosts when not specified in the request.
|
||||
scheduler_default_filters=<%= @scheduler_default_filters %>
|
||||
node_availability_zone=<%= @availability_zone %>
|
||||
default_schedule_zone=<%= @default_schedule_zone %>
|
||||
node_availability_zone=<%= node["nova"]["config"]["availability_zone"] %>
|
||||
default_schedule_zone=<%= node["nova"]["config"]["default_schedule_zone"] %>
|
||||
|
||||
##### NETWORK #####
|
||||
network_manager=<%= @network_manager %>
|
||||
public_interface=<%= @public_interface %>
|
||||
fixed_range=<%= @fixed_range %>
|
||||
dmz_cidr=<%= @dmz_cidr %>
|
||||
network_manager=<%= node["nova"]["network"]["network_manager"] %>
|
||||
public_interface=<%= node["nova"]["network"]["public_interface"] %>
|
||||
fixed_range=<%= node["nova"]["network"]["fixed_range"] %>
|
||||
dmz_cidr=<%= node["nova"]["network"]["dmz_cidr"] %>
|
||||
<% if %w(fedora redhat centos).include? node.platform -%>
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=788485 - not released in epel yet
|
||||
force_dhcp_release=false
|
||||
@@ -41,12 +41,12 @@ force_dhcp_release=true
|
||||
<% end -%>
|
||||
send_arp_for_ha=true
|
||||
use_single_default_gateway=true
|
||||
<% if @virt_type == "qemu" -%>
|
||||
<% if node["nova"]["libvirt"]["virt_type"] == "qemu" -%>
|
||||
libvirt_use_virtio_for_bridges=false
|
||||
<% else -%>
|
||||
libvirt_use_virtio_for_bridges=true
|
||||
<% end -%>
|
||||
vlan_interface=<%= @vlan_interface %>
|
||||
vlan_interface=<%= node["nova"]["network"]["vlan_interface"] %>
|
||||
|
||||
##### GLANCE #####
|
||||
image_service=nova.image.glance.GlanceImageService
|
||||
@@ -56,17 +56,17 @@ glance_api_servers=<%= @glance_api_ipaddress %>:<%= @glance_api_port %>
|
||||
compute_manager=nova.compute.manager.ComputeManager
|
||||
sql_connection=<%= @sql_connection %>
|
||||
connection_type=libvirt
|
||||
libvirt_type=<%= @virt_type %>
|
||||
libvirt_type=<%= node["nova"]["libvirt"]["virt_type"] %>
|
||||
# Command prefix to use for running commands as root (default: sudo)
|
||||
root_helper=sudo nova-rootwrap
|
||||
# Should unused base images be removed? (default: false)
|
||||
remove_unused_base_images=<%= @remove_unused_base_images %>
|
||||
remove_unused_base_images=<%= node["nova"]["libvirt"]["remove_unused_base_images"] %>
|
||||
# Unused resized base images younger than this will not be removed (default: 3600)
|
||||
remove_unused_resized_minimum_age_seconds=<%= @remove_unused_resized_minimum_age_seconds %>
|
||||
remove_unused_resized_minimum_age_seconds=<%= node["nova"]["libvirt"]["remove_unused_resized_minimum_age_seconds"] %>
|
||||
# Unused unresized base images younger than this will not be removed (default: 86400)
|
||||
remove_unused_original_minimum_age_seconds=<%= @remove_unused_original_minimum_age_seconds %>
|
||||
remove_unused_original_minimum_age_seconds=<%= node["nova"]["libvirt"]["remove_unused_original_minimum_age_seconds"] %>
|
||||
# Write a checksum for files in _base to disk (default: false)
|
||||
checksum_base_images=<%= @checksum_base_images %>
|
||||
checksum_base_images=<%= node["nova"]["libvirt"]["checksum_base_images"] %>
|
||||
|
||||
##### VNCPROXY #####
|
||||
<% if @novncproxy_base_url -%>
|
||||
@@ -91,32 +91,32 @@ vncserver_proxyclient_address=<%= @vncserver_proxyclient_address %>
|
||||
|
||||
##### MISC #####
|
||||
# force backing images to raw format
|
||||
force_raw_images=<%= @force_raw_images %>
|
||||
allow_same_net_traffic=<%= @allow_same_net_traffic %>
|
||||
osapi_max_limit=<%= @osapi_max_limit %>
|
||||
snapshot_image_format=<%= @snapshot_image_format %>
|
||||
start_guests_on_host_boot=<%= @start_guests_on_host_boot %>
|
||||
resume_guests_state_on_host_boot=<%= @resume_guests_state_on_host_boot %>
|
||||
force_raw_images=<%= node["nova"]["config"]["force_raw_images"] %>
|
||||
allow_same_net_traffic=<%= node["nova"]["config"]["allow_same_net_traffic"] %>
|
||||
osapi_max_limit=<%= node["nova"]["config"]["osapi_max_limit"] %>
|
||||
snapshot_image_format=<%= node["nova"]["config"]["snapshot_image_format"] %>
|
||||
start_guests_on_host_boot=<%= node["nova"]["config"]["start_guests_on_host_boot"] %>
|
||||
resume_guests_state_on_host_boot=<%= node["nova"]["config"]["resume_guests_state_on_host_boot"] %>
|
||||
# number of security groups per project (default: 10)
|
||||
quota_security_groups=<%= @quota_security_groups %>
|
||||
quota_security_groups=<%= node["nova"]["config"]["quota_security_groups"] %>
|
||||
# number of security rules per security group (default: 20)
|
||||
quota_security_group_rules=<%= @quota_security_group_rules %>
|
||||
quota_security_group_rules=<%= node["nova"]["config"]["quota_security_group_rules"] %>
|
||||
|
||||
<%- if /FilterScheduler/.match(@scheduler_driver) or
|
||||
/MultiScheduler/.match(@scheduler_driver) %>
|
||||
<%- if /FilterScheduler/.match(node["nova"]["scheduler"]["scheduler_driver"]) or
|
||||
/MultiScheduler/.match(node["nova"]["scheduler"]["scheduler_driver"]) %>
|
||||
# FilterScheduler Only Options
|
||||
<%- if /ComputeFilter/.match(@scheduler_default_filters) %>
|
||||
# virtual CPU to Physical CPU allocation ratio (default: 16.0)
|
||||
cpu_allocation_ratio=<%= @cpu_allocation_ratio %>
|
||||
cpu_allocation_ratio=<%= node["nova"]["config"]["cpu_allocation_ratio"] %>
|
||||
<%- end %>
|
||||
<%- if /RamFilter/.match(@scheduler_default_filters) %>
|
||||
# virtual ram to physical ram allocation ratio (default: 1.5)
|
||||
ram_allocation_ratio=<%= @ram_allocation_ratio %>
|
||||
ram_allocation_ratio=<%= node["nova"]["config"]["ram_allocation_ratio"] %>
|
||||
<%- end %>
|
||||
<%- elsif /SimpleScheduler/.match(@scheduler_driver) %>
|
||||
<%- elsif /SimpleScheduler/.match(node["nova"]["scheduler"]["scheduler_driver"]) %>
|
||||
# SimpleScheduler Only Options
|
||||
# maximum number of instance cores to allow per host
|
||||
max_cores=<% @cpu_allocation_ratio.to_i * node["cpu"]["total"].to_i %>
|
||||
max_cores=<% node["nova"]["config"]["cpu_allocation_ratio"].to_i * node["cpu"]["total"].to_i %>
|
||||
<%- end %>
|
||||
|
||||
<% if %w(fedora redhat centos).include? node.platform -%>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<%= @custom_template_banner %>
|
||||
<%= node["nova"]["custom_template_banner"] %>
|
||||
|
||||
# COMMON OPENSTACK ENVS
|
||||
export OS_USERNAME=<%= @user %>
|
||||
export OS_PASSWORD=<%= @password %>
|
||||
export OS_TENANT_NAME=<%= @tenant %>
|
||||
export OS_AUTH_URL=http://<%= @keystone_api_ipaddress %>:<%= @keystone_service_port %>/v2.0/
|
||||
export OS_AUTH_URL=<%= @identity_admin_endpoint.to_s %>
|
||||
export OS_AUTH_STRATEGY=<%= @auth_strategy %>
|
||||
|
||||
# LEGACY NOVA ENVS
|
||||
@@ -14,9 +14,9 @@ export NOVA_PASSWORD=${OS_PASSWORD}
|
||||
export NOVA_API_KEY=${OS_PASSWORD}
|
||||
export NOVA_URL=${OS_AUTH_URL}
|
||||
export NOVA_VERSION=<%= @nova_api_version %>
|
||||
export NOVA_REGION_NAME=<%= @keystone_region %>
|
||||
export NOVA_REGION_NAME=<%= node["nova"]["compute"]["region"] %>
|
||||
|
||||
# EUCA2OOLs ENV VARIABLES
|
||||
export EC2_ACCESS_KEY=<%= @ec2_access_key %>
|
||||
export EC2_SECRET_KEY=<%= @ec2_secret_key %>
|
||||
export EC2_ACCESS_KEY=<%= node["credentials"]["EC2"]["admin"]["access"] %>
|
||||
export EC2_SECRET_KEY=<%= node["credentials"]["EC2"]["admin"]["secret"] %>
|
||||
export EC2_URL=<%= @ec2_url %>
|
||||
|
||||
Reference in New Issue
Block a user