-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from ipfs-search/s3_snapshots
S3 snapshots
- Loading branch information
Showing
10 changed files
with
135 additions
and
38 deletions.
There are no files selected for viewing
Submodule inventory
updated
from 5052cc to aab48b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# Intentionally empty to allow loading handlers etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
--- | ||
- name: Import handlers and vars from opensearch rolling upgrade | ||
import_role: | ||
name: "vendor/opensearch_rolling_upgrade" | ||
tasks_from: "init.yml" | ||
- name: Configuring S3 snapshot repo | ||
import_tasks: s3.yml | ||
tags: | ||
- snapshots-s3 | ||
- name: Configuring snapshot cron job | ||
import_tasks: cron.yml | ||
- name: Configuring OS notifications | ||
import_tasks: notifications.yml | ||
tags: | ||
- snapshots-cron | ||
- snapshots-notifications | ||
- name: Configuring snapshot management | ||
import_tasks: management.yml | ||
tags: | ||
- snapshots-management |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- name: Configure snapshot management | ||
run_once: true | ||
block: | ||
- name: Get snapshot management policy | ||
uri: | ||
url: http://127.0.0.1:9200/_plugins/_sm/policies/{{ snapshot_management_policy_name }} | ||
method: GET | ||
status_code: 200, 404 | ||
register: snapshot_management_policy_get | ||
changed_when: false | ||
- name: Remove non idempotent fields from policy | ||
set_fact: | ||
current_policy: "{{ snapshot_management_policy_get.json.sm_policy | combine({'schedule': omit, 'enabled_time': omit, 'last_updated_time': omit, 'name': omit}) }}" | ||
when: snapshot_management_policy_get.status == 200 | ||
- name: Create snapshot management policy | ||
uri: | ||
url: "http://127.0.0.1:9200/_plugins/_sm/policies/{{ snapshot_management_policy_name }}" | ||
method: POST | ||
status_code: 201 | ||
body_format: json | ||
body: "{{ snapshot_management_policy }}" | ||
changed_when: true | ||
when: snapshot_management_policy_get.status == 404 | ||
- name: Update snapshot management policy | ||
uri: | ||
url: "http://127.0.0.1:9200/_plugins/_sm/policies/{{ snapshot_management_policy_name }}?if_seq_no={{ snapshot_management_policy_get.json._seq_no }}&if_primary_term={{ snapshot_management_policy_get.json._primary_term }}" | ||
method: PUT | ||
status_code: 200 | ||
body_format: json | ||
body: "{{ snapshot_management_policy }}" | ||
register: snapshot_management_policy_post | ||
changed_when: true | ||
when: snapshot_management_policy_get.status == 200 and current_policy != snapshot_management_policy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
- name: Configure notifications | ||
run_once: true | ||
block: | ||
- name: Get channel | ||
uri: | ||
url: http://127.0.0.1:9200/_plugins/_notifications/configs/{{ os_notifications_channel_id }} | ||
method: GET | ||
status_code: 200, 404 | ||
register: channel_get | ||
changed_when: false | ||
- name: Remove non idempotent fields from channel | ||
set_fact: | ||
current_config: "{{ channel_get.json.config_list[0].config }}" | ||
when: channel_get.status == 200 | ||
- name: Create channel | ||
uri: | ||
url: "http://127.0.0.1:9200/_plugins/_notifications/configs/" | ||
method: POST | ||
status_code: 200 | ||
body_format: json | ||
body: | ||
config_id: "{{ os_notifications_channel_id }}" | ||
config: "{{ os_notifications_channel_config }}" | ||
changed_when: true | ||
when: channel_get.status == 404 | ||
- name: Update channel | ||
uri: | ||
url: "http://127.0.0.1:9200/_plugins/_notifications/configs/{{ os_notifications_channel_id }}" | ||
method: PUT | ||
status_code: 200 | ||
body_format: json | ||
body: | ||
config_id: "{{ os_notifications_channel_id }}" | ||
config: "{{ os_notifications_channel_config }}" | ||
register: os_notifications_channel_config_post | ||
changed_when: true | ||
when: channel_get.status == 200 and current_config != os_notifications_channel_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.