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