Files
cf66cd365c5c4ab7276b8d9a2c11d149f1884eb3
openstack-ansible-os_nova /tasks /main.yml

304 lines
9.7 KiB
YAML
Raw Normal View History

Convert existing roles into galaxy roles This change implements the blueprint to convert all roles and plays into a more generic setup, following upstream ansible best practices. Items Changed: * All tasks have tags. * All roles use namespaced variables. * All redundant tasks within a given play and role have been removed. * All of the repetitive plays have been removed in-favor of a more simplistic approach. This change duplicates code within the roles but ensures that the roles only ever run within their own scope. * All roles have been built using an ansible galaxy syntax. * The `*requirement.txt` files have been reformatted follow upstream Openstack practices. * Dynamically generated inventory is now more organized, this should assist anyone who may want or need to dive into the JSON blob that is created. In the inventory a properties field is used for items that customize containers within the inventory. * The environment map has been modified to support additional host groups to enable the seperation of infrastructure pieces. While the old infra_hosts group will still work this change allows for groups to be divided up into seperate chunks; eg: deployment of a swift only stack. * The LXC logic now exists within the plays. * etc/openstack_deploy/user_variables.yml has all password/token variables extracted into the separate file etc/openstack_deploy/user_secrets.yml in order to allow seperate security settings on that file. Items Excised: * All of the roles have had the LXC logic removed from within them which should allow roles to be consumed outside of the `os-ansible-deployment` reference architecture. Note: * the directory rpc_deployment still exists and is presently pointed at plays containing a deprecation warning instructing the user to move to the standard playbooks directory. * While all of the rackspace specific components and variables have been removed and or were refactored the repository still relies on an upstream mirror of Openstack built python files and container images. This upstream mirror is hosted at rackspace at "http://rpc-repo.rackspace.com" though this is not locked to and or tied to rackspace specific installations. This repository contains all of the needed code to create and/or clone your own mirror. DocImpact Co-Authored-By: Jesse Pretorius <jesse.pretorius@rackspace.co.uk> Closes-Bug: #1403676 Implements: blueprint galaxy-roles Change-Id: I03df3328b7655f0cc9e43ba83b02623d038d214e
2015年02月14日 10:06:50 -06:00
---
# 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.
vars:
params:
files:
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_version'].split('.')[0] }}.yml"
- "{{ ansible_facts['os_family'] | lower }}.yml"
paths:
- "{{ role_path }}/vars"
- always
msg:"Unsupported Virt Type Provided {{ nova_supported_virt_types }}"
- nova_virt_type is defined
- nova_virt_type not in nova_supported_virt_types
tags:
- always
fail:
msg:"Switching installation methods for OpenStack services is not supported"
when:
- ansible_local is defined
- ansible_local.openstack_ansible is defined
- ansible_local.openstack_ansible.nova is defined
- ansible_local.openstack_ansible.nova.install_method is defined
- ansible_local.openstack_ansible.nova.install_method != nova_install_method
- name:Gather variables for installation method
include_vars:"{{ nova_install_method }}_install.yml"
tags:
- always
name:openstack.osa.db_setup
apply:
tags:
- common-db
- nova-config
_oslodb_setup_host:"{{ nova_db_setup_host }}"
_oslodb_setup_endpoint:"{{ nova_galera_address }}"
_oslodb_setup_port:"{{ nova_galera_port }}"
- name:"{{ nova_galera_database }}"
users:
- username:"{{ nova_galera_user }}"
password:"{{ nova_container_mysql_password }}"
- name:"{{ nova_api_galera_database }}"
users:
- username:"{{ nova_api_galera_user }}"
password:"{{ nova_api_container_mysql_password }}"
- name:"{{ nova_cell0_database }}"
users:
- username:"{{ nova_api_galera_user }}"
password:"{{ nova_api_container_mysql_password }}"
tags:
name:openstack.osa.mq_setup
apply:
tags:
- common-mq
- nova-config
_oslomsg_rpc_setup_host:"{{ nova_oslomsg_rpc_setup_host }}"
_oslomsg_rpc_userid:"{{ nova_oslomsg_rpc_userid }}"
_oslomsg_rpc_password:"{{ nova_oslomsg_rpc_password }}"
_oslomsg_rpc_vhost:"{{ nova_oslomsg_rpc_vhost }}"
_oslomsg_rpc_transport:"{{ nova_oslomsg_rpc_transport }}"
_oslomsg_notify_setup_host:"{{ nova_oslomsg_notify_setup_host }}"
_oslomsg_notify_userid:"{{ nova_oslomsg_notify_userid }}"
_oslomsg_notify_password:"{{ nova_oslomsg_notify_password }}"
_oslomsg_notify_vhost:"{{ nova_oslomsg_notify_vhost }}"
_oslomsg_notify_transport:"{{ nova_oslomsg_notify_transport }}"
tags:
- nova_virt_type is not defined
- always
- nova-config
- nova-install
- nova-install
setup:
filter:ansible_local
gather_subset:"!all"
tags:
- nova-config
name:pki
tasks_from:main_certs.yml
vars:
pki_setup_host:"{{ nova_pki_setup_host }}"
pki_dir:"{{ nova_pki_dir }}"
pki_create_certificates:"{{ nova_user_ssl_cert is not defined and nova_user_ssl_key is not defined }}"
pki_install_certificates:"{{ nova_pki_compute_install_certificates }}"
- nova_libvirtd_listen_tls == 1
- "'nova_compute' in group_names"
- name:Create and install SSL certificates for console hosts
include_role:
name:pki
tasks_from:main_certs.yml
vars:
pki_setup_host:"{{ nova_pki_setup_host }}"
pki_dir:"{{ nova_pki_dir }}"
pki_create_certificates:"{{ nova_user_ssl_cert is not defined and nova_user_ssl_key is not defined }}"
pki_install_certificates:"{{ nova_pki_console_install_certificates }}"
when:
- nova_qemu_vnc_tls == 1
- nova_console_type == 'novnc'
- "'nova_console' in group_names"
- nova-config
name:openstack.osa.service_setup
apply:
tags:
- common-service
- nova-config
_service_adminuri_insecure:"{{ keystone_service_adminuri_insecure }}"
_service_in_ldap:"{{ nova_service_in_ldap }}"
_service_setup_host:"{{ nova_service_setup_host }}"
_service_setup_host_python_interpreter:"{{ nova_service_setup_host_python_interpreter }}"
_service_project_name:"{{ nova_service_project_name }}"
- name:"{{ nova_service_user_name }}"
password:"{{ nova_service_password }}"
role:"{{ nova_service_role_name }}"
- service:"{{ nova_service_name }}"
interface:"public"
url:"{{ nova_service_publicurl }}"
- service:"{{ nova_service_name }}"
interface:"internal"
url:"{{ nova_service_internalurl }}"
- service:"{{ nova_service_name }}"
interface:"admin"
url:"{{ nova_service_adminurl }}"
_service_catalog:
- name:"{{ nova_service_name }}"
type:"{{ nova_service_type }}"
description:"{{ nova_service_description }}"
- nova-config
Convert existing roles into galaxy roles This change implements the blueprint to convert all roles and plays into a more generic setup, following upstream ansible best practices. Items Changed: * All tasks have tags. * All roles use namespaced variables. * All redundant tasks within a given play and role have been removed. * All of the repetitive plays have been removed in-favor of a more simplistic approach. This change duplicates code within the roles but ensures that the roles only ever run within their own scope. * All roles have been built using an ansible galaxy syntax. * The `*requirement.txt` files have been reformatted follow upstream Openstack practices. * Dynamically generated inventory is now more organized, this should assist anyone who may want or need to dive into the JSON blob that is created. In the inventory a properties field is used for items that customize containers within the inventory. * The environment map has been modified to support additional host groups to enable the seperation of infrastructure pieces. While the old infra_hosts group will still work this change allows for groups to be divided up into seperate chunks; eg: deployment of a swift only stack. * The LXC logic now exists within the plays. * etc/openstack_deploy/user_variables.yml has all password/token variables extracted into the separate file etc/openstack_deploy/user_secrets.yml in order to allow seperate security settings on that file. Items Excised: * All of the roles have had the LXC logic removed from within them which should allow roles to be consumed outside of the `os-ansible-deployment` reference architecture. Note: * the directory rpc_deployment still exists and is presently pointed at plays containing a deprecation warning instructing the user to move to the standard playbooks directory. * While all of the rackspace specific components and variables have been removed and or were refactored the repository still relies on an upstream mirror of Openstack built python files and container images. This upstream mirror is hosted at rackspace at "http://rpc-repo.rackspace.com" though this is not locked to and or tied to rackspace specific installations. This repository contains all of the needed code to create and/or clone your own mirror. DocImpact Co-Authored-By: Jesse Pretorius <jesse.pretorius@rackspace.co.uk> Closes-Bug: #1403676 Implements: blueprint galaxy-roles Change-Id: I03df3328b7655f0cc9e43ba83b02623d038d214e
2015年02月14日 10:06:50 -06:00
import_role:
name:uwsgi
vars:
uwsgi_services:"{{ uwsgi_nova_services }}"
uwsgi_install_method:"{{ nova_install_method }}"
- nova-config
vars:
systemd_user_name:"{{ nova_system_user_name }}"
systemd_group_name:"{{ nova_system_group_name }}"
systemd_tempd_prefix:openstack
systemd_lock_dir:"{{ nova_lock_dir }}"
systemd_BlockIOAccounting:true
systemd_MemoryAccounting:true
systemd_TasksAccounting:true
{% set services = [] %}
{% for service in filtered_nova_services %}
{%
set _ = service.update(
{
'enabled':'yes',
'state':'started',
'config_overrides':service.init_config_overrides
}
)
%}
{% set _ = service.pop('init_config_overrides') -%}
{% set _ = services.append(service) -%}
{% endfor %}
{{services }}
- nova-config
Convert existing roles into galaxy roles This change implements the blueprint to convert all roles and plays into a more generic setup, following upstream ansible best practices. Items Changed: * All tasks have tags. * All roles use namespaced variables. * All redundant tasks within a given play and role have been removed. * All of the repetitive plays have been removed in-favor of a more simplistic approach. This change duplicates code within the roles but ensures that the roles only ever run within their own scope. * All roles have been built using an ansible galaxy syntax. * The `*requirement.txt` files have been reformatted follow upstream Openstack practices. * Dynamically generated inventory is now more organized, this should assist anyone who may want or need to dive into the JSON blob that is created. In the inventory a properties field is used for items that customize containers within the inventory. * The environment map has been modified to support additional host groups to enable the seperation of infrastructure pieces. While the old infra_hosts group will still work this change allows for groups to be divided up into seperate chunks; eg: deployment of a swift only stack. * The LXC logic now exists within the plays. * etc/openstack_deploy/user_variables.yml has all password/token variables extracted into the separate file etc/openstack_deploy/user_secrets.yml in order to allow seperate security settings on that file. Items Excised: * All of the roles have had the LXC logic removed from within them which should allow roles to be consumed outside of the `os-ansible-deployment` reference architecture. Note: * the directory rpc_deployment still exists and is presently pointed at plays containing a deprecation warning instructing the user to move to the standard playbooks directory. * While all of the rackspace specific components and variables have been removed and or were refactored the repository still relies on an upstream mirror of Openstack built python files and container images. This upstream mirror is hosted at rackspace at "http://rpc-repo.rackspace.com" though this is not locked to and or tied to rackspace specific installations. This repository contains all of the needed code to create and/or clone your own mirror. DocImpact Co-Authored-By: Jesse Pretorius <jesse.pretorius@rackspace.co.uk> Closes-Bug: #1403676 Implements: blueprint galaxy-roles Change-Id: I03df3328b7655f0cc9e43ba83b02623d038d214e
2015年02月14日 10:06:50 -06:00
Convert existing roles into galaxy roles This change implements the blueprint to convert all roles and plays into a more generic setup, following upstream ansible best practices. Items Changed: * All tasks have tags. * All roles use namespaced variables. * All redundant tasks within a given play and role have been removed. * All of the repetitive plays have been removed in-favor of a more simplistic approach. This change duplicates code within the roles but ensures that the roles only ever run within their own scope. * All roles have been built using an ansible galaxy syntax. * The `*requirement.txt` files have been reformatted follow upstream Openstack practices. * Dynamically generated inventory is now more organized, this should assist anyone who may want or need to dive into the JSON blob that is created. In the inventory a properties field is used for items that customize containers within the inventory. * The environment map has been modified to support additional host groups to enable the seperation of infrastructure pieces. While the old infra_hosts group will still work this change allows for groups to be divided up into seperate chunks; eg: deployment of a swift only stack. * The LXC logic now exists within the plays. * etc/openstack_deploy/user_variables.yml has all password/token variables extracted into the separate file etc/openstack_deploy/user_secrets.yml in order to allow seperate security settings on that file. Items Excised: * All of the roles have had the LXC logic removed from within them which should allow roles to be consumed outside of the `os-ansible-deployment` reference architecture. Note: * the directory rpc_deployment still exists and is presently pointed at plays containing a deprecation warning instructing the user to move to the standard playbooks directory. * While all of the rackspace specific components and variables have been removed and or were refactored the repository still relies on an upstream mirror of Openstack built python files and container images. This upstream mirror is hosted at rackspace at "http://rpc-repo.rackspace.com" though this is not locked to and or tied to rackspace specific installations. This repository contains all of the needed code to create and/or clone your own mirror. DocImpact Co-Authored-By: Jesse Pretorius <jesse.pretorius@rackspace.co.uk> Closes-Bug: #1403676 Implements: blueprint galaxy-roles Change-Id: I03df3328b7655f0cc9e43ba83b02623d038d214e
2015年02月14日 10:06:50 -06:00
tags:
vars:
openstack_service_system_user:"{{ nova_system_user_name }}"
- ceph
meta:flush_handlers
# where we want to isolate the clouds.yaml configuration,
# rather than have it implemented on all compute nodes.
- import_tasks:nova_compute_wait.yml
- "nova_services['nova-compute']['group'] in group_names"
- "nova_discover_hosts_in_cells_interval | int < 1"
vars:
- nova-config
# because the compute hosts do not have access to
# the database connection string and therefore
# cannot run nova-manage.
- nova-config