Merge "Update plugin for and document per host overrides"

This commit is contained in:
Jenkins 2016-01-22 16:03:35 +00:00 committed by Gerrit Code Review
commit 6b02df6ced
2 changed files with 22 additions and 3 deletions

View File

@ -57,6 +57,25 @@ entry in ``/etc/openstack_deploy/user_variables.yml``:
idle_timeout: 300
max_pool_size: 10
Overrides may also be applied on a per host basis with the following
configuration in ``/etc/openstack_deploy/openstack_user_config.yml``:
.. code-block:: yaml
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
This method may be used for any INI file format for all OpenStack projects
deployed in OpenStack-Ansible.

View File

@ -67,17 +67,17 @@ class ActionModule(object):
# If the items value is not a dictionary it is assumed that the
# value is a default item for this config type.
if not isinstance(items, dict):
config.set('DEFAULT', section, str(items))
config.set('DEFAULT', str(section), str(items))
else:
# Attempt to add a section to the config file passing if
# an error is raised that is related to the section
# already existing.
try:
config.add_section(section)
config.add_section(str(section))
except (ConfigParser.DuplicateSectionError, ValueError):
pass
for key, value in items.items():
config.set(section, key, str(value))
config.set(str(section), str(key), str(value))
else:
config_object.close()