Adding support for Magnum

In addition to adding the magnum role to the repo build process we also
include the os-magnum-install.yml to deploy magnum to hosts tagged with
os_magnum.

Change-Id: I32dee168d1005572510f630a21f7d7a7a05640d9
Implements: blueprint role-magnum
This commit is contained in:
Donovan Francesco 2016-08-08 14:46:04 +02:00 committed by Jesse Pretorius (odyssey4me)
parent e944cf04eb
commit 37e7700938
11 changed files with 171 additions and 0 deletions

View File

@ -78,6 +78,10 @@
scm: git
src: https://git.openstack.org/openstack/openstack-ansible-os_ironic
version: master
- name: os_magnum
scm: git
src: https://git.openstack.org/openstack/openstack-ansible-os_magnum
version: master
- name: os_neutron
scm: git
src: https://git.openstack.org/openstack/openstack-ansible-os_neutron

View File

@ -0,0 +1,3 @@
magnum-infra_hosts:
aio1:
ip: 172.29.236.100

View File

@ -0,0 +1,8 @@
# The infra nodes that will be running the magnum services
magnum-infra_hosts:
infra1:
ip: 172.20.236.111
infra2:
ip: 172.20.236.112
infra3:
ip: 172.20.236.113

View File

@ -118,3 +118,9 @@ swift_hash_path_prefix:
## haproxy stats password
haproxy_stats_password:
haproxy_keepalived_authentication_password:
## Magnum Options
magnum_service_password:
magnum_galera_password:
magnum_rabbitmq_password:
magnum_trustee_password:

View File

@ -160,3 +160,9 @@ ironic_git_repo: https://git.openstack.org/openstack/ironic
ironic_git_install_branch: 66b66fd6296398482d95f7ef5383ada9f6f60264 # HEAD of "master" as of 01.08.2016
ironic_git_dest: "/opt/ironic_{{ ironic_git_install_branch | replace('/', '_') }}"
ironic_git_project_group: ironic_all
## Magnum service
magnum_git_repo: https://git.openstack.org/openstack/magnum
magnum_git_install_branch: 83d154607e626ad09cee75521d6a3b51f48b2c6d # HEAD of "master" as of 08.08.2016
magnum_git_dest: "/opt/magnum_{{ magnum_git_install_branch | replace('/', '_') }}"
magnum_git_project_group: magnum_all

View File

@ -0,0 +1,39 @@
---
# Copyright 2016 Internet Solutions (Pty) Ltd
#
# 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.
#
# (c) 2016 Donovan Francesco <donovan.francesco@is.co.za>
# (c) 2016 Paul Stevens <paul.stevens@is.co.za>
component_skel:
magnum:
belongs_to:
- magnum_all
container_skel:
magnum_container:
belongs_to:
- magnum-infra_containers
contains:
- magnum
properties:
service_name: magnum
physical_skel:
magnum-infra_containers:
belongs_to:
- all_containers
magnum-infra_hosts:
belongs_to:
- hosts

View File

@ -0,0 +1,24 @@
---
# Copyright 2016 Internet Solutions (Pty) Ltd
#
# 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.
magnum_galera_user: magnum
magnum_galera_database_name: magnum_service
magnum_galera_address: "{{ galera_address }}"
magnum_rabbitmq_userid: magnum
magnum_rabbitmq_vhost: /magnum
magnum_rabbitmq_port: "{{ rabbitmq_port }}"
magnum_rabbitmq_servers: "{{ rabbitmq_servers }}"
magnum_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"

63
playbooks/os-magnum-install.yml Executable file
View File

@ -0,0 +1,63 @@
---
# Copyright 2016 Internet Solutions (Pty) Ltd
#
# 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.
#
# (c) 2016 Donovan Francesco <donovan.francesco@is.co.za>
# (c) 2016 Paul Stevens <paul.stevens@is.co.za>
- name: Install magnum server
hosts: magnum_all
max_fail_percentage: 20
user: root
pre_tasks:
- include: common-tasks/os-lxc-container-setup.yml
- include: common-tasks/os-log-dir-setup.yml
vars:
log_dirs:
- src: "/openstack/log/{{ inventory_hostname }}-magnum"
dest: "/var/log/magnum"
- include: common-tasks/rabbitmq-servers-sort.yml
vars:
sort_group_name: "magnum_all"
- include: common-tasks/rabbitmq-vhost-user.yml
vars:
user: "{{ magnum_rabbitmq_userid }}"
password: "{{ magnum_rabbitmq_password }}"
vhost: "{{ magnum_rabbitmq_vhost }}"
when:
- inventory_hostname == groups['magnum_all'][0]
- groups['rabbitmq_all'] | length > 0
- include: common-tasks/mysql-db-user.yml
vars:
user_name: "{{ magnum_galera_user }}"
password: "{{ magnum_galera_password }}"
login_host: "{{ magnum_galera_address }}"
db_name: "{{ magnum_galera_database }}"
when: inventory_hostname == groups['magnum_all'][0]
roles:
- role: "os_magnum"
magnum_venv_tag: "{{ openstack_release }}"
magnum_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/magnum-{{ openstack_release }}.tgz"
pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}"
tags:
- "os-magnum"
- { role: "openstack_openrc", tags: [ "openstack-openrc" ] }
- role: "rsyslog_client"
rsyslog_client_log_rotate_file: magnum_log_rotate
rsyslog_client_log_dir: "/var/log/magnum"
rsyslog_client_config_name: "99-magnum-rsyslog-client.conf"
tags:
- "magnum-rsyslog-client"
vars:
is_metal: "{{ properties.is_metal|default(false) }}"

View File

@ -235,3 +235,11 @@ haproxy_default_services:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
- service:
haproxy_service_name: magnum
haproxy_backend_nodes: "{{ groups['magnum_all'] | default([]) }}"
haproxy_ssl: "{{ haproxy_ssl }}"
haproxy_port: 9511
haproxy_balance_type: http
haproxy_backend_options:
- "httpchk HEAD /"

View File

@ -0,0 +1,5 @@
---
features:
- Adding support for Magnum to be built as part of the repo build process.
- Adding the ``os-magnum-install.yml`` file to deploy magnum to hosts tagged
with hostgroup ``magnum_all``.

View File

@ -147,6 +147,11 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase):
'log_all',
'log_containers',
'log_hosts',
'magnum',
'magnum_all',
'magnum_container',
'magnum-infra_containers',
'magnum-infra_hosts',
'memcached',
'memcached_all',
'memcached_container',