| # |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you 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. |
| # |
| |
| {% set database = hostvars[inventory_hostname]["database"] %} |
| {% set storage = database['type'] %} |
| |
| {% if storage and (storage | length) %} |
| SW_STORAGE={{ storage | regex_replace('^rds_', '')}} |
| {% endif %} |
| |
| {% if "postgresql" in storage %} |
| SW_JDBC_URL=jdbc:postgresql://{{ database["host"] }}:{{ database["port"] }}/{{ database["name"] }} |
| SW_DATA_SOURCE_USER={{ database['user'] }} |
| SW_DATA_SOURCE_PASSWORD={{ database['password'] }} |
| {% elif "elasticsearch" in storage %} |
| SW_STORAGE_ES_CLUSTER_NODES={{ database["host"] }} |
| SW_STORAGE_ES_HTTP_PROTOCOL=https |
| {% endif %} |
| |
| {% for key, value in skywalking_oap_environment.items() %} |
| {{ key }}="{{ value }}" |
| {% endfor %} |
| |