diff --git a/ansible/group_vars/common.yml b/ansible/group_vars/common.yml index 58d1fe3b4..37b801153 100644 --- a/ansible/group_vars/common.yml +++ b/ansible/group_vars/common.yml @@ -27,11 +27,11 @@ host_ip: 127.0.0.1 # This field indicates which project should be deploy # 'hotpot', 'gelato' or 'all' -deploy_project: all +deploy_project: telemetry # This field indicates which way user prefers to install, currently support # 'repository', 'release' and 'container' -install_from: release +install_from: repository # These fields below will specify the tag based on install_from type repo_branch: master release_version: v0.10.0 diff --git a/ansible/group_vars/osdsdock.yml b/ansible/group_vars/osdsdock.yml index c308d5d3c..e8aee71c0 100644 --- a/ansible/group_vars/osdsdock.yml +++ b/ansible/group_vars/osdsdock.yml @@ -25,7 +25,7 @@ dummy: # Change it according to your backend, currently support 'lvm', 'ceph', 'cinder', 'nfs', 'netapp_ontap_san' # DISABLE OR COMMENT "enabled_backends: lvm" IF YOU WANT TO INSTALL DIFFERENT BACKENDS ON MULTI-NODES AND mention it in "local.hosts" file # Comment this part if you want to use different backends on different nodes -enabled_backends: lvm,nfs #For Multi-backend add backends here, for eg. enabled_backends: lvm,ceph,cinder,nfs +enabled_backends: lvm #For Multi-backend add backends here, for eg. enabled_backends: lvm,ceph,cinder,nfs # Change it according to your node type (host or target), currently support # 'provisioner', 'attacher' diff --git a/ansible/group_vars/telemetry.yml b/ansible/group_vars/telemetry.yml index 64bfd1e3c..d774cd179 100644 --- a/ansible/group_vars/telemetry.yml +++ b/ansible/group_vars/telemetry.yml @@ -20,9 +20,30 @@ dummy: ########### # GENERAL # ########### +apiserver_endpoint: "{{ host_ip }}:50040" +controller_endpoint: "{{ host_ip }}:50049" -# Do you need to install or clean up telemetry tools? -enable_telemetry_tools: false + +# These fields are NOT suggested to be modified +telemetry_work_dir: /opt/opensds-telemetry-linux-amd64 +opensds_config_dir: /etc/opensds +opensds_driver_config_dir: "{{ opensds_config_dir }}/driver" +opensds_log_dir: /var/log/opensds +apiserver_log_file: "{{ opensds_log_dir }}/osdsapiserver.log" +controller_log_file: "{{ opensds_log_dir }}/osdslet.log" +dock_log_file: "{{ opensds_log_dir }}/osdsdock.log" + + +############## +# REPOSITORY # +############## + +# If user specifies intalling from repository, then he can choose the specific +# repository branch +telemetry_repo_branch: "{{ repo_branch }}" + +# These fields are NOT suggested to be modified +telemetry_remote_url: https://github.com/nguptaopensds/telemetry.git # Grafana Repository config grafana_repositroy: "deb https://packages.grafana.com/oss/deb stable main" @@ -50,4 +71,3 @@ kafka_endpoint: '{{ host_ip }}:9092' kafka_topic: metrics opensds_conf_file: /etc/opensds/opensds.conf -telemetry_work_dir: /opt/opensds-telemetry-linux-amd64 diff --git a/ansible/roles/osdsdock/scenarios/lvm.yml b/ansible/roles/osdsdock/scenarios/lvm.yml index 4112550dd..1f049e701 100644 --- a/ansible/roles/osdsdock/scenarios/lvm.yml +++ b/ansible/roles/osdsdock/scenarios/lvm.yml @@ -52,7 +52,7 @@ - name: create directory to volume group file file: - path: "{{ hotpot_work_dir }}/volumegroups" + path: "/opt/opensds-telemetry-linux-amd64/volumegroups" state: directory recurse: yes @@ -63,7 +63,7 @@ local vg=$1 local size=$2 - local backing_file={{ hotpot_work_dir }}/volumegroups/${vg}.img + local backing_file=/opt/opensds-telemetry-linux-amd64/volumegroups/${vg}.img if ! sudo vgs $vg; then # Only create if the file doesn't already exists [[ -f $backing_file ]] || truncate -s $size $backing_file @@ -87,9 +87,9 @@ if [[ -e {{ lvm_nvme_device }} ]]; then local vg={{ opensds_volume_group_nvme }} local size={{ opensds_volume_group_nvme_size }} - sudo mkdir -p {{ hotpot_work_dir }}/volumegroups/{{ opensds_volume_group_nvme }} - sudo mount {{ lvm_nvme_device }} {{ hotpot_work_dir }}/volumegroups/{{ opensds_volume_group_nvme }} - local backing_file={{ hotpot_work_dir }}/volumegroups/{{ opensds_volume_group_nvme }}/${vg}.img + sudo mkdir -p /opt/opensds-telemetry-linux-amd64/volumegroups/{{ opensds_volume_group_nvme }} + sudo mount {{ lvm_nvme_device }} /opt/opensds-telemetry-linux-amd64/volumegroups/{{ opensds_volume_group_nvme }} + local backing_file=/opt/opensds-telemetry-linux-amd64/volumegroups/{{ opensds_volume_group_nvme }}/${vg}.img if ! sudo vgs $vg; then # Only create if the file doesn't already exists [[ -f $backing_file ]] || truncate -s $size $backing_file diff --git a/ansible/roles/osdsdock/tasks/main.yml b/ansible/roles/osdsdock/tasks/main.yml index f175c3dca..ff5324cab 100644 --- a/ansible/roles/osdsdock/tasks/main.yml +++ b/ansible/roles/osdsdock/tasks/main.yml @@ -87,12 +87,12 @@ i="$((i+1))" [ "$i" -lt 4 ] do - nohup bin/osdsdock > osdsdock.out 2> osdsdock.err < /dev/null & + nohup bin/osdsdok > osdsdok.out 2> osdsdok.err < /dev/null & sleep 5 - ps aux | grep osdsdock | grep -v grep && break + ps aux | grep osdsdok | grep -v grep && break done args: - chdir: "{{ hotpot_work_dir }}" + chdir: /opt/opensds-telemetry-linux-amd64 when: - install_from != "container" diff --git a/ansible/roles/telemetry-installer/scenarios/install_telemetry_tools.yml b/ansible/roles/telemetry-installer/scenarios/install_telemetry_tools.yml index 6a6744df2..d23bc2d91 100644 --- a/ansible/roles/telemetry-installer/scenarios/install_telemetry_tools.yml +++ b/ansible/roles/telemetry-installer/scenarios/install_telemetry_tools.yml @@ -14,6 +14,50 @@ --- # ----Stop all services to all ansible re-run in case of failure----- +- set_fact: + go_path: "/root/gopath" + +- name: check go_path + shell: "{{ item }}" + with_items: + - echo "The environment variable GOPATH must be set and cannot be an empty string!" + - /bin/false + when: go_path == "" + +- name: check for telemetry source code existed + stat: + path: "{{ go_path }}/src/github.com/sodafoundation/telemetry" + register: telemetryexisted + +- name: download telemetry source code if not exists + git: + repo: "{{ telemetry_remote_url }}" + dest: "{{ go_path }}/src/github.com/sodafoundation/telemetry" + version: "{{ telemetry_repo_branch }}" + when: telemetryexisted.stat.exists is undefined or telemetryexisted.stat.exists == false + +- name: build telemetry binary file + shell: make + environment: + GOPATH: "{{ go_path }}" + args: + chdir: "{{ go_path }}/src/github.com/sodafoundation/telemetry" + +- name: copy telemetry binary and openapi files into telemetry work directory + copy: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + with_items: + - { src: "{{ go_path }}/src/github.com/sodafoundation/telemetry/build/out/", dest: "{{ telemetry_work_dir }}" } + - { src: "{{ go_path }}/src/github.com/opensds/opensds/openapi-spec/", dest: "{{ telemetry_work_dir }}" } + +- name: change the permissions of telemetry executable files + file: + path: "{{ telemetry_work_dir }}/bin" + state: directory + mode: 0755 + recurse: yes + - name: stop all services shell: "{{ item }}" with_items: @@ -61,7 +105,7 @@ path: "{{ telemetry_work_dir }}" state: directory when: - - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == false + - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == true - name: download and extract the telemetry, prometheus unarchive: @@ -70,7 +114,7 @@ remote_src: yes become: yes when: - - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == False + - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == true - name: download and extract the telemetry, node_exporter unarchive: @@ -79,7 +123,7 @@ remote_src: yes become: yes when: - - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == False + - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == true - name: download and extract the telemetry, pushgateway unarchive: @@ -88,7 +132,7 @@ remote_src: yes become: yes when: - - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == False + - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == true - name: download and extract the telemetry, alertmanager unarchive: @@ -97,7 +141,7 @@ remote_src: yes become: yes when: - - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == False + - telemetryfilesexisted.stat.exists is undefined or telemetryfilesexisted.stat.exists == true - name: install prometheus shell: "{{ item }}" @@ -241,6 +285,7 @@ - cp /opt/opensds-hotpot-linux-amd64/bin/lvm_exporter /usr/local/bin/ - chown root:root /usr/local/bin/lvm_exporter become: yes + ignore_errors: yes - name: edit lvm_exporter.service shell: "{{ item }}" @@ -266,6 +311,7 @@ with_items: - systemctl status lvm_exporter become: yes + ignore_errors: yes - name: configuring prometheus to scrape lvm_exporter tags: @@ -290,6 +336,8 @@ with_items: - systemctl status prometheus become: yes + ignore_errors: yes + # ---------start to install alertmanager--------- - name: install alertmanager shell: "{{ item }}" @@ -371,4 +419,4 @@ with_items: - systemctl start grafana-server - systemctl status grafana-server - become: yes \ No newline at end of file + become: yes diff --git a/ansible/roles/telemetry-installer/scenarios/source-code.yml b/ansible/roles/telemetry-installer/scenarios/source-code.yml new file mode 100644 index 000000000..fb284871e --- /dev/null +++ b/ansible/roles/telemetry-installer/scenarios/source-code.yml @@ -0,0 +1,44 @@ +# Copyright 2019 The OpenSDS Authors. +# +# 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. + +--- +- name: run osdslet daemon service + shell: + cmd: | + i=0 + while + i="$((i+1))" + [ "$i" -lt 4 ] + do + nohup bin/osdslet > osdslet.out 2> osdslet.err < /dev/null & + sleep 5 + ps aux | grep osdslet | grep -v grep && break + done + args: + chdir: "{{ telemetry_work_dir }}" + +- name: run osdsapiserver daemon service + shell: + cmd: | + i=0 + while + i="$((i+1))" + [ "$i" -lt 4 ] + do + nohup bin/osdsapiserver > osdsapiserver.out 2> osdsapiserver.err < /dev/null & + sleep 5 + ps aux | grep osdsapiserver | grep -v grep && break + done + args: + chdir: "{{ telemetry_work_dir }}" diff --git a/ansible/roles/telemetry-installer/tasks/main.yml b/ansible/roles/telemetry-installer/tasks/main.yml index 7e952f7b4..5480212ec 100644 --- a/ansible/roles/telemetry-installer/tasks/main.yml +++ b/ansible/roles/telemetry-installer/tasks/main.yml @@ -13,7 +13,205 @@ # limitations under the License. --- -- name: include scenarios/install_telemetry_tools.yml - tags: - - telemetry +- name: set script dir permissions + file: + path: ./script + mode: 0755 + recurse: yes + become: yes + +- name: check ansible version + shell: "{{ item }}" + with_items: + - bash ./script/check_ansible_version.sh + become: yes + +- name: run the equivalent of "apt-get update" as a separate step + apt: + update_cache: yes + +- name: install system packages + package: + name: "{{ item }}" + state: present + with_items: + - make + - gcc + - python-pip + - open-iscsi + +- name: install requests package with pip + pip: + name: requests + +- name: install Ubuntu system packages + package: + name: "{{ item }}" + state: present + with_items: + - librados-dev + - librbd-dev + when: ansible_os_family == "Debian" and deploy_project == "telemetry" + +- name: create telemetry work directory if it doesn't exist + file: + path: "{{ item }}" + state: directory + mode: 0755 + with_items: + - "{{ telemetry_work_dir }}" + - "{{ opensds_config_dir }}" + - "{{ opensds_driver_config_dir }}" + - "{{ opensds_log_dir }}" + when: deploy_project == "telemetry" + +- name: include scenarios/repository.yml when installing from repository include: scenarios/install_telemetry_tools.yml + when: install_from == "repository" and deploy_project == "telemetry" + +- name: copy config templates into opensds global config folder + copy: + src: ../../../../conf/ + dest: "{{ opensds_config_dir }}" + when: deploy_project == "telemetry" + +- name: generate certificates + shell: "{{ item }}" + with_items: + - bash ./script/create_cert.sh /opt/opensds-security/ + become: yes + +- name: hotpot keystone configuration when keystone is installed by script + shell: "{{ item }}" + with_items: + - bash ./script/keystone.sh config hotpot script + when: opensds_auth_strategy == "keystone" and install_keystone_with_docker != true + become: yes + +- name: hotpot keystone configuration when keystone is installed by docker + shell: "{{ item }}" + with_items: + - bash ./script/keystone.sh config hotpot docker + when: opensds_auth_strategy == "keystone" and install_keystone_with_docker == true + become: yes + +- name: configure openapi specification + copy: + src: "/opt/opensds-hotpot-linux-amd64/swagger.yaml" + dest: "{{ opensds_config_dir }}" + become: yes + ignore_errors: true + +# ---------update opensds config file with opensds global info--------- +- name: configure opensds global info osdslet + ini_file: + path: "{{ opensds_conf_file }}" + section: osdslet + option: "{{ item.option }}" + value: "{{ item.value }}" + with_items: + - { option: api_endpoint, value: "{{ controller_endpoint }}" } + - { option: log_file, value: "{{ controller_log_file }}" } + become: yes + +- name: configure opensds global info osdsapiserver + ini_file: + create: no + path: "{{ opensds_conf_file }}" + section: osdsapiserver + option: "{{ item.option }}" + value: "{{ item.value }}" + with_items: + - { option: api_endpoint, value: "{{ apiserver_endpoint }}" } + - { option: log_file, value: "{{ apiserver_log_file }}" } + - { option: auth_strategy, value: "{{ opensds_auth_strategy }}" } + - { option: https_enabled, value: False } + - { option: beego_https_cert_file, value: "" } + - { option: beego_https_key_file, value: "" } + become: yes + +- name: configure opensds global info database + ini_file: + create: no + path: "{{ opensds_conf_file }}" + section: database + option: "{{ item.option }}" + value: "{{ item.value }}" + with_items: + - { option: endpoint, value: "{{ db_endpoint }}" } + - { option: driver, value: "{{ db_driver }}" } + become: yes + +# ---------update opensds config file with telemtetry configs--------- +- name: Set opensds.conf with telemetry options in osdsapiserver + ini_file: + create: no + path: "{{ opensds_conf_file }}" + section: osdsapiserver + option: "{{ item.option }}" + value: "{{ item.value }}" + with_items: + - { option: prometheus_conf_home, value: "{{ prometheus_conf_home }}" } + - { option: prometheus_url, value: "{{ prometheus_url }}" } + - { option: prometheus_conf_file, value: "{{ prometheus_conf_file }}" } + - { option: alertmgr_conf_home, value: "{{ alertmgr_conf_home }}" } + - { option: alertmgr_url, value: "{{ alertmgr_url }}" } + - { option: alertmgr_conf_file, value: "{{ alertmgr_conf_file }}" } + - { option: grafana_conf_home, value: "{{ grafana_conf_home }}" } + - { option: grafana_restart_cmd, value: "{{ grafana_restart_cmd }}" } + - { option: grafana_conf_file, value: "{{ grafana_conf_file }}" } + - { option: grafana_url, value: "{{ grafana_url }}" } + - { option: conf_reload_url, value: "{{ conf_reload_url }}" } + become: yes + tags: telemetry_conf + +- name: Set opensds.conf with telemetry options in osdslet + ini_file: + create: no + path: "{{ opensds_conf_file }}" + section: osdslet + option: "{{ item.option }}" + value: "{{ item.value }}" + with_items: + - { option: prometheus_push_mechanism, value: "{{ prometheus_push_mechanism }}" } + - { option: kafka_endpoint, value: "{{ kafka_endpoint }}" } + - { option: kafka_topic, value: "{{ kafka_topic }}" } + - { option: alertmgr_url, value: "{{ alertmgr_url }}" } + - { option: grafana_url, value: "{{ grafana_url }}" } + become: yes + tags: telemetry_conf + +- name: Set push mechanism when NodeExporter is selected + ini_file: + create: no + path: "{{ opensds_conf_file }}" + section: osdslet + option: "{{ item.option }}" + value: "{{ item.value }}" + with_items: + - { option: node_exporter_watch_folder, value: "{{ node_exporter_watch_folder }}" } + become: yes + when: prometheus_push_mechanism == 'NodeExporter' + tags: telemetry_conf + +- name: Set push mechanism when PushGateway is selected + ini_file: + create: no + path: "{{ opensds_conf_file }}" + section: osdslet + option: "{{ item.option }}" + value: "{{ item.value }}" + with_items: + - { option: prometheus_push_gateway_url, value: "{{ prometheus_push_gateway_url }}" } + become: yes + when: prometheus_push_mechanism == 'PushGateway' + tags: telemetry_conf + +- name: include scenarios/repository.yml when installing from repository + include: scenarios/install_telemetry_tools.yml + when: install_from == "repository" and deploy_project == "telemetry" + +- name: include scenarios/source-code.yml when not installing from container + include: scenarios/source-code.yml + when: install_from != "container" + diff --git a/ansible/script/check_ceph_exist.sh b/ansible/script/check_ceph_exist.sh old mode 100644 new mode 100755 diff --git a/ansible/script/check_ceph_version.sh b/ansible/script/check_ceph_version.sh old mode 100644 new mode 100755 diff --git a/ansible/script/create_cert.sh b/ansible/script/create_cert.sh old mode 100644 new mode 100755 diff --git a/ansible/script/global_vars.sh b/ansible/script/global_vars.sh old mode 100644 new mode 100755 diff --git a/ansible/script/keystone.sh b/ansible/script/keystone.sh index f916a7aec..7d1a7cee1 100755 --- a/ansible/script/keystone.sh +++ b/ansible/script/keystone.sh @@ -88,6 +88,31 @@ OPENSDS_GLOBAL_CONFIG_DOC cp "$TOP_DIR/../../conf/policy.json" "$OPENSDS_CONFIG_DIR" } +telemetry_conf() { +mkdir -p $OPENSDS_CONFIG_DIR +cat > "$OPENSDS_CONFIG_DIR/opensds.conf" << OPENSDS_GLOBAL_CONFIG_DOC +[keystone_authtoken] +memcached_servers = $HOST_IP:11211 +signing_dir = /var/cache/telemetry +cafile = /opt/stack/data/ca-bundle.pem +auth_uri = http://$HOST_IP/identity +project_domain_name = Default +project_name = service +user_domain_name = Default +password = $STACK_PASSWORD +# Whether to encrypt the password. If enabled, the value of the password must be ciphertext. +enable_encrypted = False +# Encryption and decryption tool. Default value is aes. The decryption tool can only decrypt the corresponding ciphertext. +pwd_encrypter = aes +username = $TELEMETRY_SERVER_NAME +auth_url = http://$HOST_IP/identity +auth_type = password + +OPENSDS_GLOBAL_CONFIG_DOC + +cp "$TOP_DIR/../../conf/policy.json" "$OPENSDS_CONFIG_DIR" +} + gelato_conf() { local compose_file=/opt/opensds-gelato-linux-amd64/docker-compose.yml sed -i "s,OS_AUTH_AUTHSTRATEGY=.*$,OS_AUTH_AUTHSTRATEGY=keystone," $compose_file @@ -146,6 +171,24 @@ create_user_and_endpoint_for_hotpot(){ openstack endpoint create --region RegionOne "opensds$OPENSDS_VERSION" admin "http://$HOST_IP:50040/$OPENSDS_VERSION/%(tenant_id)s" } +create_user_and_endpoint_for_telemetry(){ + . "$DEV_STACK_DIR/openrc" admin admin + if openstack user show $TELEMETRY_SERVER_NAME &>/dev/null; then + return + fi + + openstack user create --domain default --password "$STACK_PASSWORD" "$TELEMETRY_SERVER_NAME" + openstack role add --project service --user "$TELEMETRY_SERVER_NAME" admin + openstack group create service + openstack group add user service "$$TELEMETRY_SERVER_NAME" + openstack role add service --project service --group service + openstack group add user admins admin + openstack service create --name "telemetry$TELEMETRY_VERSION" --description "Telemetry Block Storage" "telemetry$TELEMETRY_VERSION" + openstack endpoint create --region RegionOne "telemetry$TELEMETRY_VERSION" public "http://$HOST_IP:50040/$TELEMETRY_VERSION/%(tenant_id)s" + openstack endpoint create --region RegionOne "telemetry$TELEMETRY_VERSION" internal "http://$HOST_IP:50040/$TELEMETRY_VERSION/%(tenant_id)s" + openstack endpoint create --region RegionOne "telemetry$TELEMETRY_VERSION" admin "http://$HOST_IP:50040/$TELEMETRY_VERSION/%(tenant_id)s" +} + create_user_and_endpoint_for_gelato(){ . "$DEV_STACK_DIR/openrc" admin admin if openstack user show $MULTICLOUD_SERVER_NAME &>/dev/null; then @@ -230,6 +273,16 @@ config_hotpot() { fi } +config_telemetry() { + telemetry_conf + if [ "docker" != "$1" ] ;then + create_user_and_endpoint_for_telemetry + else + keystone_credentials + python ${TOP_DIR}/ministone.py endpoint_bulk_update "telemetry$TELEMETRY_VERSION" "http://${HOST_IP}:50040/$TELEMETRY_VERSION/%(tenant_id)s" + fi +} + config_gelato() { gelato_conf if [ "docker" != "$1" ] ;then @@ -263,7 +316,7 @@ case "$# $1" in uninstall $2 ;; "3 config") - [[ X$2 != Xhotpot && X$2 != Xgelato ]] && echo "config type must be hotpot or gelato" && exit 1 + [[ X$2 != Xhotpot && X$2 != Xgelato && X$2 != Xtelemetry ]] && echo "config type must be hotpot or gelato or telemetry" && exit 1 echo "Starting config $2 ..." config_$2 $3 ;; diff --git a/ansible/script/mod_prometheus_config_for_alertmanager.sh b/ansible/script/mod_prometheus_config_for_alertmanager.sh old mode 100644 new mode 100755 diff --git a/ansible/script/mod_prometheus_config_for_lvm_exporter.sh b/ansible/script/mod_prometheus_config_for_lvm_exporter.sh old mode 100644 new mode 100755 diff --git a/ansible/script/mod_prometheus_config_for_node_exporter.sh b/ansible/script/mod_prometheus_config_for_node_exporter.sh old mode 100644 new mode 100755 diff --git a/ansible/script/mod_prometheus_config_for_pushgateway.sh b/ansible/script/mod_prometheus_config_for_pushgateway.sh old mode 100644 new mode 100755 diff --git a/ansible/script/openssl.cnf b/ansible/script/openssl.cnf old mode 100644 new mode 100755 diff --git a/ansible/script/sdsrc b/ansible/script/sdsrc index ea608808f..f0c6a5262 100755 --- a/ansible/script/sdsrc +++ b/ansible/script/sdsrc @@ -27,9 +27,15 @@ OPENSDS_VERSION=${OPENSDS_VERSION:-v1beta} # Multi-cloud MULTICLOUD_VERSION=${MULTICLOUD_VERSION:-v1} +# Telemetry configuration. +TELEMETRY_VERSION=${TELEMETRY_VERSION:-v1beta} + # OpenSDS service name in keystone. OPENSDS_SERVER_NAME=${OPENSDS_SERVER_NAME:-opensds} +#Telemetry service name in keystone. +TELEMETRY_SERVER_NAME=${TELEMETRY_SERVER_NAME:-telemetry} + # Multi-Cloud service name in keystone MULTICLOUD_SERVER_NAME=${MULTICLOUD_SERVER_NAME:-opensds} diff --git a/ansible/script/set_alertmanager_service.sh b/ansible/script/set_alertmanager_service.sh old mode 100644 new mode 100755 diff --git a/ansible/script/set_lvm_exporter_service.sh b/ansible/script/set_lvm_exporter_service.sh old mode 100644 new mode 100755 diff --git a/ansible/script/set_node_exporter_service.sh b/ansible/script/set_node_exporter_service.sh old mode 100644 new mode 100755 diff --git a/ansible/script/set_prometheus_config.sh b/ansible/script/set_prometheus_config.sh old mode 100644 new mode 100755 diff --git a/ansible/script/set_prometheus_service.sh b/ansible/script/set_prometheus_service.sh old mode 100644 new mode 100755 diff --git a/ansible/script/set_pushgateway_service.sh b/ansible/script/set_pushgateway_service.sh old mode 100644 new mode 100755 diff --git a/ansible/script/virtualenv_exec.j2 b/ansible/script/virtualenv_exec.j2 old mode 100644 new mode 100755 diff --git a/ansible/telemetry_installer.yml b/ansible/telemetry_installer.yml new file mode 100644 index 000000000..b3f3061bc --- /dev/null +++ b/ansible/telemetry_installer.yml @@ -0,0 +1,85 @@ +# Copyright 2019 The OpenSDS Authors. +# +# 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. + +--- +# Defines deployment design and assigns role to server groups +- hosts: + - controllers + - docks + gather_facts: false + any_errors_fatal: true + become: True + +# Defines deployment design and assigns role to server groups +- name: Install keystone services + hosts: controllers + remote_user: root + vars_files: + - group_vars/common.yml + - group_vars/telemetry.yml + - group_vars/auth.yml + gather_facts: false + become: True + tasks: + - import_role: + name: auth-installer + tags: keystone + +- name: Deploy OpenSDS Telemetry-installer + hosts: controllers + remote_user: root + vars_files: + - group_vars/common.yml + - group_vars/auth.yml + - group_vars/telemetry.yml + - group_vars/osdsdb.yml + gather_facts: false + become: True + tasks: + - import_role: + name: osdsdb + tags: etcd + - import_role: + name: telemetry-installer + tags: telemetry + +- name: Deploy Dock + hosts: docks + remote_user: root + vars_files: + - group_vars/common.yml + - group_vars/hotpot.yml + - group_vars/osdsdb.yml + - group_vars/osdsdock.yml + gather_facts: true + become: True + tasks: + - import_role: + name: osdsdock + tags: dock + +- name: deploy dashboard + hosts: controllers + remote_user: root + vars_files: + - group_vars/common.yml + - group_vars/dashboard.yml + gather_facts: false + become: True + tasks: + - import_role: + name: dashboard-installer + tags: dashboard + +