|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | --- |
16 | | -- name: include scenarios/install_telemetry_tools.yml |
17 | | - tags: |
18 | | - - telemetry |
| 16 | +- name: set script dir permissions |
| 17 | + file: |
| 18 | + path: ./script |
| 19 | + mode: 0755 |
| 20 | + recurse: yes |
| 21 | + become: yes |
| 22 | + |
| 23 | +- name: check ansible version |
| 24 | + shell: "{{ item }}" |
| 25 | + with_items: |
| 26 | + - bash ./script/check_ansible_version.sh |
| 27 | + become: yes |
| 28 | + |
| 29 | +- name: run the equivalent of "apt-get update" as a separate step |
| 30 | + apt: |
| 31 | + update_cache: yes |
| 32 | + |
| 33 | +- name: install system packages |
| 34 | + package: |
| 35 | + name: "{{ item }}" |
| 36 | + state: present |
| 37 | + with_items: |
| 38 | + - make |
| 39 | + - gcc |
| 40 | + - python-pip |
| 41 | + - open-iscsi |
| 42 | + |
| 43 | +- name: install requests package with pip |
| 44 | + pip: |
| 45 | + name: requests |
| 46 | + |
| 47 | +- name: install Ubuntu system packages |
| 48 | + package: |
| 49 | + name: "{{ item }}" |
| 50 | + state: present |
| 51 | + with_items: |
| 52 | + - librados-dev |
| 53 | + - librbd-dev |
| 54 | + when: ansible_os_family == "Debian" and deploy_project == "telemetry" |
| 55 | + |
| 56 | +- name: create telemetry work directory if it doesn't exist |
| 57 | + file: |
| 58 | + path: "{{ item }}" |
| 59 | + state: directory |
| 60 | + mode: 0755 |
| 61 | + with_items: |
| 62 | + - "{{ telemetry_work_dir }}" |
| 63 | + - "{{ opensds_config_dir }}" |
| 64 | + - "{{ opensds_driver_config_dir }}" |
| 65 | + - "{{ opensds_log_dir }}" |
| 66 | + when: deploy_project == "telemetry" |
| 67 | + |
| 68 | +- name: copy config templates into opensds global config folder |
| 69 | + copy: |
| 70 | + src: ../../../../conf/ |
| 71 | + dest: "{{ opensds_config_dir }}" |
| 72 | + when: deploy_project == "telemetry" |
| 73 | + |
| 74 | +- name: generate certificates |
| 75 | + shell: "{{ item }}" |
| 76 | + with_items: |
| 77 | + - bash ./script/create_cert.sh "{{ opensds_certs_dir }}" |
| 78 | + become: yes |
| 79 | + |
| 80 | +- name: hotpot keystone configuration when keystone is installed by docker |
| 81 | + shell: "{{ item }}" |
| 82 | + with_items: |
| 83 | + - bash ./script/keystone.sh config hotpot docker |
| 84 | + when: opensds_auth_strategy == "keystone" and install_keystone_with_docker == true |
| 85 | + become: yes |
| 86 | + |
| 87 | +- name: configure openapi specification |
| 88 | + copy: |
| 89 | + src: "/opt/opensds-hotpot-linux-amd64/swagger.yaml" |
| 90 | + dest: "{{ opensds_config_dir }}" |
| 91 | + become: yes |
| 92 | + ignore_errors: true |
| 93 | + |
| 94 | +# ---------update opensds config file with opensds global info--------- |
| 95 | +- name: configure opensds global info osdslet |
| 96 | + ini_file: |
| 97 | + path: "{{ opensds_conf_file }}" |
| 98 | + section: osdslet |
| 99 | + option: "{{ item.option }}" |
| 100 | + value: "{{ item.value }}" |
| 101 | + with_items: |
| 102 | + - { option: api_endpoint, value: "{{ controller_endpoint }}" } |
| 103 | + - { option: log_file, value: "{{ controller_log_file }}" } |
| 104 | + become: yes |
| 105 | + |
| 106 | +- name: configure opensds global info osdsapiserver |
| 107 | + ini_file: |
| 108 | + create: no |
| 109 | + path: "{{ opensds_conf_file }}" |
| 110 | + section: osdsapiserver |
| 111 | + option: "{{ item.option }}" |
| 112 | + value: "{{ item.value }}" |
| 113 | + with_items: |
| 114 | + - { option: api_endpoint, value: "{{ apiserver_endpoint }}" } |
| 115 | + - { option: log_file, value: "{{ apiserver_log_file }}" } |
| 116 | + - { option: auth_strategy, value: "{{ opensds_auth_strategy }}" } |
| 117 | + - { option: https_enabled, value: False } |
| 118 | + - { option: beego_https_cert_file, value: "" } |
| 119 | + - { option: beego_https_key_file, value: "" } |
| 120 | + become: yes |
| 121 | + |
| 122 | +- name: configure opensds global info database |
| 123 | + ini_file: |
| 124 | + create: no |
| 125 | + path: "{{ opensds_conf_file }}" |
| 126 | + section: database |
| 127 | + option: "{{ item.option }}" |
| 128 | + value: "{{ item.value }}" |
| 129 | + with_items: |
| 130 | + - { option: endpoint, value: "{{ db_endpoint }}" } |
| 131 | + - { option: driver, value: "{{ db_driver }}" } |
| 132 | + become: yes |
| 133 | + |
| 134 | +# ---------update opensds config file with telemtetry configs--------- |
| 135 | +- name: Set opensds.conf with telemetry options in osdsapiserver |
| 136 | + ini_file: |
| 137 | + create: no |
| 138 | + path: "{{ opensds_conf_file }}" |
| 139 | + section: osdsapiserver |
| 140 | + option: "{{ item.option }}" |
| 141 | + value: "{{ item.value }}" |
| 142 | + with_items: |
| 143 | + - { option: prometheus_conf_home, value: "{{ prometheus_conf_home }}" } |
| 144 | + - { option: prometheus_url, value: "{{ prometheus_url }}" } |
| 145 | + - { option: prometheus_conf_file, value: "{{ prometheus_conf_file }}" } |
| 146 | + - { option: alertmgr_conf_home, value: "{{ alertmgr_conf_home }}" } |
| 147 | + - { option: alertmgr_url, value: "{{ alertmgr_url }}" } |
| 148 | + - { option: alertmgr_conf_file, value: "{{ alertmgr_conf_file }}" } |
| 149 | + - { option: grafana_conf_home, value: "{{ grafana_conf_home }}" } |
| 150 | + - { option: grafana_restart_cmd, value: "{{ grafana_restart_cmd }}" } |
| 151 | + - { option: grafana_conf_file, value: "{{ grafana_conf_file }}" } |
| 152 | + - { option: grafana_url, value: "{{ grafana_url }}" } |
| 153 | + - { option: conf_reload_url, value: "{{ conf_reload_url }}" } |
| 154 | + become: yes |
| 155 | + tags: telemetry_conf |
| 156 | + |
| 157 | +- name: Set opensds.conf with telemetry options in osdslet |
| 158 | + ini_file: |
| 159 | + create: no |
| 160 | + path: "{{ opensds_conf_file }}" |
| 161 | + section: osdslet |
| 162 | + option: "{{ item.option }}" |
| 163 | + value: "{{ item.value }}" |
| 164 | + with_items: |
| 165 | + - { option: prometheus_push_mechanism, value: "{{ prometheus_push_mechanism }}" } |
| 166 | + - { option: kafka_endpoint, value: "{{ kafka_endpoint }}" } |
| 167 | + - { option: kafka_topic, value: "{{ kafka_topic }}" } |
| 168 | + - { option: alertmgr_url, value: "{{ alertmgr_url }}" } |
| 169 | + - { option: grafana_url, value: "{{ grafana_url }}" } |
| 170 | + become: yes |
| 171 | + tags: telemetry_conf |
| 172 | + |
| 173 | +- name: Set push mechanism when NodeExporter is selected |
| 174 | + ini_file: |
| 175 | + create: no |
| 176 | + path: "{{ opensds_conf_file }}" |
| 177 | + section: osdslet |
| 178 | + option: "{{ item.option }}" |
| 179 | + value: "{{ item.value }}" |
| 180 | + with_items: |
| 181 | + - { option: node_exporter_watch_folder, value: "{{ node_exporter_watch_folder }}" } |
| 182 | + become: yes |
| 183 | + when: prometheus_push_mechanism == 'NodeExporter' |
| 184 | + tags: telemetry_conf |
| 185 | + |
| 186 | +- name: Set push mechanism when PushGateway is selected |
| 187 | + ini_file: |
| 188 | + create: no |
| 189 | + path: "{{ opensds_conf_file }}" |
| 190 | + section: osdslet |
| 191 | + option: "{{ item.option }}" |
| 192 | + value: "{{ item.value }}" |
| 193 | + with_items: |
| 194 | + - { option: prometheus_push_gateway_url, value: "{{ prometheus_push_gateway_url }}" } |
| 195 | + become: yes |
| 196 | + when: prometheus_push_mechanism == 'PushGateway' |
| 197 | + tags: telemetry_conf |
| 198 | + |
| 199 | +- name: include scenarios/repository.yml when installing from repository |
19 | 200 | include: scenarios/install_telemetry_tools.yml |
| 201 | + when: install_from == "repository" and deploy_project == "telemetry" |
| 202 | + |
| 203 | +- name: include scenarios/source-code.yml when not installing from container |
| 204 | + include: scenarios/source-code.yml |
| 205 | + when: install_from != "container" |
| 206 | + |
0 commit comments