Skip to content

Commit

Permalink
updated es backup script (#2354)
Browse files Browse the repository at this point in the history
* base path variable

* added date variable
  • Loading branch information
G33tha authored Mar 24, 2021
1 parent 144cd4b commit 5774425
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ansible/roles/es-azure-snapshot/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ snapshot_create_request_body: {
type: azure,
settings: {
container: "elasticsearch-snapshots",
base_path: "{{ snapshot_base_path }}"
base_path: "{{ snapshot_base_path }}_{{ base_path_date }}"
}
}

Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/es-azure-snapshot/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---

- set_fact: base_path_date="{{ lookup('pipe','date +%Y-%m') }}"

- name: Create azure snapshot
uri:
url: "http://{{ es_snapshot_host }}:9200/_snapshot/azurebackup"
Expand Down

0 comments on commit 5774425

Please sign in to comment.