Skip to content

Commit

Permalink
skip config backup on initial deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
zinal committed Aug 8, 2023
1 parent 43f2431 commit 6a43747
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/ydbd_config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
command: "{{ ydb_dir }}/home/backup_config.sh {{ ydb_config_backup }}"
become: true
become_user: ydb
when: ydb_config_backup is defined

- name: Copy the TLS ca.crt
copy: src={{ ydb_tls_dir }}/ca.crt dest={{ ydb_dir }}/certs/ca.crt
Expand Down
5 changes: 5 additions & 0 deletions roles/ydbd_config/templates/backup_config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ set +u
YDB_DIR="{{ ydb_dir }}"
BACKUP_DIR=${YDB_DIR}/reserve/"$1"

if [ -z "$1" ] || [ "$1" = "none" ]; then
echo "$0: skipping configuration backup" >&2
exit 0
fi

if [ -d ${BACKUP_DIR} ]; then
echo "$0: target directory already exists" >&2
exit 1
Expand Down
5 changes: 5 additions & 0 deletions rolling-static.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Rolling restart for the configured static nodes

- hosts: ydbd_static
roles:
- role: ydbd_rolling_static
3 changes: 3 additions & 0 deletions run-rolling-static.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/sh

ansible-playbook -b -i hosts rolling-static.yaml

0 comments on commit 6a43747

Please sign in to comment.