Commit 67944988 authored by Keshav Prasad's avatar Keshav Prasad
Browse files

fix: interim commit

Showing with 20 additions and 7 deletions
+20 -7
......@@ -8,10 +8,10 @@
roles:
- role: es-azure-snapshot
when: cloud_provider == "azure"
- role: es-aws-snapshot
when: cloud_provider == "aws"
- role: es-gcloud-snapshot
when: cloud_provider == "gcloud"
# - role: es-aws-snapshot
# when: cloud_provider == "aws"
# - role: es-gcloud-snapshot
# when: cloud_provider == "gcloud"
- role: es5-snapshot-purge
tags:
- es_backup
......
......@@ -9,4 +9,9 @@ snapshot_create_request_body: {
# Override these values
es_snapshot_host: "localhost"
snapshot_base_path: "default"
backup_container: "elasticsearch-snapshots"
\ No newline at end of file
backup_container: "elasticsearch-snapshots"
### Re-use exisiting variables of azure storage account
azure_management_storage_account_name: "{{ sunbird_management_storage_account_name }}"
azure_management_storage_account_key: "{{ sunbird_management_storage_account_key }}"
azure_management_resource_group: "{{ azure_management_resource_group }}"
\ No newline at end of file
......@@ -4,6 +4,16 @@
- set_fact: snapshot_number="snapshot_{{ lookup('pipe','date +%s') }}"
- name: Ensure blob container exisits
azure_rm_storageblob:
resource_group: "{{ azure_management_resource_group }}"
storage_account_name: "{{ azure_management_storage_account_name }}"
container: "{{ backup_container }}"
state: present
environment:
AZURE_STORAGE_KEY: "{{ azure_management_storage_account_key }}"
delegate_to: localhost
- name: Create azure snapshot
uri:
url: "http://{{ es_snapshot_host }}:9200/_snapshot/{{ snapshot_base_path }}"
......@@ -16,8 +26,6 @@
uri:
url: "http://{{ es_snapshot_host }}:9200/_snapshot/{{ snapshot_base_path }}/{{ snapshot_number }}"
method: PUT
body: >
{"indices":"*","include_global_state":false}
headers:
Content-Type: "application/json"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment