Add CentOS support for os_nova

* only kvm host are supported right now.

Depends-On: Iff4a5999be0263a2c1843d7ca29843468cbc0ccc
Depends-On: I78fb85d44b5b0e1643bd07af3e15462c02041c89
Change-Id: Ie05c243daa7d2d46b5e8779371a363d95cc990e9
This commit is contained in:
Marc Gariepy 2016-09-28 15:10:29 -04:00
parent ca79eed523
commit 83a9864b0d
14 changed files with 221 additions and 24 deletions

View File

@ -13,12 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Restart libvirt-bin
service:
name: "libvirt-bin"
state: "restarted"
pattern: "libvirt-bin"
- name: Reload systemd daemon
command: "systemctl daemon-reload"
notify:
@ -29,6 +23,12 @@
notify:
- Restart nova services
- name: Restart libvirt-bin
service:
name: "{{ libvirt_service_name }}"
state: "restarted"
pattern: "{{ libvirt_service_name }}"
- name: Restart nova services
service:
name: "{{ item.value.service_name }}"

View File

@ -0,0 +1,3 @@
---
features:
- CentOS7/RHEL support has been added to the os_nova role.

View File

@ -18,7 +18,7 @@
- name: Add nova user to libvirtd group
user:
name: "{{ nova_system_user_name }}"
groups: "libvirtd"
groups: "{{ libvirt_group }}"
append: "yes"
tags:
- nova-libvirt
@ -56,25 +56,57 @@
- nova-kvm
- nova-libvirt
- name: Set libvirt runtime options
- name: Set libvirt runtime options (Ubuntu)
lineinfile:
dest: "/etc/default/libvirt-bin"
line: 'libvirtd_opts="-d -l"'
regexp: "^libvirtd_opts="
backup: "yes"
when: nova_libvirtd_listen_tcp == 1
when:
- nova_libvirtd_listen_tcp == 1
- ansible_pkg_mgr == 'apt'
notify: Restart libvirt-bin
tags:
- nova-kvm
- nova-libvirt
- name: Set libvirt runtime options
- name: Set libvirt runtime options (Ubuntu)
lineinfile:
dest: "/etc/default/libvirt-bin"
line: 'libvirtd_opts="-d"'
regexp: "^libvirtd_opts="
backup: "yes"
when: nova_libvirtd_listen_tcp == 0
when:
- nova_libvirtd_listen_tcp == 0
- ansible_pkg_mgr == 'apt'
notify: Restart libvirt-bin
tags:
- nova-kvm
- nova-libvirt
- name: Set libvirt runtime options (CentOS)
lineinfile:
dest: "/etc/sysconfig/libvirtd"
line: 'LIBVIRTD_ARGS="-l"'
regexp: "^(#)?LIBVIRTD_ARGS=*"
backup: "yes"
when:
- nova_libvirtd_listen_tcp == 1
- ansible_pkg_mgr == 'yum'
notify: Restart libvirt-bin
tags:
- nova-kvm
- nova-libvirt
- name: Set libvirt runtime options (CentOS)
lineinfile:
dest: "/etc/sysconfig/libvirtd"
line: 'LIBVIRTD_ARGS=""'
regexp: "^(#)?LIBVIRTD_ARGS=*"
backup: "yes"
when:
- nova_libvirtd_listen_tcp == 0
- ansible_pkg_mgr == 'yum'
notify: Restart libvirt-bin
tags:
- nova-kvm

View File

@ -13,6 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Make sure libvirt is started
service:
name: "{{ libvirt_service_name }}"
state: "started"
pattern: "{{ libvirt_service_name }}"
- name: Check the state of the default qemu save directory
stat:
path: "/var/lib/libvirt/qemu/save"

View File

@ -25,6 +25,7 @@
service:
name: "{{ item.value.service_name }}"
enabled: "yes"
state: "started"
with_dict: "{{ nova_services }}"
when: inventory_hostname in groups[item.value.group]
notify:

View File

@ -16,6 +16,9 @@
- include: nova_install_apt.yml
when: ansible_pkg_mgr == 'apt'
- include: nova_install_yum.yml
when: ansible_pkg_mgr == 'yum'
- name: Create developer mode constraint file
copy:
dest: "/opt/developer-pip-constraints.txt"

View File

@ -0,0 +1,86 @@
---
# 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: Install RDO package
yum:
pkg: "{{ rdo_package }}"
state: "present"
register: install_cloud_rdo_package
until: install_cloud_rdo_package | success
retries: 5
delay: 2
- name: Install yum packages (common)
yum:
pkg: "{{ item }}"
state: "{{ nova_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_distro_packages }}"
tags:
- nova-install
- nova-yum-packages
- name: Remove known problem packages for the Spice console
yum:
pkg: "{{ item }}"
state: absent
register: remove_packages
until: remove_packages|success
retries: 5
delay: 2
with_items: "{{ nova_spice_distro_packages }}"
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "spice"
tags:
- nova-install
- nova-yum-packages
- nova-spice-yum-packages
- name: Install yum packages (novnc console)
yum:
pkg: "{{ item }}"
state: "{{ nova_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_novnc_distro_packages }}"
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "novnc"
tags:
- nova-install
- nova-yum-packages
- nova-novnc-apt-packages
- name: Install yum packages (compute - KVM)
yum:
pkg: "{{ item }}"
state: "{{ nova_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_compute_kvm_distro_packages }}"
when:
- inventory_hostname in groups['nova_compute']
- nova_virt_type == 'kvm' or nova_virt_type == 'qemu'
tags:
- nova-yum-packages
- nova-compute-kvm-yum-packages

View File

@ -8,7 +8,7 @@ log_outputs="1:file:/var/log/libvirt/libvirtd.log"
{% endif %}
listen_tls = {{ nova_libvirtd_listen_tls }}
listen_tcp = {{ nova_libvirtd_listen_tcp }}
unix_sock_group = "libvirtd"
unix_sock_group = "{{ libvirt_group }}"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"

View File

@ -95,7 +95,8 @@ force_dhcp_release = True
dhcpbridge_flagfile = /etc/nova/nova.conf
firewall_driver = {{ nova_firewall_driver }}
use_forwarded_for = {{ nova_network_services[nova_network_type]['use_forwarded_for'] | bool }}
my_ip = {{ nova_management_address }}
my_ip = {% if nova_management_address == 'localhost' %}127.0.0.1{% else %}{{ nova_management_address }}{% endif %}
default_floating_pool = public
use_neutron = True
@ -162,8 +163,10 @@ enabled = {{ nova_console_agent_enabled }}
keymap = {{ nova_console_keymap }}
# Console Url and binds
html5proxy_base_url = {{ nova_spice_html5proxy_base_url }}
server_listen = {{ nova_management_address }}
server_proxyclient_address = {{ nova_management_address }}
server_listen = {% if nova_management_address == 'localhost' %}127.0.0.1{% else %}{{ nova_management_address }}{% endif %}
server_proxyclient_address = {% if nova_management_address == 'localhost' %}127.0.0.1{% else %}{{ nova_management_address }}{% endif %}
[vnc]
enabled = False

View File

@ -18,7 +18,6 @@ neutron_provider_networks:
network_mappings: "flat:eth12"
network_vxlan_ranges: "1:1000"
ansible_become: True
ansible_host: 127.0.0.1
neutron_local_ip: 10.1.2.1
ansible_python_interpreter: "/usr/bin/python2"
bridges:

View File

@ -13,14 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Prepare the user ssh keys
- include: common/test-prepare-keys.yml
# Prepare the host
- include: common/test-prepare-host.yml
# Prepare the containers
- include: common/test-prepare-containers.yml
# Setup the host
- include: common/test-setup-host.yml
# Install RabbitMQ/MariaDB
- include: common/test-install-infra.yml

64
vars/redhat-7.yml Normal file
View File

@ -0,0 +1,64 @@
---
# 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.
nova_qemu_user: qemu
nova_qemu_group: qemu
libvirt_group: libvirt
libvirt_service_name: libvirtd
# Common yum packages
nova_distro_packages:
- genisoimage
- git
- iptables
- libpqxx-devel
# Spice console yum packages
nova_spice_distro_packages:
- spice-html5
nova_novnc_distro_packages:
- js-jquery
- js-underscore
- librabbitmq
- libyaml
nova_compute_kvm_distro_packages:
- bridge-utils
- device-mapper-multipath
- dosfstools
- genisoimage
- iscsi-initiator-utils
- kpartx
- libvirt-daemon-config-nwfilter
- libvirt-daemon-kvm
- libvirt-devel
- libvirt-python
- nfs-utils
- python-libguestfs
- qemu
- qemu-img-ev
- sysfsutils
- vconfig
# TODO: add support for LXD on CentOS at some point.
nova_compute_lxd_distro_packages: []
# TODO: add support for PowerVM/NovaLink on CentOS at some point.
nova_compute_powervm_distro_packages: []
novalink_gpg_keys: []
rdo_package: "https://rdoproject.org/repos/rdo-release.rpm"

View File

@ -16,6 +16,9 @@
## APT Cache options
cache_timeout: 600
libvirt_group: libvirtd
libvirt_service_name: libvirt-bin
# Common apt packages
nova_distro_packages:
- genisoimage

View File

@ -16,6 +16,9 @@
## APT Cache options
cache_timeout: 600
libvirt_group: libvirtd
libvirt_service_name: libvirt-bin
# Common apt packages
nova_distro_packages:
- genisoimage