From 05f36014c2825e839000d8c0cf1af15c9fd2d3d8 Mon Sep 17 00:00:00 2001 From: Logan V Date: Thu, 27 Jul 2017 19:33:55 -0500 Subject: [PATCH] Add etcd environment definition Instead of requiring the user to define an env.d override to deploy etcd when Calico is used, we can provide a default etcd environment definition that will only deploy etcd containers if 'etcd_hosts' are defined in the openstack_user_config. There is no upgrade impact because users who already use calico will have an out of tree environment defintion in /etc/openstack_deploy/env.d which overrides the in-tree version. Change-Id: Id395ae972ea821b36f3b4ae09f4c72280256e676 --- etc/openstack_deploy/conf.d/etcd.conf.example | 9 +++++ playbooks/inventory/env.d/etcd.yml | 34 +++++++++++++++++++ tests/test_inventory.py | 5 +++ 3 files changed, 48 insertions(+) create mode 100644 etc/openstack_deploy/conf.d/etcd.conf.example create mode 100644 playbooks/inventory/env.d/etcd.yml diff --git a/etc/openstack_deploy/conf.d/etcd.conf.example b/etc/openstack_deploy/conf.d/etcd.conf.example new file mode 100644 index 0000000000..04332e6ded --- /dev/null +++ b/etc/openstack_deploy/conf.d/etcd.conf.example @@ -0,0 +1,9 @@ +# The infra nodes that will be running the etcd containers (only used if the +# calico plugin is enabled for Neutron) +etcd_hosts: + infra1: + ip: 172.20.236.111 + infra2: + ip: 172.20.236.112 + infra3: + ip: 172.20.236.113 diff --git a/playbooks/inventory/env.d/etcd.yml b/playbooks/inventory/env.d/etcd.yml new file mode 100644 index 0000000000..a5968f8e24 --- /dev/null +++ b/playbooks/inventory/env.d/etcd.yml @@ -0,0 +1,34 @@ +--- +# Copyright 2017, Logan Vig +# +# 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. + +component_skel: + etcd: + belongs_to: + - etcd_all + +container_skel: + etcd_container: + belongs_to: + - etcd_containers + contains: + - etcd + +physical_skel: + etcd_containers: + belongs_to: + - all_containers + etcd_hosts: + belongs_to: + - hosts diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 2aa50bd25b..488395bb69 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -192,6 +192,11 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'designate_worker', 'designate_producer', 'designate_sink', + 'etcd', + 'etcd_all', + 'etcd_container', + 'etcd_containers', + 'etcd_hosts', 'galera', 'galera_all', 'galera_container',