Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 1 | # Copyright 2016 Mirantis, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | import copy |
| 15 | import os |
| 16 | import pkg_resources |
| 17 | |
| 18 | from oslo_config import cfg |
| 19 | from oslo_config import generator |
| 20 | |
| 21 | from tcp_tests.helpers import ext |
| 22 | from tcp_tests.helpers import oslo_cfg_types as ct |
| 23 | from tcp_tests import settings |
| 24 | |
Dennis Dmitriev | 9b02c8b | 2017-11-13 15:31:35 +0200 | [diff] [blame] | 25 | print("\n" + "-" * 10 + " Initialize oslo.config variables with defaults" |
| 26 | " from environment" + "-" * 10) |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 27 | |
| 28 | _default_conf = pkg_resources.resource_filename( |
Dennis Dmitriev | ab83ea4 | 2017-05-12 16:52:45 +0300 | [diff] [blame] | 29 | __name__, 'templates/{0}/underlay.yaml'.format(settings.LAB_CONFIG_NAME)) |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 30 | |
| 31 | _default_salt_steps = pkg_resources.resource_filename( |
Dennis Dmitriev | ab83ea4 | 2017-05-12 16:52:45 +0300 | [diff] [blame] | 32 | __name__, 'templates/{0}/salt.yaml'.format(settings.LAB_CONFIG_NAME)) |
Dennis Dmitriev | 9dada8a | 2017-08-30 17:38:55 +0300 | [diff] [blame] | 33 | _default_environment_template_dir = pkg_resources.resource_filename( |
| 34 | __name__, 'environment/') |
Dmitry Tyzhnenko | 8f6a63e | 2017-09-05 15:37:23 +0300 | [diff] [blame] | 35 | _default_templates_dir = pkg_resources.resource_filename( |
| 36 | __name__, 'templates/') |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 37 | _default_core_steps = pkg_resources.resource_filename( |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 38 | __name__, |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 39 | 'templates/{0}/core.yaml'.format( |
Dennis Dmitriev | 2a13a13 | 2016-11-04 00:56:23 +0200 | [diff] [blame] | 40 | settings.LAB_CONFIG_NAME)) |
Dennis Dmitriev | eac3aab | 2017-07-12 16:36:41 +0300 | [diff] [blame] | 41 | _default_oss_steps = pkg_resources.resource_filename( |
| 42 | __name__, |
| 43 | 'templates/{0}/oss.yaml'.format( |
| 44 | settings.LAB_CONFIG_NAME)) |
sgudz | b67ce73 | 2018-02-13 17:58:31 +0200 | [diff] [blame] | 45 | _default_drivetrain_steps = pkg_resources.resource_filename( |
| 46 | __name__, |
| 47 | 'templates/{0}/drivetrain.yaml'.format( |
| 48 | settings.LAB_CONFIG_NAME)) |
Dennis Dmitriev | f3f90a5 | 2017-08-10 14:37:05 +0300 | [diff] [blame] | 49 | _default_decapod_steps = pkg_resources.resource_filename( |
| 50 | __name__, |
| 51 | 'templates/{0}/decapod.yaml'.format( |
| 52 | settings.LAB_CONFIG_NAME)) |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 53 | _default_openstack_steps = pkg_resources.resource_filename( |
Dennis Dmitriev | ab83ea4 | 2017-05-12 16:52:45 +0300 | [diff] [blame] | 54 | __name__, 'templates/{0}/openstack.yaml'.format( |
Dennis Dmitriev | 2a13a13 | 2016-11-04 00:56:23 +0200 | [diff] [blame] | 55 | settings.LAB_CONFIG_NAME)) |
Tatyana Leontovich | 8dbc788 | 2018-08-29 13:11:16 +0300 | [diff] [blame] | 56 | _default_openstack_resources_steps = pkg_resources.resource_filename( |
| 57 | __name__, 'templates/{0}/post_openstack.yaml'.format( |
| 58 | settings.LAB_CONFIG_NAME)) |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 59 | _default_opencontrail_prepare_tests_steps_path = \ |
| 60 | pkg_resources.resource_filename( |
| 61 | __name__, 'templates/{0}/opencontrail.yaml'.format( |
| 62 | settings.LAB_CONFIG_NAME)) |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 63 | _default_sl_prepare_tests_steps_path = pkg_resources.resource_filename( |
| 64 | __name__, 'templates/{0}/sl.yaml'.format( |
| 65 | settings.LAB_CONFIG_NAME)) |
Tatyana Leontovich | 460f7df | 2017-11-13 15:45:06 +0200 | [diff] [blame] | 66 | _default_ceph_prepare_tests_steps_path = pkg_resources.resource_filename( |
| 67 | __name__, 'templates/{0}/ceph.yaml'.format( |
| 68 | settings.LAB_CONFIG_NAME)) |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 69 | _default_k8s_steps = pkg_resources.resource_filename( |
| 70 | __name__, 'templates/{0}/k8s.yaml'.format( |
| 71 | settings.LAB_CONFIG_NAME)) |
Vladimir Jigulin | 62bcf46 | 2018-05-28 18:17:01 +0400 | [diff] [blame] | 72 | _default_k8s_update_steps = pkg_resources.resource_filename( |
| 73 | __name__, 'templates/{0}/k8s-update.yaml'.format( |
| 74 | settings.LAB_CONFIG_NAME)) |
Dmitry Tyzhnenko | b864183 | 2017-11-07 17:02:47 +0200 | [diff] [blame] | 75 | _default_net_mgm = os.environ.get("NET_MGMT", "admin-pool01") |
Dmitry Tyzhnenko | 35413c0 | 2018-03-05 14:12:37 +0200 | [diff] [blame] | 76 | _default_configure_steps = pkg_resources.resource_filename( |
| 77 | __name__, 'templates/{0}/cfg01_configure.yaml'.format( |
| 78 | settings.LAB_CONFIG_NAME)) |
| 79 | # _default_cluster_maas_config = pkg_resources.resource_filename( |
| 80 | # __name__, 'templates/{0}/cluster_infra_maas.yml'.format( |
| 81 | # settings.LAB_CONFIG_NAME)) |
| 82 | _default_cluster_maas_config = 'cluster_infra_maas.yml' |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 83 | |
| 84 | hardware_opts = [ |
| 85 | ct.Cfg('manager', ct.String(), |
| 86 | help="Hardware manager name", default="devops"), |
| 87 | ct.Cfg('conf_path', ct.String(), |
| 88 | help="Hardware config file", default=_default_conf), |
| 89 | ct.Cfg('current_snapshot', ct.String(), |
| 90 | help="Latest environment status name", |
| 91 | default=ext.SNAPSHOT.hardware), |
| 92 | ] |
| 93 | |
| 94 | |
| 95 | underlay_opts = [ |
| 96 | ct.Cfg('ssh', ct.JSONList(), |
| 97 | help="""SSH Settings for Underlay: [{ |
| 98 | 'node_name': node1, |
Dennis Dmitriev | 83cc1d5 | 2018-11-09 15:35:30 +0200 | [diff] [blame] | 99 | 'minion_id': node1.local, |
Dennis Dmitriev | 23e5d19 | 2016-10-31 11:27:10 +0200 | [diff] [blame] | 100 | 'roles': ['salt-master', 'salt-minion', ], |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 101 | 'host': hostname, |
| 102 | 'login': login, |
| 103 | 'password': password, |
| 104 | 'address_pool': (optional), |
| 105 | 'port': (optional), |
| 106 | 'keys': [(optional)], |
| 107 | }, ...]""", default=[]), |
| 108 | ct.Cfg('roles', ct.JSONList(), |
| 109 | help="Node roles managed by underlay in the environment", |
Dennis Dmitriev | 53d3b77 | 2016-10-18 14:31:58 +0300 | [diff] [blame] | 110 | default=[ext.UNDERLAY_NODE_ROLES.salt_master, |
vrovachev | 99228d3 | 2017-06-08 19:46:10 +0400 | [diff] [blame] | 111 | ext.UNDERLAY_NODE_ROLES.salt_minion, |
Victor Ryzhenkin | 66d3937 | 2017-09-28 19:25:48 +0400 | [diff] [blame] | 112 | ext.UNDERLAY_NODE_ROLES.k8s_controller]), |
Dennis Dmitriev | 7b9538f | 2017-05-15 17:01:34 +0300 | [diff] [blame] | 113 | ct.Cfg('bootstrap_timeout', ct.Integer(), |
| 114 | help="Timeout of waiting SSH for nodes with specified roles", |
Dennis Dmitriev | 4558ee9 | 2018-01-31 08:14:08 -0400 | [diff] [blame] | 115 | default=600), |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 116 | ct.Cfg('nameservers', ct.JSONList(), |
| 117 | help="IP addresses of DNS servers", |
| 118 | default=[]), |
| 119 | ct.Cfg('upstream_dns_servers', ct.JSONList(), |
| 120 | help="IP addresses of upstream DNS servers (dnsmasq)", |
| 121 | default=[]), |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 122 | ct.Cfg('address_pools', ct.JSONDict(), |
| 123 | help="""Address pools (dynamically) allocated for the environment. |
| 124 | May be used to determine CIDR for a specific network from |
| 125 | tests or during the deployment process. |
| 126 | {'pool_name1': '<cidr>', 'pool_name2': '<cidr>', ...}""", |
| 127 | default={}), |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 128 | ct.Cfg('dhcp_ranges', ct.JSONDict(), |
| 129 | help="""DHCP ranges allocated for the address pools. |
| 130 | This is extended object comparing to 'address_pools'. |
| 131 | May be used to determine DHCP range start/end/gateway for a |
| 132 | specific network from tests or during the deployment |
| 133 | process. |
| 134 | {'pool_name1': {'cidr': 'n.n.n.n/m', |
| 135 | 'start': 'x.x.x.x', |
| 136 | 'end': 'y.y.y.y', |
| 137 | 'gateway': 'z.z.z.z'}, |
| 138 | 'pool_name2': {'cidr': 'n.n.n.n/m', |
| 139 | 'start': x.x.x.x, |
| 140 | 'end': 'y.y.y.y', |
| 141 | 'gateway': 'z.z.z.z'}, |
| 142 | ...}""", |
| 143 | default={}), |
Artem Panchenko | db0a97f | 2017-06-27 19:09:13 +0300 | [diff] [blame] | 144 | ct.Cfg('ssh_keys', ct.JSONList(), default=[], |
| 145 | help="SSH key pair(s) for root. If the option is left empty, " |
| 146 | "then a key pair will be generated automatically"), |
| 147 | ct.Cfg('ssh_key_file', ct.String(), default=os.path.abspath('./id_rsa'), |
| 148 | help='Path (local) to file with private key authorized on nodes'), |
Dmitry Tyzhnenko | b864183 | 2017-11-07 17:02:47 +0200 | [diff] [blame] | 149 | ct.Cfg('net_mgmt', ct.String(), default=_default_net_mgm) |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 150 | ] |
| 151 | |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 152 | |
| 153 | salt_deploy_opts = [ |
| 154 | ct.Cfg('salt_steps_path', ct.String(), |
| 155 | help="Path to YAML with steps to deploy salt", |
| 156 | default=_default_salt_steps), |
Dennis Dmitriev | 9dada8a | 2017-08-30 17:38:55 +0300 | [diff] [blame] | 157 | ct.Cfg('environment_template_dir', ct.String(), |
| 158 | help="Path to directory with Environment template and inventory", |
| 159 | default=_default_environment_template_dir), |
Dmitry Tyzhnenko | 8f6a63e | 2017-09-05 15:37:23 +0300 | [diff] [blame] | 160 | ct.Cfg('templates_dir', ct.String(), |
| 161 | help="Path to directory with templates", |
| 162 | default=_default_templates_dir), |
Dennis Dmitriev | 5bcbdc5 | 2018-03-23 18:05:10 +0200 | [diff] [blame] | 163 | ct.Cfg('salt_roles', ct.JSONList(), |
| 164 | help="Node roles to install salt-minions and manage by salt", |
| 165 | default=[ext.UNDERLAY_NODE_ROLES.salt_master, |
| 166 | ext.UNDERLAY_NODE_ROLES.salt_minion, |
| 167 | ext.UNDERLAY_NODE_ROLES.k8s_controller]), |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 168 | ] |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 169 | salt_opts = [ |
| 170 | ct.Cfg('salt_master_host', ct.IPAddress(), |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 171 | help="", default='0.0.0.0'), |
Dennis Dmitriev | 2d60c8e | 2017-05-12 18:34:01 +0300 | [diff] [blame] | 172 | ct.Cfg('salt_master_port', ct.String(), |
| 173 | help="", default='6969'), |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 174 | ] |
| 175 | |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 176 | core_deploy_opts = [ |
| 177 | ct.Cfg('core_steps_path', ct.String(), |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 178 | help="Path to YAML with steps to deploy common services", |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 179 | default=_default_core_steps), |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 180 | ] |
| 181 | |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 182 | core_opts = [ |
| 183 | ct.Cfg('core_installed', ct.Boolean(), |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 184 | help="", default=False), |
| 185 | ] |
| 186 | |
Dennis Dmitriev | eac3aab | 2017-07-12 16:36:41 +0300 | [diff] [blame] | 187 | oss_deploy_opts = [ |
| 188 | ct.Cfg('oss_steps_path', ct.String(), |
| 189 | help="Path to YAML with steps to deploy OSS Tools", |
| 190 | default=_default_oss_steps), |
| 191 | ] |
| 192 | |
| 193 | oss_opts = [ |
| 194 | ct.Cfg('oss_installed', ct.Boolean(), |
| 195 | help="", default=False), |
| 196 | ] |
| 197 | |
sgudz | b67ce73 | 2018-02-13 17:58:31 +0200 | [diff] [blame] | 198 | drivetrain_deploy_opts = [ |
| 199 | ct.Cfg('drivetrain_steps_path', ct.String(), |
| 200 | help="Path to YAML with steps to deploy Drivetrain", |
| 201 | default=_default_drivetrain_steps), |
| 202 | ] |
| 203 | |
| 204 | drivetrain_opts = [ |
| 205 | ct.Cfg('drivetrain_installed', ct.Boolean(), |
| 206 | help="", default=False), |
| 207 | ] |
| 208 | |
Dennis Dmitriev | f3f90a5 | 2017-08-10 14:37:05 +0300 | [diff] [blame] | 209 | decapod_deploy_opts = [ |
| 210 | ct.Cfg('decapod_steps_path', ct.String(), |
| 211 | help="Path to YAML with steps to deploy Ceph with Decapod", |
| 212 | default=_default_decapod_steps), |
| 213 | ] |
| 214 | |
| 215 | decapod_opts = [ |
| 216 | ct.Cfg('decapod_installed', ct.Boolean(), |
| 217 | help="", default=False), |
| 218 | ] |
| 219 | |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 220 | openstack_deploy_opts = [ |
| 221 | ct.Cfg('openstack_steps_path', ct.String(), |
| 222 | help="Path to YAML with steps to deploy openstack", |
| 223 | default=_default_openstack_steps), |
Tatyana Leontovich | 8dbc788 | 2018-08-29 13:11:16 +0300 | [diff] [blame] | 224 | ct.Cfg('openstack_resources_steps_path', ct.String(), |
| 225 | help="Path to YAML with steps to deploy openstack", |
| 226 | default=_default_openstack_resources_steps), |
Tatyana Leontovich | c72604d | 2018-01-04 17:58:00 +0200 | [diff] [blame] | 227 | ct.Cfg('horizon_host', ct.IPAddress(), |
| 228 | help="", default='0.0.0.0'), |
| 229 | ct.Cfg('horizon_port', ct.String(), |
| 230 | help="", default='5000'), |
| 231 | ct.Cfg('horizon_user', ct.String(), |
| 232 | help="", default='admin'), |
| 233 | ct.Cfg('horizon_password', ct.String(), |
| 234 | help="", default='workshop'), |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 235 | ] |
| 236 | openstack_opts = [ |
Dennis Dmitriev | 2cbf235 | 2016-11-11 15:34:21 +0200 | [diff] [blame] | 237 | ct.Cfg('openstack_installed', ct.Boolean(), |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 238 | help="", default=False), |
Dennis Dmitriev | 2cbf235 | 2016-11-11 15:34:21 +0200 | [diff] [blame] | 239 | ct.Cfg('openstack_keystone_endpoint', ct.String(), |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 240 | help="", default=''), |
Tatyana Leontovich | c08a54b | 2018-04-19 02:21:25 +0300 | [diff] [blame] | 241 | ct.Cfg('horizon_check', ct.Boolean(), |
Tatyana Leontovich | 6970071 | 2018-04-23 12:26:57 +0300 | [diff] [blame] | 242 | help="", default=False), |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 243 | ] |
| 244 | |
Dennis Dmitriev | 2cbf235 | 2016-11-11 15:34:21 +0200 | [diff] [blame] | 245 | opencontrail_opts = [ |
| 246 | ct.Cfg('opencontrail_tags', ct.String(), |
| 247 | help="", default=''), |
| 248 | ct.Cfg('opencontrail_features', ct.String(), |
| 249 | help="", default=''), |
| 250 | ct.Cfg('opencontrail_prepare_tests_steps_path', ct.String(), |
| 251 | help="Path to YAML with steps to prepare contrail-tests", |
| 252 | default=_default_opencontrail_prepare_tests_steps_path), |
| 253 | ] |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 254 | |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 255 | sl_deploy_opts = [ |
| 256 | ct.Cfg('sl_steps_path', ct.String(), |
| 257 | help="Path to YAML with steps to deploy sl", |
| 258 | default=_default_sl_prepare_tests_steps_path), |
Tatyana Leontovich | f00b234 | 2017-07-04 18:26:25 +0300 | [diff] [blame] | 259 | ct.Cfg('docker_image_alertmanager', ct.String(), |
Dennis Dmitriev | 257a938 | 2018-02-15 04:00:46 +0200 | [diff] [blame] | 260 | default='{0}/openstack-docker/alertmanager:{1}'.format( |
| 261 | settings.DOCKER_REGISTRY, settings.DOCKER_IMAGES_SL_TAG)), |
Dmitry Kalashnik | 3eee60b | 2018-05-29 17:19:31 +0400 | [diff] [blame] | 262 | ct.Cfg('docker_image_alerta', ct.String(), |
| 263 | default='{0}/mirantis/external/alerta-web:{1}'.format( |
| 264 | settings.DOCKER_REGISTRY, settings.DOCKER_IMAGES_SL_TAG)), |
Tatyana Leontovich | f00b234 | 2017-07-04 18:26:25 +0300 | [diff] [blame] | 265 | ct.Cfg('docker_image_pushgateway', ct.String(), |
Dennis Dmitriev | 257a938 | 2018-02-15 04:00:46 +0200 | [diff] [blame] | 266 | default='{0}/openstack-docker/pushgateway:{1}'.format( |
| 267 | settings.DOCKER_REGISTRY, settings.DOCKER_IMAGES_SL_TAG)), |
Tatyana Leontovich | f00b234 | 2017-07-04 18:26:25 +0300 | [diff] [blame] | 268 | ct.Cfg('docker_image_prometheus', ct.String(), |
Dennis Dmitriev | 257a938 | 2018-02-15 04:00:46 +0200 | [diff] [blame] | 269 | default='{0}/openstack-docker/prometheus:{1}'.format( |
| 270 | settings.DOCKER_REGISTRY, settings.DOCKER_IMAGES_SL_TAG)), |
Tatyana Leontovich | f00b234 | 2017-07-04 18:26:25 +0300 | [diff] [blame] | 271 | ct.Cfg('docker_image_remote_agent', ct.String(), |
Dennis Dmitriev | 257a938 | 2018-02-15 04:00:46 +0200 | [diff] [blame] | 272 | default='{0}/openstack-docker/telegraf:{1}'.format( |
| 273 | settings.DOCKER_REGISTRY, settings.DOCKER_IMAGES_SL_TAG)), |
Tatyana Leontovich | f00b234 | 2017-07-04 18:26:25 +0300 | [diff] [blame] | 274 | ct.Cfg('docker_image_remote_storage_adapter', ct.String(), |
Dennis Dmitriev | 257a938 | 2018-02-15 04:00:46 +0200 | [diff] [blame] | 275 | default='{0}/openstack-docker/remote_storage_adapter:{1}'.format( |
| 276 | settings.DOCKER_REGISTRY, settings.DOCKER_IMAGES_SL_TAG)), |
| 277 | ct.Cfg('docker_image_prometheus_relay', ct.String(), |
| 278 | default='{0}/openstack-docker/prometheus_relay:{1}'.format( |
| 279 | settings.DOCKER_REGISTRY, settings.DOCKER_IMAGES_SL_TAG)), |
| 280 | ct.Cfg('docker_image_grafana', ct.String(), |
| 281 | default='{0}/mirantis/external/grafana:{1}'.format( |
| 282 | settings.DOCKER_REGISTRY, settings.DOCKER_IMAGES_SL_TAG)), |
Dennis Dmitriev | 86f63e8 | 2017-11-09 00:07:45 +0200 | [diff] [blame] | 283 | # SalesForce connection options for pushkin |
Dennis Dmitriev | ce5ed8b | 2017-11-09 00:44:19 +0200 | [diff] [blame] | 284 | ct.Cfg('sfdc_sandbox_enabled', ct.String(), default='False'), |
Dennis Dmitriev | 86f63e8 | 2017-11-09 00:07:45 +0200 | [diff] [blame] | 285 | ct.Cfg('sfdc_auth_url', ct.String(), default=''), |
| 286 | ct.Cfg('sfdc_username', ct.String(), default=''), |
| 287 | ct.Cfg('sfdc_password', ct.String(), default=''), |
| 288 | ct.Cfg('sfdc_consumer_key', ct.String(), default=''), |
| 289 | ct.Cfg('sfdc_consumer_secret', ct.String(), default=''), |
| 290 | ct.Cfg('sfdc_organization_id', ct.String(), default=''), |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 291 | ] |
Tatyana Leontovich | f00b234 | 2017-07-04 18:26:25 +0300 | [diff] [blame] | 292 | |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 293 | sl_opts = [ |
Dennis Dmitriev | fde667f | 2018-07-23 16:26:50 +0300 | [diff] [blame] | 294 | ct.Cfg('stacklight_installed', ct.Boolean(), |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 295 | help="", default=False), |
sgudz | bf4de57 | 2017-11-23 14:37:01 +0200 | [diff] [blame] | 296 | ct.Cfg('sl_version', ct.String(), |
| 297 | help="StackLight version. Could be 1 or 2", default=''), |
Tatyana Leontovich | 09b7b01 | 2017-07-10 12:53:45 +0300 | [diff] [blame] | 298 | ct.Cfg('sl_vip_host', ct.IPAddress(), |
| 299 | help="Vip address for SL services", default='0.0.0.0'), |
| 300 | ct.Cfg('sl_prometheus_port', ct.String(), |
| 301 | help="Prometheus port", default='15010'), |
| 302 | ct.Cfg('sl_prometheus_proto', ct.String(), |
| 303 | help="Proemtheus protocol", default='http'), |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 304 | ] |
| 305 | |
Tatyana Leontovich | 460f7df | 2017-11-13 15:45:06 +0200 | [diff] [blame] | 306 | ceph_deploy_opts = [ |
| 307 | ct.Cfg('ceph_steps_path', ct.String(), |
| 308 | help="Path to YAML with steps to deploy sl", |
Tatyana Leontovich | a754ce5 | 2017-11-13 16:46:43 +0200 | [diff] [blame] | 309 | default=_default_ceph_prepare_tests_steps_path), |
Tatyana Leontovich | 460f7df | 2017-11-13 15:45:06 +0200 | [diff] [blame] | 310 | ] |
| 311 | |
| 312 | ceph_opts = [ |
Tatyana Leontovich | a754ce5 | 2017-11-13 16:46:43 +0200 | [diff] [blame] | 313 | ct.Cfg('ceph_installed', ct.Boolean(), |
Tatyana Leontovich | 460f7df | 2017-11-13 15:45:06 +0200 | [diff] [blame] | 314 | help="", default=False), |
Tatyana Leontovich | 460f7df | 2017-11-13 15:45:06 +0200 | [diff] [blame] | 315 | ] |
| 316 | |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 317 | k8s_deploy_opts = [ |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 318 | ct.Cfg('k8s_steps_path', ct.String(), |
| 319 | help="Path to YAML with steps to deploy Kubernetes", |
| 320 | default=_default_k8s_steps), |
Vladimir Jigulin | 62bcf46 | 2018-05-28 18:17:01 +0400 | [diff] [blame] | 321 | ct.Cfg('k8s_update_steps_path', ct.String(), |
| 322 | help="Path to YAML with steps to update Kubernetes", |
| 323 | default=_default_k8s_update_steps), |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 324 | ct.Cfg('kubernetes_admin_user', ct.String(), default='admin'), |
| 325 | ct.Cfg('kubernetes_admin_password', ct.String(), |
| 326 | default='sbPfel23ZigJF3Bm'), |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 327 | ct.Cfg('kubernetes_docker_package', ct.String(), default=''), |
Victor Ryzhenkin | e784bbf | 2018-12-21 03:58:00 +0400 | [diff] [blame] | 328 | ct.Cfg('kubernetes_hyperkube_source', ct.String(), |
| 329 | default='{}/mirantis/kubernetes/hyperkube-binaries/' |
| 330 | 'hyperkube_v1.12.3-2_1544133573591'.format( |
| 331 | settings.BINARY_REGISTRY)), |
| 332 | ct.Cfg('kubernetes_hyperkube_source_hash', ct.String(), |
| 333 | default='md5=fc23eaf3ba63d9ed9d141f465f584012'), |
Victor Ryzhenkin | 2687fa1 | 2018-05-24 16:28:17 +0400 | [diff] [blame] | 334 | ct.Cfg('kubernetes_pause_image', ct.String(), |
Victor Ryzhenkin | e784bbf | 2018-12-21 03:58:00 +0400 | [diff] [blame] | 335 | default='{}/mirantis/kubernetes/pause-amd64:v1.12.3-2'.format( |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 336 | settings.DOCKER_REGISTRY)), |
| 337 | ct.Cfg('kubernetes_calico_image', ct.String(), |
Aleksei Kasatkin | 00fd9e0 | 2019-01-09 11:05:35 +0100 | [diff] [blame] | 338 | default='{}/mirantis/projectcalico/calico/node:v3.3.2'.format( |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 339 | settings.DOCKER_REGISTRY)), |
Victor Ryzhenkin | 53f1b49 | 2018-05-09 17:30:17 +0400 | [diff] [blame] | 340 | ct.Cfg('kubernetes_calico_calicoctl_image', ct.String(), |
Aleksei Kasatkin | 00fd9e0 | 2019-01-09 11:05:35 +0100 | [diff] [blame] | 341 | default='{}/mirantis/projectcalico/calico/ctl:v3.3.2'.format( |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 342 | settings.DOCKER_REGISTRY)), |
| 343 | ct.Cfg('kubernetes_calico_cni_image', ct.String(), |
Aleksei Kasatkin | 00fd9e0 | 2019-01-09 11:05:35 +0100 | [diff] [blame] | 344 | default='{}/mirantis/projectcalico/calico/cni:v3.3.2'.format( |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 345 | settings.DOCKER_REGISTRY)), |
Aleksei Kasatkin | 1d252f0 | 2018-08-29 13:15:58 +0200 | [diff] [blame] | 346 | ct.Cfg('kubernetes_calico_kube_controllers_image', ct.String(), |
| 347 | default='{}/mirantis/projectcalico/calico/kube-controllers:' |
Aleksei Kasatkin | 00fd9e0 | 2019-01-09 11:05:35 +0100 | [diff] [blame] | 348 | 'v3.3.2'.format(settings.DOCKER_REGISTRY)), |
| 349 | ct.Cfg('kubernetes_calico_calicoctl_source', ct.String(), |
| 350 | default='{}/mirantis/projectcalico/calicoctl/' |
| 351 | 'calicoctl-v3.3.2'.format( |
| 352 | settings.BINARY_REGISTRY)), |
| 353 | ct.Cfg('kubernetes_calico_calicoctl_source_hash', ct.String(), |
| 354 | default='md5=bb38517fdd6b8bb7c130ae7550a9d335'), |
| 355 | ct.Cfg('kubernetes_calico_birdcl_source', ct.String(), |
| 356 | default='{}/mirantis/projectcalico/bird/' |
| 357 | 'birdcl-v0.3.3'.format( |
| 358 | settings.BINARY_REGISTRY)), |
| 359 | ct.Cfg('kubernetes_calico_birdcl_source_hash', ct.String(), |
| 360 | default='md5=0327442efd2592ddce449b66c5d0fc9d'), |
| 361 | ct.Cfg('kubernetes_calico_cni_source', ct.String(), |
| 362 | default='{}/mirantis/projectcalico/cni-plugin/' |
| 363 | 'calico-v3.3.2'.format( |
| 364 | settings.BINARY_REGISTRY)), |
| 365 | ct.Cfg('kubernetes_calico_cni_source_hash', ct.String(), |
| 366 | default='md5=2544bc1865c1451cac7a61264c25a2cb'), |
| 367 | ct.Cfg('kubernetes_calico_cni_ipam_source', ct.String(), |
| 368 | default='{}/mirantis/projectcalico/cni-plugin/' |
| 369 | 'calico-ipam-v3.3.2'.format( |
| 370 | settings.BINARY_REGISTRY)), |
| 371 | ct.Cfg('kubernetes_calico_cni_ipam_source_hash', ct.String(), |
| 372 | default='md5=b22623eeea3b29ba8ec071d859ac7055'), |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 373 | ct.Cfg('kubernetes_netchecker_enabled', ct.Boolean(), |
| 374 | help="", default=True), |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 375 | ct.Cfg('kubernetes_netchecker_agent_image', ct.String(), |
Aleksei Kasatkin | 593596f | 2018-05-14 11:02:19 +0200 | [diff] [blame] | 376 | default='mirantis/k8s-netchecker-agent:v1.2.2'), |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 377 | ct.Cfg('kubernetes_netchecker_server_image', ct.String(), |
Aleksei Kasatkin | 593596f | 2018-05-14 11:02:19 +0200 | [diff] [blame] | 378 | default='mirantis/k8s-netchecker-server:v1.2.2'), |
Artem Panchenko | 501e67e | 2017-06-14 14:59:18 +0300 | [diff] [blame] | 379 | ct.Cfg('kubernetes_calico_policy_enabled', ct.Boolean(), |
| 380 | help="", default=False), |
Artem Panchenko | 501e67e | 2017-06-14 14:59:18 +0300 | [diff] [blame] | 381 | ct.Cfg('kubernetes_helm_enabled', ct.Boolean(), |
Tatyana Leontovich | 038dc7d | 2017-09-22 16:25:59 +0300 | [diff] [blame] | 382 | help="", default=False), |
Victor Ryzhenkin | 0bf0bb0 | 2017-07-06 18:57:05 +0400 | [diff] [blame] | 383 | ct.Cfg('kubernetes_virtlet_enabled', ct.Boolean(), |
Tatyana Leontovich | 038dc7d | 2017-09-22 16:25:59 +0300 | [diff] [blame] | 384 | help="", default=False), |
Victor Ryzhenkin | 0bf0bb0 | 2017-07-06 18:57:05 +0400 | [diff] [blame] | 385 | ct.Cfg('kubernetes_virtlet_image', ct.String(), |
Victor Ryzhenkin | 3bcb074 | 2018-10-16 15:55:04 +0400 | [diff] [blame] | 386 | help="", default='mirantis/virtlet:v1.4.1'), |
Victor Ryzhenkin | 5902ae6 | 2018-09-11 20:34:54 +0400 | [diff] [blame] | 387 | ct.Cfg('kubernetes_dns', ct.Boolean(), |
| 388 | help="", default=True), |
Victor Ryzhenkin | 14354ac | 2017-09-27 17:42:30 +0400 | [diff] [blame] | 389 | ct.Cfg('kubernetes_externaldns_enabled', ct.Boolean(), |
| 390 | help="", default=False), |
| 391 | ct.Cfg('kubernetes_externaldns_image', ct.String(), |
Victor Ryzhenkin | 3bcb074 | 2018-10-16 15:55:04 +0400 | [diff] [blame] | 392 | help="", default='{}/mirantis/external-dns/external-dns:' |
| 393 | 'v0.5.6-2'.format(settings.DOCKER_REGISTRY)), |
Victor Ryzhenkin | 14354ac | 2017-09-27 17:42:30 +0400 | [diff] [blame] | 394 | ct.Cfg('kubernetes_externaldns_provider', ct.String(), |
| 395 | help="", default='coredns'), |
| 396 | ct.Cfg('kubernetes_coredns_enabled', ct.Boolean(), |
Victor Ryzhenkin | 3bcb074 | 2018-10-16 15:55:04 +0400 | [diff] [blame] | 397 | help="", default=True), |
Vladimir Jigulin | a6b018b | 2018-07-18 15:19:01 +0400 | [diff] [blame] | 398 | ct.Cfg('kubernetes_metallb_enabled', ct.Boolean(), |
| 399 | help="", default=False), |
Vladimir Jigulin | 5775bbb | 2018-10-03 10:34:54 +0400 | [diff] [blame] | 400 | ct.Cfg('kubernetes_ingressnginx_enabled', ct.Boolean(), |
| 401 | help="", default=False), |
Victor Ryzhenkin | 2a5806e | 2017-12-18 20:23:53 +0400 | [diff] [blame] | 402 | ct.Cfg('kubelet_fail_on_swap', ct.Boolean(), |
Victor Ryzhenkin | 14354ac | 2017-09-27 17:42:30 +0400 | [diff] [blame] | 403 | help="", default=False) |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 404 | ] |
| 405 | |
| 406 | k8s_opts = [ |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 407 | ct.Cfg('k8s_installed', ct.Boolean(), |
| 408 | help="", default=False), |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 409 | ct.Cfg('kube_host', ct.IPAddress(), |
| 410 | help="", default='0.0.0.0'), |
| 411 | ct.Cfg('kube_apiserver_port', ct.Integer(), |
| 412 | help="", default=443), |
vrovachev | a9d0833 | 2017-06-22 20:01:59 +0400 | [diff] [blame] | 413 | ct.Cfg("k8s_conformance_run", ct.Boolean(), |
| 414 | default=False), |
Victor Ryzhenkin | 8ff3c3f | 2018-01-17 19:37:05 +0400 | [diff] [blame] | 415 | ct.Cfg("run_extended_virtlet_conformance", ct.Boolean(), |
| 416 | default=False), |
vrovachev | a9d0833 | 2017-06-22 20:01:59 +0400 | [diff] [blame] | 417 | ct.Cfg('k8s_conformance_image', ct.String(), |
Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 418 | default='docker-prod-virtual.docker.mirantis.net/mirantis/' |
Victor Ryzhenkin | 3bcb074 | 2018-10-16 15:55:04 +0400 | [diff] [blame] | 419 | 'kubernetes/k8s-conformance:v1.11.3-2'), |
Vladimir Jigulin | 62bcf46 | 2018-05-28 18:17:01 +0400 | [diff] [blame] | 420 | ct.Cfg('k8s_update_chain', ct.String(), |
Victor Ryzhenkin | 3bcb074 | 2018-10-16 15:55:04 +0400 | [diff] [blame] | 421 | default='v1.9.8-4 v1.10.4-4 v1.11.3-2') |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 422 | ] |
| 423 | |
Dmitry Tyzhnenko | 35413c0 | 2018-03-05 14:12:37 +0200 | [diff] [blame] | 424 | day1_cfg_config_opts = [ |
| 425 | ct.Cfg('configure_steps_path', ct.String(), |
| 426 | help="Path to YAML with steps to config cfg01 node", |
| 427 | default=_default_configure_steps), |
| 428 | ct.Cfg('environment_template_dir', ct.String(), |
| 429 | help="Path to directory with Environment template and inventory", |
| 430 | default=_default_environment_template_dir), |
| 431 | ct.Cfg('templates_dir', ct.String(), |
| 432 | help="Path to directory with templates", |
| 433 | default=_default_templates_dir), |
| 434 | ct.Cfg('cluster_maas_config', ct.String(), |
| 435 | help="Path to maas class yaml file for cfg node", |
| 436 | default=_default_cluster_maas_config), |
| 437 | ct.Cfg('maas_machines_macs', ct.JSONDict(), |
| 438 | help="""MAC of machines interfaces for maas config: |
| 439 | 'parameters': { |
| 440 | 'maas' : { |
| 441 | 'region' : { |
| 442 | 'machines': { |
| 443 | 'ctl01': { |
| 444 | 'interface': { |
| 445 | 'mac': 'aa:bb:cc:dd:ee:ff' |
| 446 | } |
| 447 | } |
| 448 | '...': { |
| 449 | 'interface': { |
| 450 | 'mac': 'aa:bb:cc:dd:ee:ff' |
| 451 | } |
| 452 | } |
| 453 | }}}}""", default={}), |
| 454 | ] |
| 455 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 456 | _group_opts = [ |
| 457 | ('hardware', hardware_opts), |
| 458 | ('underlay', underlay_opts), |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 459 | ('salt_deploy', salt_deploy_opts), |
| 460 | ('salt', salt_opts), |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 461 | ('core_deploy', core_deploy_opts), |
| 462 | ('core', core_opts), |
Dennis Dmitriev | eac3aab | 2017-07-12 16:36:41 +0300 | [diff] [blame] | 463 | ('oss_deploy', oss_deploy_opts), |
| 464 | ('oss', oss_opts), |
sgudz | b67ce73 | 2018-02-13 17:58:31 +0200 | [diff] [blame] | 465 | ('drivetrain_deploy', drivetrain_deploy_opts), |
| 466 | ('drivetrain', drivetrain_opts), |
Dennis Dmitriev | f3f90a5 | 2017-08-10 14:37:05 +0300 | [diff] [blame] | 467 | ('decapod_deploy', decapod_deploy_opts), |
| 468 | ('decapod', decapod_opts), |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 469 | ('openstack_deploy', openstack_deploy_opts), |
| 470 | ('openstack', openstack_opts), |
Dennis Dmitriev | 2cbf235 | 2016-11-11 15:34:21 +0200 | [diff] [blame] | 471 | ('opencontrail', opencontrail_opts), |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 472 | ('stack_light', sl_opts), |
| 473 | ('sl_deploy', sl_deploy_opts), |
Tatyana Leontovich | a754ce5 | 2017-11-13 16:46:43 +0200 | [diff] [blame] | 474 | ('ceph', ceph_opts), |
| 475 | ('ceph_deploy', ceph_deploy_opts), |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 476 | ('k8s_deploy', k8s_deploy_opts), |
| 477 | ('k8s', k8s_opts), |
Dmitry Tyzhnenko | 35413c0 | 2018-03-05 14:12:37 +0200 | [diff] [blame] | 478 | ('day1_cfg_config', day1_cfg_config_opts), |
| 479 | ('day1_underlay', underlay_opts), |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 480 | ] |
| 481 | |
| 482 | |
| 483 | def register_opts(config): |
| 484 | config.register_group(cfg.OptGroup(name='hardware', |
| 485 | title="Hardware settings", help="")) |
| 486 | config.register_opts(group='hardware', opts=hardware_opts) |
| 487 | |
| 488 | config.register_group(cfg.OptGroup(name='underlay', |
| 489 | title="Underlay configuration", help="")) |
| 490 | config.register_opts(group='underlay', opts=underlay_opts) |
| 491 | |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 492 | config.register_group(cfg.OptGroup(name='salt_deploy', |
| 493 | title="salt deploy configuration", help="")) |
| 494 | config.register_opts(group='salt_deploy', opts=salt_deploy_opts) |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 495 | |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 496 | config.register_group(cfg.OptGroup(name='salt', |
| 497 | title="salt config and credentials", help="")) |
| 498 | config.register_opts(group='salt', opts=salt_opts) |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 499 | |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 500 | config.register_group(cfg.OptGroup(name='core', |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 501 | title="Common services for Openstack", help="")) |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 502 | config.register_opts(group='core', opts=core_opts) |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 503 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 504 | config.register_group( |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 505 | cfg.OptGroup(name='core_deploy', |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 506 | title="Common services for Openstack deploy config", |
| 507 | help="")) |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 508 | config.register_opts(group='core_deploy', |
| 509 | opts=core_deploy_opts) |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 510 | |
Dennis Dmitriev | eac3aab | 2017-07-12 16:36:41 +0300 | [diff] [blame] | 511 | config.register_group(cfg.OptGroup(name='oss', |
| 512 | title="Operational Support System Tools", help="")) |
| 513 | config.register_opts(group='oss', opts=oss_opts) |
| 514 | |
| 515 | config.register_group(cfg.OptGroup(name='oss_deploy', |
| 516 | title="OSS deploy config", help="")) |
| 517 | config.register_opts(group='oss_deploy', |
| 518 | opts=oss_deploy_opts) |
| 519 | |
sgudz | b67ce73 | 2018-02-13 17:58:31 +0200 | [diff] [blame] | 520 | config.register_group(cfg.OptGroup(name='drivetrain', |
| 521 | title="Drivetrain Tools", help="")) |
| 522 | config.register_opts(group='drivetrain', opts=drivetrain_opts) |
| 523 | |
| 524 | config.register_group(cfg.OptGroup(name='drivetrain_deploy', |
| 525 | title="Drivetrain deploy config", help="")) |
| 526 | config.register_opts(group='drivetrain_deploy', |
| 527 | opts=drivetrain_deploy_opts) |
| 528 | |
Dennis Dmitriev | f3f90a5 | 2017-08-10 14:37:05 +0300 | [diff] [blame] | 529 | config.register_group(cfg.OptGroup(name='decapod', |
| 530 | title="Decapod options for Ceph", help="")) |
| 531 | config.register_opts(group='decapod', opts=decapod_opts) |
| 532 | |
| 533 | config.register_group(cfg.OptGroup(name='decapod_deploy', |
| 534 | title="Decapod deploy config", help="")) |
| 535 | config.register_opts(group='decapod_deploy', |
| 536 | opts=decapod_deploy_opts) |
| 537 | |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 538 | config.register_group(cfg.OptGroup(name='openstack', |
| 539 | title="Openstack config and credentials", help="")) |
| 540 | config.register_opts(group='openstack', opts=openstack_opts) |
| 541 | |
| 542 | config.register_group( |
| 543 | cfg.OptGroup(name='openstack_deploy', |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 544 | title="Openstack deploy config and credentials", |
| 545 | help="")) |
Dennis Dmitriev | 6860ba6 | 2016-11-01 21:43:46 +0200 | [diff] [blame] | 546 | config.register_opts(group='openstack_deploy', opts=openstack_deploy_opts) |
Dennis Dmitriev | 2cbf235 | 2016-11-11 15:34:21 +0200 | [diff] [blame] | 547 | |
| 548 | config.register_group(cfg.OptGroup(name='opencontrail', |
| 549 | title="Options for Juniper contrail-tests", help="")) |
| 550 | config.register_opts(group='opencontrail', opts=opencontrail_opts) |
Dmitry Tyzhnenko | 8f6a63e | 2017-09-05 15:37:23 +0300 | [diff] [blame] | 551 | config.register_group( |
| 552 | cfg.OptGroup(name='stack_light', |
| 553 | title="StackLight config and credentials", help="")) |
Tatyana Leontovich | 5acc82a | 2017-05-23 15:41:35 +0300 | [diff] [blame] | 554 | config.register_opts(group='stack_light', opts=sl_opts) |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 555 | config.register_group( |
| 556 | cfg.OptGroup(name='sl_deploy', |
Dennis Dmitriev | f3f90a5 | 2017-08-10 14:37:05 +0300 | [diff] [blame] | 557 | title="SL deploy config and credentials", |
| 558 | help="")) |
Tatyana Leontovich | c8b8ca2 | 2017-05-19 13:37:05 +0300 | [diff] [blame] | 559 | config.register_opts(group='sl_deploy', opts=sl_deploy_opts) |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 560 | |
| 561 | config.register_group(cfg.OptGroup(name='k8s_deploy', |
| 562 | title="K8s deploy configuration")) |
| 563 | config.register_opts(group='k8s_deploy', opts=k8s_deploy_opts) |
| 564 | |
| 565 | config.register_group(cfg.OptGroup(name='k8s', |
| 566 | title="K8s config and credentials")) |
| 567 | config.register_opts(group='k8s', opts=k8s_opts) |
Tatyana Leontovich | a754ce5 | 2017-11-13 16:46:43 +0200 | [diff] [blame] | 568 | config.register_group(cfg.OptGroup(name='ceph', |
| 569 | title="ceph config", help="")) |
| 570 | config.register_opts(group='ceph', opts=ceph_opts) |
| 571 | |
| 572 | config.register_group( |
| 573 | cfg.OptGroup(name='ceph_deploy', |
| 574 | title="Ceph deploy config ", |
| 575 | help="")) |
| 576 | config.register_opts(group='ceph_deploy', opts=ceph_deploy_opts) |
| 577 | |
Dmitry Tyzhnenko | 35413c0 | 2018-03-05 14:12:37 +0200 | [diff] [blame] | 578 | config.register_group(cfg.OptGroup(name='day1_cfg_config', |
| 579 | title="Day01 config node configuration", help="")) |
| 580 | config.register_opts(group='day1_cfg_config', opts=day1_cfg_config_opts) |
| 581 | |
| 582 | config.register_group(cfg.OptGroup(name='day1_underlay', |
| 583 | title="Day01 underlay configuration", help="")) |
| 584 | config.register_opts(group='day1_underlay', opts=underlay_opts) |
| 585 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 586 | return config |
| 587 | |
| 588 | |
| 589 | def load_config(config_files): |
| 590 | config = cfg.CONF |
| 591 | register_opts(config) |
| 592 | config(args=[], default_config_files=config_files) |
| 593 | return config |
| 594 | |
| 595 | |
| 596 | def reload_snapshot_config(config, test_config_path): |
| 597 | """Reset config to the state from test_config file""" |
| 598 | config(args=[], default_config_files=[test_config_path]) |
| 599 | return config |
| 600 | |
| 601 | |
| 602 | def list_opts(): |
| 603 | """Return a list of oslo.config options available in the tcp_tests. |
| 604 | """ |
| 605 | return [(group, copy.deepcopy(opts)) for group, opts in _group_opts] |
| 606 | |
| 607 | |
| 608 | def list_current_opts(config): |
| 609 | """Return a list of oslo.config options available in the tcp_tests. |
| 610 | """ |
| 611 | result_opts = [] |
| 612 | for group, opts in _group_opts: |
| 613 | current_opts = copy.deepcopy(opts) |
| 614 | for opt in current_opts: |
| 615 | if hasattr(config, group): |
| 616 | if hasattr(config[group], opt.name): |
| 617 | opt.default = getattr(config[group], opt.name) |
| 618 | result_opts.append((group, current_opts)) |
| 619 | return result_opts |
| 620 | |
| 621 | |
| 622 | def save_config(config, snapshot_name, env_name=None): |
| 623 | if env_name is None: |
| 624 | env_name = 'config' |
| 625 | test_config_path = os.path.join( |
| 626 | settings.LOGS_DIR, '{0}_{1}.ini'.format(env_name, snapshot_name)) |
| 627 | |
| 628 | with open(test_config_path, 'w') as output_file: |
| 629 | formatter = generator._OptFormatter(output_file=output_file) |
| 630 | for group, opts in list_current_opts(config): |
| 631 | formatter.format_group(group) |
| 632 | for opt in opts: |
| 633 | formatter.format(opt, group, minimal=True) |
| 634 | formatter.write('\n') |
| 635 | formatter.write('\n') |