OpenStack has many configuration options available in .conf
files
(in a standard INI
file format),
policy files (in a standard JSON
format) and YAML
files.
Note
YAML
files are only in the ceilometer project at this time.
OpenStack-Ansible enables you to reference any options in the
OpenStack Configuration Reference through the use of a simple set of
configuration entries in the /etc/openstack_deploy/user_variables.yml
.
This section describes how to use the configuration entries in the
/etc/openstack_deploy/user_variables.yml
file to override default
configuration settings. For more information, see the
Setting overrides in configuration files section in the developer
documentation.
Most often, overrides are implemented for the <service>.conf
files
(for example, nova.conf
). These files use a standard INI file format.
For example, you might want to add the following parameters to the
nova.conf
file:
[DEFAULT]
remove_unused_original_minimum_age_seconds = 43200
[libvirt]
cpu_mode = host-model
disk_cachemodes = file=directsync,block=none
[database]
idle_timeout = 300
max_pool_size = 10
To do this, you use the following configuration entry in the
/etc/openstack_deploy/user_variables.yml
file:
nova_nova_conf_overrides:
DEFAULT:
remove_unused_original_minimum_age_seconds: 43200
libvirt:
cpu_mode: host-model
disk_cachemodes: file=directsync,block=none
database:
idle_timeout: 300
max_pool_size: 10
Note
The general format for the variable names used for overrides is
<service>_<filename>_<file extension>_overrides
. For example, the variable
name used in these examples to add parameters to the nova.conf
file is
nova_nova_conf_overrides
.
You can also apply overrides on a per-host basis with the following
configuration in the /etc/openstack_deploy/openstack_user_config.yml
file:
compute_hosts:
900089-compute001:
ip: 192.0.2.10
host_vars:
nova_nova_conf_overrides:
DEFAULT:
remove_unused_original_minimum_age_seconds: 43200
libvirt:
cpu_mode: host-model
disk_cachemodes: file=directsync,block=none
database:
idle_timeout: 300
max_pool_size: 10
Use this method for any files with the INI
format for in OpenStack projects
deployed in OpenStack-Ansible.
To implement access controls that are different from the ones in a standard
OpenStack environment, you can adjust the default policies applied by services.
Policy files are in a JSON
format.
For example, you might want to add the following policy in the policy.json
file for the Identity service (keystone):
{
"identity:foo": "rule:admin_required",
"identity:bar": "rule:admin_required"
}
To do this, you use the following configuration entry in the
/etc/openstack_deploy/user_variables.yml
file:
keystone_policy_overrides:
identity:foo: "rule:admin_required"
identity:bar: "rule:admin_required"
Note
The general format for the variable names used for overrides is
<service>_policy_overrides
. For example, the variable name used in this
example to add a policy to the Identity service (keystone) policy.json
file
is keystone_policy_overrides
.
Use this method for any files with the JSON
format in OpenStack projects
deployed in OpenStack-Ansible.
To assist you in finding the appropriate variable name to use for
overrides, the general format for the variable name is
<service>_policy_overrides
.
You can override .yml
file values by supplying replacement YAML content.
Note
All default YAML file content is completely overwritten by the overrides, so the entire YAML source (both the existing content and your changes) must be provided.
For example, you might want to define a meter exclusion for all hardware
items in the default content of the pipeline.yml
file for the
Telemetry service (ceilometer):
sources:
- name: meter_source
interval: 600
meters:
- "!hardware.*"
sinks:
- meter_sink
- name: foo_source
value: foo
To do this, you use the following configuration entry in the
/etc/openstack_deploy/user_variables.yml
file:
ceilometer_pipeline_yaml_overrides:
sources:
- name: meter_source
interval: 600
meters:
- "!hardware.*"
sinks:
- meter_sink
- name: source_foo
value: foo
Note
The general format for the variable names used for overrides is
<service>_<filename>_<file extension>_overrides
. For example, the variable
name used in this example to define a meter exclusion in the pipeline.yml
file
for the Telemetry service (ceilometer) is ceilometer_pipeline_yaml_overrides
.
The following override variables are available.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.