Skip to content

Commit fa4be88

Browse files
fix: rke2_etcd_snapshot_file variable
1 parent 9c8f5a7 commit fa4be88

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ rke2_etcd_snapshot_source_dir: etcd_snapshots
202202
# The etcd will be restored only during the initial run, so even if you will leave the the file name specified,
203203
# the etcd will remain untouched during the next runs.
204204
# You can either use this or set options in `rke2_etcd_snapshot_s3_options`
205-
rke2_etcd_snapshot_file:
205+
rke2_etcd_snapshot_file: ""
206206

207207
# Etcd snapshot location
208208
rke2_etcd_snapshot_destination_dir: "{{ rke2_data_path }}/server/db/snapshots"

meta/argument_specs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ argument_specs:
307307

308308
rke2_etcd_snapshot_file:
309309
type: str
310-
required: false
310+
default: ""
311311
description: "Etcd snapshot file name. When the file name is defined, the etcd will be restored on initial deployment Ansible run."
312312

313313
rke2_etcd_snapshot_destination_dir:

tasks/first_server.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
- name: Register if we need to do a etcd restore from file
4545
ansible.builtin.set_fact:
4646
do_etcd_restore: true
47-
when: rke2_etcd_snapshot_file and ((ansible_facts.services['rke2-server.service'] is not defined) or (ansible_facts.services['rke2-server.service']['status'] == 'disabled'))
47+
when: (rke2_etcd_snapshot_file | length > 0) and ((ansible_facts.services['rke2-server.service'] is not defined) or (ansible_facts.services['rke2-server.service']['status'] == 'disabled'))
4848

4949
- name: Register if we need to do a etcd restore from s3
5050
ansible.builtin.set_fact:
5151
do_etcd_restore_from_s3: true
5252
when:
53-
- not rke2_etcd_snapshot_file
53+
- rke2_etcd_snapshot_file | length > 0
5454
- rke2_etcd_snapshot_s3_options is defined
5555
- rke2_etcd_snapshot_s3_options.access_key
5656
- rke2_etcd_snapshot_s3_options.secret_key

0 commit comments

Comments
 (0)