Update the cinder role to support Ubuntu 16.04 and Systemd

-Created a  ubuntu-16.04 file in vars
-Updated meta/main.yml dependencies to include xenial
 as a verison of Ubuntu.
-Added cinder-16.04-support.yaml in realesenotes
-Added template files for systemd support

Implements: blueprint support-ubuntu-1604

Change-Id: Idb2f6b84fc558b21ca2dfce6121dc22ff31a659a
This commit is contained in:
Ashana Evans 2016-06-21 11:00:33 -04:00
parent c72d133d19
commit ab33572534
10 changed files with 193 additions and 6 deletions

View File

@ -23,6 +23,7 @@ galaxy_info:
- name: Ubuntu
versions:
- trusty
- xenial
categories:
- cloud
- python

View File

@ -0,0 +1,3 @@
---
features:
- The ''os_cinder'' role now supports Ubuntu 16.04

View File

@ -1,5 +1,5 @@
---
# Copyright 2014, Rackspace US, Inc.
# Copyright 2014-2016, 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.
@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: cinder_upstart_common_init.yml
- include: cinder_init_common.yml
vars:
program_name: "{{ cinder_service_program_name }}"
service_name: "{{ cinder_service_name }}"
@ -25,7 +25,7 @@
tags:
- upstart-init
- include: cinder_upstart_common_init.yml
- include: cinder_init_common.yml
vars:
program_name: "{{ cinder_service_scheduler_program_name }}"
service_name: "{{ cinder_service_name }}"
@ -37,7 +37,7 @@
tags:
- upstart-init
- include: cinder_upstart_common_init.yml
- include: cinder_init_common.yml
vars:
program_name: "{{ cinder_service_volume_program_name }}"
service_name: "{{ cinder_service_name }}"
@ -49,7 +49,7 @@
tags:
- upstart-init
- include: cinder_upstart_common_init.yml
- include: cinder_init_common.yml
vars:
program_name: "{{ cinder_service_backup_program_name }}"
service_name: "{{ cinder_service_name }}"

View File

@ -0,0 +1,32 @@
---
# Copyright 2016, Rackspace US, Inc.
# Copyright 2016, IBM Corporation.
#
# 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.
- include: cinder_init_upstart.yml
when: pid1_name == "init"
tags:
- cinder-init
- include: cinder_init_systemd.yml
when: pid1_name == "systemd"
tags:
- cinder-init
- name: Load service
service:
name: "{{ program_name }}"
enabled: "yes"
notify:
- Restart cinder services

View File

@ -0,0 +1,49 @@
---
# Copyright 2016, Rackspace US, Inc.
# Copyright 2016, IBM Corporation.
#
# 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 cinder TEMP dirs
file:
path: "{{ item.path }}/{{ program_name }}"
state: directory
owner: "{{ system_user }}"
group: "{{ system_group }}"
mode: "2755"
with_items:
- { path: "/var/run" }
- { path: "/var/lock" }
- name: Create tempfile.d entry
template:
src: "cinder-systemd-tempfiles.j2"
dest: "/etc/tmpfiles.d/cinder.conf"
mode: "0644"
owner: "root"
group: "root"
- name: Place the systemd init script
template:
src: "cinder-systemd-init.j2"
dest: "/etc/systemd/system/{{ program_name }}.service"
mode: "0644"
owner: "root"
group: "root"
register: systemd_init
- name: Reload the systemd daemon
command: "systemctl daemon-reload"
when: systemd_init | changed
notify:
- Restart cinder services

View File

@ -20,6 +20,8 @@
mode: "0644"
owner: "root"
group: "root"
register: upstart_init
notify:
- Restart cinder services
tags:
@ -29,6 +31,9 @@
- name: Reload init scripts
shell: |
initctl reload-configuration
when: upstart_init | changed
register: upstart_init
notify:
- Restart cinder services
tags:

View File

@ -24,9 +24,30 @@
tags:
- always
- name: Check init system
command: cat /proc/1/comm
register: _pid1_name
tags:
- always
- name: Set the name of pid1
set_fact:
pid1_name: "{{ _pid1_name.stdout }}"
tags:
- always
- include: cinder_pre_install.yml
tags:
- cinder-install
- include: cinder_install.yml
tags:
- cinder-install
- cinder-config
- include: cinder_post_install.yml
tags:
- cinder-install
- include: cinder_db_setup.yml
when: >
@ -36,7 +57,9 @@
when: >
inventory_hostname == groups['cinder_all'][0]
- include: cinder_upstart_init.yml
- include: cinder_init.yml
tags:
- cinder-install
- name: Flush handlers
meta: flush_handlers
@ -49,3 +72,5 @@
when: >
inventory_hostname in groups['cinder_volume']
and cinder_backend_lvm_inuse
tags:
- cinder-install

View File

@ -0,0 +1,25 @@
# {{ ansible_managed }}
[Unit]
Description=cinder openstack service
After=syslog.target
After=network.target
[Service]
Type=simple
User={{ system_user }}
Group={{ system_group }}
{% if program_override is defined %}
ExecStart={{ program_override }} {{ program_config_options|default('') }} --log-file=/var/log/cinder/{{ program_name }}.log
{% else %}
ExecStart={{ cinder_bin }}/{{ program_name }} {{ program_config_options|default('') }} --log-file=/var/log/cinder/{{ program_name }}.log
{% endif %}
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
Restart=on-failure
RestartSec=150
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,4 @@
# {{ ansible_managed }}
D /var/lock/{{ program_name }} 2755 {{ system_user }} {{ system_group }}
D /var/run/{{ program_name }} 2755 {{ system_user }} {{ system_group }}

43
vars/ubuntu-16.04.yml Normal file
View File

@ -0,0 +1,43 @@
---
# Copyright 2016, Intel Corporation.
# Copyright 2016, IBM Corporation.
#
# 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.
## APT Cache options
cache_timeout: 600
# Common apt packages
cinder_apt_packages:
- rpcbind
- rsync
- git
- nfs-common
- libpq-dev
- libkmod-dev
- libkmod2
- libxslt1-dev
- zlib1g
- zlibc
- libffi-dev
- libssl-dev
cinder_volume_apt_packages:
- qemu-utils
cinder_lvm_volume_apt_packages:
- dmeventd
- parted
- tgt