Implement Xenial Support
This implements support for Ubuntu 16.04. The changes primarily relate to implementing systemd service files instead of upstart init scripts. Implements: blueprint support-ubuntu-1604 Change-Id: If0d4de3519e04a45795e64fca9c8ca7b56729a88
This commit is contained in:
parent
d460d17335
commit
d69f560f64
@ -352,6 +352,7 @@ nova_apt_packages:
|
||||
- genisoimage
|
||||
- git
|
||||
- libpq-dev
|
||||
- iptables
|
||||
|
||||
# Spice console apt packages
|
||||
nova_spice_apt_packages:
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
feature:
|
||||
- Support has been added to deploy the nova services on Ubuntu 16.04
|
||||
LTS.
|
@ -13,6 +13,28 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Detect whether the init system is upstart of systemd.
|
||||
- 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
|
||||
|
||||
- name: Gather variables for each operating system
|
||||
include_vars: "{{ item }}"
|
||||
with_first_found:
|
||||
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
|
||||
- "{{ ansible_distribution | lower }}.yml"
|
||||
- "{{ ansible_os_family | lower }}.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- include: nova_virt_detect.yml
|
||||
when: nova_virt_type is not defined
|
||||
tags:
|
||||
@ -23,7 +45,7 @@
|
||||
- include: nova_install.yml
|
||||
- include: nova_console_install.yml
|
||||
- include: nova_post_install.yml
|
||||
- include: nova_upstart_init.yml
|
||||
- include: nova_init.yml
|
||||
|
||||
- include: nova_db_setup.yml
|
||||
when: >
|
||||
|
@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- include: nova_upstart_common_init.yml
|
||||
- include: nova_init_common.yml
|
||||
vars:
|
||||
program_name: "{{ nova_metadata_program_name }}"
|
||||
service_name: "{{ nova_service_name }}"
|
||||
@ -22,7 +22,7 @@
|
||||
service_home: "{{ nova_system_home_folder }}"
|
||||
when: inventory_hostname in groups['nova_api_metadata']
|
||||
|
||||
- include: nova_upstart_common_init.yml
|
||||
- include: nova_init_common.yml
|
||||
vars:
|
||||
program_name: "{{ nova_cert_program_name }}"
|
||||
service_name: "{{ nova_service_name }}"
|
||||
@ -31,7 +31,7 @@
|
||||
service_home: "{{ nova_system_home_folder }}"
|
||||
when: inventory_hostname in groups['nova_cert']
|
||||
|
||||
- include: nova_upstart_common_init.yml
|
||||
- include: nova_init_common.yml
|
||||
vars:
|
||||
program_name: "{{ nova_conductor_program_name }}"
|
||||
service_name: "{{ nova_service_name }}"
|
||||
@ -40,7 +40,7 @@
|
||||
service_home: "{{ nova_system_home_folder }}"
|
||||
when: inventory_hostname in groups['nova_conductor']
|
||||
|
||||
- include: nova_upstart_common_init.yml
|
||||
- include: nova_init_common.yml
|
||||
vars:
|
||||
program_name: "{{ nova_program_name }}"
|
||||
service_name: "{{ nova_service_name }}"
|
||||
@ -49,7 +49,7 @@
|
||||
service_home: "{{ nova_system_home_folder }}"
|
||||
when: inventory_hostname in groups['nova_api_os_compute']
|
||||
|
||||
- include: nova_upstart_common_init.yml
|
||||
- include: nova_init_common.yml
|
||||
vars:
|
||||
program_name: "{{ nova_scheduler_program_name }}"
|
||||
service_name: "{{ nova_service_name }}"
|
||||
@ -58,7 +58,7 @@
|
||||
service_home: "{{ nova_system_home_folder }}"
|
||||
when: inventory_hostname in groups['nova_scheduler']
|
||||
|
||||
- include: nova_upstart_common_init.yml
|
||||
- include: nova_init_common.yml
|
||||
vars:
|
||||
program_name: "{{ nova_compute_program_name }}"
|
||||
service_name: "{{ nova_service_name }}"
|
||||
@ -68,7 +68,7 @@
|
||||
when: inventory_hostname in groups['nova_compute']
|
||||
|
||||
# Upstart init script for spice console.
|
||||
- include: nova_upstart_common_init.yml
|
||||
- include: nova_init_common.yml
|
||||
vars:
|
||||
program_name: "{{ nova_spice_program_name }}"
|
||||
service_name: "{{ nova_service_name }}"
|
||||
@ -80,7 +80,7 @@
|
||||
- nova_console_type == "spice"
|
||||
|
||||
# Upstart init script for novnc console.
|
||||
- include: nova_upstart_common_init.yml
|
||||
- include: nova_init_common.yml
|
||||
vars:
|
||||
program_name: "{{ nova_novncproxy_program_name }}"
|
||||
service_name: "{{ nova_service_name }}"
|
||||
@ -91,7 +91,7 @@
|
||||
- inventory_hostname in groups ['nova_console']
|
||||
- nova_console_type == "novnc"
|
||||
|
||||
- include: nova_upstart_common_init.yml
|
||||
- include: nova_init_common.yml
|
||||
vars:
|
||||
program_name: "{{ nova_consoleauth_program_name }}"
|
||||
service_name: "{{ nova_service_name }}"
|
||||
@ -99,4 +99,3 @@
|
||||
system_group: "{{ nova_system_group_name }}"
|
||||
service_home: "{{ nova_system_home_folder }}"
|
||||
when: inventory_hostname in groups['nova_console']
|
||||
|
35
tasks/nova_init_common.yml
Normal file
35
tasks/nova_init_common.yml
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
# Copyright 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.
|
||||
# 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: nova_init_upstart.yml
|
||||
when: pid1_name == "init"
|
||||
tags:
|
||||
- upstart-init
|
||||
- nova-init
|
||||
|
||||
- include: nova_init_systemd.yml
|
||||
when: pid1_name == "systemd"
|
||||
tags:
|
||||
- systemd-init
|
||||
- nova-init
|
||||
|
||||
- name: Load service
|
||||
service:
|
||||
name: "{{ program_name }}"
|
||||
enabled: "yes"
|
||||
notify:
|
||||
- Restart nova services
|
||||
tags:
|
||||
- nova-init
|
48
tasks/nova_init_systemd.yml
Normal file
48
tasks/nova_init_systemd.yml
Normal file
@ -0,0 +1,48 @@
|
||||
---
|
||||
# Copyright 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.
|
||||
# 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 nova 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: "nova-systemd-tempfiles.j2"
|
||||
dest: "/etc/tmpfiles.d/nova.conf"
|
||||
mode: "0644"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
|
||||
- name: Place the systemd init script
|
||||
template:
|
||||
src: "nova-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 nova services
|
@ -34,13 +34,3 @@
|
||||
tags:
|
||||
- upstart-init
|
||||
- nova-init
|
||||
|
||||
- name: Load service
|
||||
service:
|
||||
name: "{{ program_name }}"
|
||||
enabled: "yes"
|
||||
notify:
|
||||
- Restart nova services
|
||||
tags:
|
||||
- upstart-init
|
||||
- nova-init
|
25
templates/nova-systemd-init.j2
Normal file
25
templates/nova-systemd-init.j2
Normal file
@ -0,0 +1,25 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
[Unit]
|
||||
Description=nova 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/nova/{{ program_name }}.log
|
||||
{% else %}
|
||||
ExecStart={{ nova_bin }}/{{ program_name }} {{ program_config_options|default('') }} --log-file=/var/log/nova/{{ 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
|
4
templates/nova-systemd-tempfiles.j2
Normal file
4
templates/nova-systemd-tempfiles.j2
Normal 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 }}
|
@ -18,7 +18,6 @@
|
||||
gather_facts: false
|
||||
roles:
|
||||
- role: "lxc_container_create"
|
||||
lxc_container_release: trusty
|
||||
lxc_container_backing_store: dir
|
||||
global_environment_variables:
|
||||
PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
@ -74,8 +74,3 @@
|
||||
lxc_net_bridge: lxcbr0
|
||||
lxc_kernel_options:
|
||||
- { key: 'fs.inotify.max_user_instances', value: 1024 }
|
||||
lxc_container_caches:
|
||||
- url: "https://rpc-repo.rackspace.com/container_images/rpc-trusty-container.tgz"
|
||||
name: "trusty.tgz"
|
||||
sha256sum: "56c6a6e132ea7d10be2f3e8104f47136ccf408b30e362133f0dc4a0a9adb4d0c"
|
||||
chroot_path: trusty/rootfs-amd64
|
||||
|
1
vars/ubuntu-14.04.yml
Normal file
1
vars/ubuntu-14.04.yml
Normal file
@ -0,0 +1 @@
|
||||
---
|
2
vars/ubuntu-16.04.yml
Normal file
2
vars/ubuntu-16.04.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
nova_uca_enable: False
|
Loading…
x
Reference in New Issue
Block a user