openstack-ansible/playbooks/roles/os_glance/tasks/glance_post_install.yml
Kevin Carter 1e46243fea Adds the config_template to glance
The change modifies the glance 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: I13fc6f38679267a84104cae948517d185e9f4ece
2015-09-21 11:15:02 +00:00

115 lines
3.6 KiB
YAML

---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create glance cache management cron jobs
cron:
name: "{{ item.name }}"
minute: "{{ 59 |random(start=1) }}"
day: "*"
hour: "{{ item.hour }}"
month: "*"
state: present
job: "{{ item.name }}"
user: glance
with_items:
- name: /usr/local/bin/glance-cache-pruner
hour: "*"
- name: /usr/local/bin/glance-cache-cleaner
hour: "*/5"
when: glance_flavor | search("cache")
tags:
- glance-cron
- name: Drop Glance Config(s)
config_template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ glance_system_user_name }}"
group: "{{ glance_system_group_name }}"
mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items:
- src: "glance-api-paste.ini.j2"
dest: "/etc/glance/glance-api-paste.ini"
config_overrides: "{{ glance_glance_api_paste_ini_overrides }}"
config_type: "ini"
- src: "glance-api.conf.j2"
dest: "/etc/glance/glance-api.conf"
config_overrides: "{{ glance_glance_api_conf_overrides }}"
config_type: "ini"
- src: "glance-cache.conf.j2"
dest: "/etc/glance/glance-cache.conf"
config_overrides: "{{ glance_glance_cache_conf_overrides }}"
config_type: "ini"
- src: "glance-manage.conf.j2"
dest: "/etc/glance/glance-manage.conf"
config_overrides: "{{ glance_glance_manage_conf_overrides }}"
config_type: "ini"
- src: "glance-registry-paste.ini.j2"
dest: "/etc/glance/glance-registry-paste.ini"
config_overrides: "{{ glance_glance_registry_paste_ini_overrides }}"
config_type: "ini"
- src: "glance-registry.conf.j2"
dest: "/etc/glance/glance-registry.conf"
config_overrides: "{{ glance_glance_registry_conf_overrides }}"
config_type: "ini"
- src: "glance-scrubber.conf.j2"
dest: "/etc/glance/glance-scrubber.conf"
config_overrides: "{{ glance_glance_scrubber_conf_overrides }}"
config_type: "ini"
- src: "policy.json.j2"
dest: "/etc/glance/policy.json"
config_overrides: "{{ glance_policy_overrides }}"
config_type: "json"
- src: "schema.json.j2"
dest: "/etc/glance/schema.json"
config_overrides: "{{ glance_glance_scheme_json_overrides }}"
config_type: "json"
- src: "schema.json.j2"
dest: "/etc/glance/schema-image.json"
config_overrides: "{{ glance_glance_scheme_json_overrides }}"
config_type: "json"
notify:
- Restart glance api
- Restart glance registry
tags:
- glance-config
- name: Create nfs shares local path
file:
path: "{{ item.local_path }}"
state: directory
with_items: glance_nfs_client
when: >
glance_nfs_client is defined
tags:
- glance-nfs
- glance-nfs-local-path
- name: Glance mount nfs
mount:
name: "{{ item.local_path }}"
src: "{{ item.server }}:{{ item.remote_path }}"
fstype: "{{ item.type }}"
opts: "{{ item.options }}"
state: "mounted"
with_items: glance_nfs_client
when: >
glance_nfs_client is defined
tags:
- glance-nfs
- glance-nfs-local-path