Adds the config_template to cinder

The change modifies the cinder template tasks such that it's now
using the config_template action plugin. This change will make so that
config files can be dynamically updated, by a deployer, at run time,
without requiring the need to modify the in tree templates or defaults.

Partially implements: blueprint tunable-openstack-configuration

Change-Id: I463bbd3e10895dc2e7788346493f78bc46e5f26e
This commit is contained in:
Kevin Carter 2015-09-14 11:17:13 -05:00 committed by Jesse Pretorius
parent ee6a360904
commit 2de509d108
3 changed files with 27 additions and 19 deletions

View File

@ -222,3 +222,9 @@ cinder_service_names:
- cinder-scheduler
- cinder-volume
- cinder-backup
## Tunable overrides
cinder_policy_overrides: {}
cinder_rootwrap_conf_overrides: {}
cinder_api_paste_ini_overrides: {}
cinder_cinder_conf_overrides: {}

View File

@ -13,15 +13,32 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Generate cinder configs
template:
- name: Copy cinder configs
config_template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ cinder_system_user_name }}"
group: "{{ cinder_system_group_name }}"
mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items:
- { src: "cinder.conf.j2", dest: "/etc/cinder/cinder.conf" }
- { src: "api-paste.ini.j2", dest: "/etc/cinder/api-paste.ini" }
- src: "cinder.conf.j2"
dest: "/etc/cinder/cinder.conf"
config_overrides: "{{ cinder_cinder_conf_overrides }}"
config_type: "ini"
- src: "api-paste.ini.j2"
dest: "/etc/cinder/api-paste.ini"
config_overrides: "{{ cinder_api_paste_ini_overrides }}"
config_type: "ini"
- src: "rootwrap.conf.j2"
dest: "/etc/cinder/rootwrap.conf"
config_overrides: "{{ cinder_rootwrap_conf_overrides }}"
config_type: "ini"
- src: "policy.json"
dest: "/etc/cinder/policy.json"
config_overrides: "{{ cinder_policy_overrides }}"
config_type: "json"
notify:
- Restart cinder services
tags:
@ -35,21 +52,6 @@
group: "{{ cinder_system_group_name }}"
with_items:
- { src: "volume.filters", dest: "/etc/cinder/rootwrap.d/volume.filters" }
- { src: "rootwrap.conf", dest: "/etc/cinder/rootwrap.conf" }
notify:
- Restart cinder services
tags:
- cinder-config
- name: Apply updates to Policy file
config_template:
src: "policy.json"
dest: "/etc/cinder/policy.json"
owner: "{{ cinder_system_user_name }}"
group: "{{ cinder_system_group_name }}"
mode: "0644"
config_overrides: "{{ cinder_policy_overrides|default({}) }}"
config_type: "json"
notify:
- Restart cinder services
tags: