openstack-ansible/playbooks/roles/os_cinder/tasks/cinder_pre_install.yml
git-harry f9d2d574b5 Update cinder services to kilo
The project is moving to support kilo in master. This requires that the
cinder galaxy role be updated to support installing the kilo release of
cinder.

This commit makes changes not added by the minimum viable kilo install
patch - https://review.openstack.org/#/c/166986/

Changes:

cinder.conf
- [DEFAULT] backup_metadata_version is now configurable because the
version has changed. The default is 2, in juno it was 1.
- [DEFAULT] client_socket_timeout is now configurable because the value
has changed. The default is 900, in juno it was 0.
- [profiler] profiler_enabled is now configurable but disabled by
default. Although this feature is part of juno the api-paste.ini file
was not updated in os-a-d juno to make use of it.
- [profiler] trace_sqlalchemy is now configurable but disabled by
default.
- [DEFAULT] rabbit_port -> [oslo_messaging_rabbit] rabbit_port
- [DEFAULT] rabbit_userid -> [oslo_messaging_rabbit] rabbit_userid
- [DEFAULT] rabbit_password -> [oslo_messaging_rabbit] rabbit_password
- [DEFAULT] rabbit_hosts -> [oslo_messaging_rabbit] rabbit_hosts
- [DEFAULT] lock_path -> [oslo_concurrency] lock_path
- [DEFAULT] enable_v1_api is now configurable. The default is true.
This has been added because the v1 API is deprecated and will be
removed in liberty.
- [DEFAULT] enable_v2_api is now configurable. The default is true.

policy.json
- Update policy.json from icehouse default to kilo default version. This
adds/modifies a number of rules and also updates the format of the file
to the current version.

api-paste.ini
- Add the osprofiler filter. This file is now deployed using a template
so that the hmac_keys configuration option can be set using the var
cinder_profiler_hmac_key.
- replace deprecated middleware with oslo_middleware versions.

rootwrap.conf
Updates the file to match kilo default.

volume.filters
Updates the file to match the kilo default.

The volume_driver var has been updated to use the new LVM driver class.

The signing_dir, /var/cache/cinder, permissions changed from 0755 to
0700 for fix warning by keystonemiddleware.

Implements: blueprint master-kilofication
Change-Id: I91f2385969568b18635bc534a98138d3dd5c5af2
2015-04-03 18:03:17 +00:00

90 lines
2.5 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 the system group
group:
name: "{{ cinder_system_group_name }}"
state: "present"
system: "yes"
tags:
- cinder-group
- name: Create the cinder system user
user:
name: "{{ cinder_system_user_name }}"
group: "{{ cinder_system_group_name }}"
comment: "{{ cinder_system_comment }}"
shell: "{{ cinder_system_shell }}"
system: "yes"
createhome: "yes"
home: "{{ cinder_system_home_folder }}"
tags:
- cinder-user
- name: Create cinder dir
file:
path: "{{ item.path }}"
state: directory
owner: "{{ item.owner|default(cinder_system_user_name) }}"
group: "{{ item.group|default(cinder_system_group_name) }}"
with_items:
- { path: "/var/cache/cinder", mode: "0700" }
- { path: "/etc/cinder" }
- { path: "/etc/cinder/rootwrap.d" }
- { path: "/etc/sudoers.d", mode: "0750", owner: "root", group: "root" }
- { path: "{{ cinder_system_home_folder }}" }
tags:
- cinder-dirs
- name: Test for log directory or link
shell: |
if [ -h "/var/log/cinder" ]; then
chown -h {{ cinder_system_user_name }}:{{ cinder_system_group_name }} "/var/log/cinder"
chown -R {{ cinder_system_user_name }}:{{ cinder_system_group_name }} "$(readlink /var/log/cinder)"
else
exit 1
fi
register: log_dir
failed_when: false
changed_when: log_dir.rc != 0
tags:
- cinder-dirs
- cinder-logs
- name: Create cinder log dir
file:
path: "{{ item.path }}"
state: directory
owner: "{{ item.owner|default(cinder_system_user_name) }}"
group: "{{ item.group|default(cinder_system_group_name) }}"
mode: "{{ item.mode|default('0755') }}"
with_items:
- { path: "/var/log/cinder" }
when: log_dir.rc != 0
tags:
- cinder-dirs
- cinder-logs
- name: Drop sudoers file
template:
src: "sudoers.j2"
dest: "/etc/sudoers.d/{{ cinder_system_user_name }}_sudoers"
mode: "0440"
owner: "root"
group: "root"
tags:
- sudoers
- cinder-sudoers