Merge "Update role to use the Multi-Distro framework"

This commit is contained in:
Jenkins 2016-07-07 16:21:30 +00:00 committed by Gerrit Code Review
commit 68a9e1820b
12 changed files with 310 additions and 244 deletions

View File

@ -19,9 +19,6 @@ nova_ceilometer_enabled: False
## Verbosity Options
debug: False
## APT Cache options
cache_timeout: 600
nova_git_repo: https://git.openstack.org/openstack/nova
nova_git_install_branch: master
nova_requirements_git_repo: https://git.openstack.org/openstack/requirements
@ -347,45 +344,9 @@ nova_service_names:
- "{{ nova_consoleauth_program_name }}"
- "{{ nova_novncproxy_program_name }}"
# Common apt packages
nova_apt_packages:
- genisoimage
- git
- libpq-dev
- iptables
# Spice console apt packages
nova_spice_apt_packages:
- spice-html5
nova_novnc_apt_packages:
- libjs-jquery
- libjs-sphinxdoc
- libjs-underscore
- libjs-swfobject
- librabbitmq1
- libyaml-0-2
nova_novnc_pip_packages:
- websockify
nova_compute_kvm_apt_packages:
- bridge-utils
- genisoimage
- kpartx
- libvirt-bin
- open-iscsi
- python-libguestfs
- python-libvirt
- qemu
- qemu-utils
- sysfsutils
- vlan
- nfs-common
- dosfstools
- dosfstools-dbg
- multipath-tools
# nova packages that must be installed before anything else
nova_requires_pip_packages:
- virtualenv
@ -416,35 +377,5 @@ nova_rootwrap_conf_overrides: {}
nova_api_paste_ini_overrides: {}
nova_policy_overrides: {}
# Ubuntu Cloud Archive variables
nova_uca_enable: True
uca_openstack_release: mitaka
uca_apt_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}"
uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main"
# nova powervm virt driver
nova_compute_powervm_apt_packages:
- bridge-utils
- genisoimage
- kpartx
- open-iscsi
- python-libguestfs
- sysfsutils
- vlan
- nfs-common
- dosfstools
- dosfstools-dbg
- multipath-tools
- pvm-novalink
nova_compute_powervm_pip_packages:
- nova-powervm
novalink_apt_repo:
repo: "deb [arch=ppc64el] ftp://public.dhe.ibm.com/systems/virtualization/Novalink/debian/ novalink_1.0.0 non-free"
state: "present"
novalink_gpg_keys:
- url: "ftp://public.dhe.ibm.com/systems/virtualization/Novalink/debian/novalink-gpg-pub.key"
state: "present"

View File

@ -0,0 +1,12 @@
---
deprecations:
- |
The following variables have been renamed in order to make the variable
names neutral for multiple operating systems.
* nova_apt_packages -> nova_packages
* nova_spice_apt_packages -> nova_spice_packages
* nova_novnc_apt_packages -> nova_novnc_packages
* nova_compute_kvm_apt_packages -> nova_compute_kvm_package
The old variable names will be removed in the Ocata cycle.

View File

@ -30,6 +30,8 @@
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
tags:
@ -43,7 +45,6 @@
- include: nova_pre_install.yml
- include: nova_install.yml
- include: nova_console_install.yml
- include: nova_post_install.yml
- include: nova_init.yml

View File

@ -13,59 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Add ubuntu cloud archive key package
apt:
pkg: ubuntu-cloud-keyring
when: nova_uca_enable
register: add_keys
tags:
- add-apt-keys
- name: Add UCA repo(s)
apt_repository:
repo: "{{ uca_repo }}"
state: present
register: add_repo
when: nova_uca_enable
until: add_repo|success
retries: 5
delay: 2
tags:
- add-uca-repo
#TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache
#when https://github.com/ansible/ansible-modules-core/pull/1517 is merged
#in 1.9.x or we move to 2.0 (if tested working)
- name: Check apt last update file
stat:
path: /var/cache/apt
register: apt_cache_stat
tags:
- nova-apt-packages
- nova-compute-kvm-apt-packages
- name: Update apt if needed
apt:
update_cache: yes
when: ("ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}" or
add_keys|changed or add_repo|changed)
tags:
- nova-apt-packages
- nova-compute-kvm-apt-packages
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_compute_kvm_apt_packages }}"
tags:
- nova-apt-packages
- nova-compute-kvm-apt-packages
- name: Check if qemu save directory is a directory
stat:
path: "/var/lib/libvirt/qemu/save"

View File

@ -28,8 +28,8 @@
- name: Add novalink repo
apt_repository:
repo: "{{ novalink_apt_repo.repo }}"
state: "{{ novalink_apt_repo.state }}"
repo: "{{ novalink_repo.repo }}"
state: "{{ novalink_repo.state }}"
register: add_nv_repos
until: add_nv_repos|success
retries: 5
@ -66,7 +66,7 @@
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_compute_powervm_apt_packages }}"
with_items: "{{ nova_compute_powervm_packages }}"
tags:
- nova-apt-packages
- nova-compute-powervm-apt-packages

View File

@ -1,28 +0,0 @@
---
# Copyright 2015, 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_console_spice_install.yml
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "spice"
tags:
- nova-spice-console
- include: nova_console_novnc_install.yml
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "novnc"
tags:
- nova-novnc-console

View File

@ -38,38 +38,6 @@
- nova-install
- nova-novnc-git
#TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache
#when https://github.com/ansible/ansible-modules-core/pull/1517 is merged
#in 1.9.x or we move to 2.0 (if tested working)
- name: Check apt last update file
stat:
path: /var/cache/apt
register: apt_cache_stat
tags:
- nova-apt-packages
- name: Update apt if needed
apt:
update_cache: yes
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
tags:
- nova-apt-packages
- nova-novnc-apt-packages
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_novnc_apt_packages }}"
tags:
- nova-install
- nova-apt-packages
- nova-novnc-apt-packages
- name: Install pip packages (venv)
pip:
name: "{{ item }}"

View File

@ -13,38 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache
#when https://github.com/ansible/ansible-modules-core/pull/1517 is merged
#in 1.9.x or we move to 2.0 (if tested working)
- name: Check apt last update file
stat:
path: /var/cache/apt
register: apt_cache_stat
tags:
- nova-apt-packages
- nova-spice-apt-packages
- name: Update apt if needed
apt:
update_cache: yes
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
tags:
- nova-apt-packages
- nova-spice-apt-packages
- name: Remove apt packages
apt:
pkg: "{{ item }}"
state: absent
register: remove_packages
until: remove_packages|success
retries: 5
delay: 2
with_items: "{{ nova_spice_apt_packages }}"
tags:
- nova-apt-packages
- nova-spice-apt-packages
- name: Remove old git directory
file:
path: "/usr/share/spice-html5"

View File

@ -13,35 +13,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache
#when https://github.com/ansible/ansible-modules-core/pull/1517 is merged
#in 1.9.x or we move to 2.0 (if tested working)
- name: Check apt last update file
stat:
path: /var/cache/apt
register: apt_cache_stat
tags:
- nova-apt-packages
- include: nova_install_apt.yml
when:
- ansible_pkg_mgr == 'apt'
- name: Update apt if needed
apt:
update_cache: yes
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
- include: nova_console_spice_install.yml
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "spice"
tags:
- nova-apt-packages
- nova-spice-console
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_apt_packages }}"
- include: nova_console_novnc_install.yml
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "novnc"
tags:
- nova-install
- nova-apt-packages
- nova-novnc-console
- name: Create developer mode constraint file
copy:

116
tasks/nova_install_apt.yml Normal file
View File

@ -0,0 +1,116 @@
---
# 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: Add Ubuntu Cloud Archive key package
apt:
pkg: ubuntu-cloud-keyring
when: nova_uca_enable
register: nova_uca_add_keys
tags:
- add-apt-keys
- name: Add Ubuntu Cloud Archive apt repository
apt_repository:
repo: "{{ uca_repo }}"
state: present
register: nova_uca_add_repo
when: nova_uca_enable
until: add_repo|success
retries: 5
delay: 2
tags:
- add-uca-repo
#TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache
#when https://github.com/ansible/ansible-modules-core/pull/1517 is merged
#in 1.9.x or we move to 2.0 (if tested working)
- name: Check apt last update file
stat:
path: /var/cache/apt
register: apt_cache_stat
tags:
- nova-apt-packages
- name: Update apt if needed
apt:
update_cache: yes
when: ("ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}" or
nova_uca_add_keys | changed or
nova_uca_add_repo | changed)
tags:
- nova-apt-packages
- name: Install apt packages (common)
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_packages | deprecated(nova_apt_packages, 'nova_apt_packages', 'nova_packages', 'Ocata') }}"
tags:
- nova-install
- nova-apt-packages
- name: Remove known problem packages for the Spice console
apt:
pkg: "{{ item }}"
state: absent
register: remove_packages
until: remove_packages|success
retries: 5
delay: 2
with_items: "{{ nova_spice_packages | deprecated(nova_spice_apt_packages, 'nova_spice_apt_packages', 'nova_spice_packages', 'Ocata') }}"
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "spice"
tags:
- nova-install
- nova-apt-packages
- nova-spice-apt-packages
- name: Install apt packages (novnc console)
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_novnc_packages | deprecated(nova_novnc_apt_packages, 'nova_novnc_apt_packages', 'nova_novnc_packages', 'Ocata') }}"
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "novnc"
tags:
- nova-install
- nova-apt-packages
- nova-novnc-apt-packages
- name: Install apt packages (compute - KVM)
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_compute_kvm_packages | deprecated(nova_compute_kvm_apt_packages, 'nova_compute_kvm_apt_packages', 'nova_compute_kvm_packages', 'Ocata') }}"
when:
- inventory_hostname in groups['nova_compute']
- nova_virt_type == 'kvm' or nova_virt_type == 'qemu'
tags:
- nova-apt-packages
- nova-compute-kvm-apt-packages

View File

@ -1 +1,83 @@
---
# 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.
## APT Cache options
cache_timeout: 600
# Common apt packages
nova_packages:
- genisoimage
- git
- libpq-dev
- iptables
# Spice console apt packages
nova_spice_packages:
- spice-html5
nova_novnc_packages:
- libjs-jquery
- libjs-sphinxdoc
- libjs-underscore
- libjs-swfobject
- librabbitmq1
- libyaml-0-2
nova_compute_kvm_packages:
- bridge-utils
- genisoimage
- kpartx
- libvirt-bin
- open-iscsi
- python-libguestfs
- python-libvirt
- qemu
- qemu-utils
- sysfsutils
- vlan
- nfs-common
- dosfstools
- dosfstools-dbg
- multipath-tools
# Ubuntu Cloud Archive variables
nova_uca_enable: True
uca_openstack_release: mitaka
uca_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}"
uca_repo: "deb {{ uca_repo_url }} {{ uca_repo_dist }} main"
# nova powervm virt driver
nova_compute_powervm_packages:
- bridge-utils
- genisoimage
- kpartx
- open-iscsi
- python-libguestfs
- sysfsutils
- vlan
- nfs-common
- dosfstools
- dosfstools-dbg
- multipath-tools
- pvm-novalink
novalink_repo:
repo: "deb [arch=ppc64el] ftp://public.dhe.ibm.com/systems/virtualization/Novalink/debian/ novalink_1.0.0 non-free"
state: "present"
novalink_gpg_keys:
- url: "ftp://public.dhe.ibm.com/systems/virtualization/Novalink/debian/novalink-gpg-pub.key"
state: "present"

View File

@ -1,2 +1,83 @@
---
nova_uca_enable: False
# 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.
## APT Cache options
cache_timeout: 600
# Common apt packages
nova_packages:
- genisoimage
- git
- libpq-dev
- iptables
# Spice console apt packages
nova_spice_packages:
- spice-html5
nova_novnc_packages:
- libjs-jquery
- libjs-sphinxdoc
- libjs-underscore
- libjs-swfobject
- librabbitmq1
- libyaml-0-2
nova_compute_kvm_packages:
- bridge-utils
- genisoimage
- kpartx
- libvirt-bin
- open-iscsi
- python-libguestfs
- python-libvirt
- qemu
- qemu-utils
- sysfsutils
- vlan
- nfs-common
- dosfstools
- dosfstools-dbg
- multipath-tools
# Ubuntu Cloud Archive variables
nova_uca_enable: True
uca_openstack_release: newton
uca_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}"
uca_repo: "deb {{ uca_repo_url }} {{ uca_repo_dist }} main"
# nova powervm virt driver
nova_compute_powervm_packages:
- bridge-utils
- genisoimage
- kpartx
- open-iscsi
- python-libguestfs
- sysfsutils
- vlan
- nfs-common
- dosfstools
- dosfstools-dbg
- multipath-tools
- pvm-novalink
novalink_repo:
repo: "deb [arch=ppc64el] ftp://public.dhe.ibm.com/systems/virtualization/Novalink/debian/ novalink_1.0.0 non-free"
state: "present"
novalink_gpg_keys:
- url: "ftp://public.dhe.ibm.com/systems/virtualization/Novalink/debian/novalink-gpg-pub.key"
state: "present"