X Tutup
Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit fa35129

Browse files
committed
Restore: Added user agent to Rclone command.
1 parent e1bbde9 commit fa35129

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

roles/restore/tasks/restore_remote.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
when: (rclone_conf_playbook_dir.stat.exists) or (not rclone_binary.stat.exists)
4343

4444
- name: Test rclone remote destination
45-
shell: "rclone lsd {{ rclone.destination }}"
45+
shell: |
46+
/usr/bin/rclone lsd {{ rclone.destination }} \
47+
--user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36'
4648
become: yes
4749
become_user: "{{ user }}"
4850
register: rclone_test
@@ -53,7 +55,16 @@
5355
when: (rclone_test.rc > 0)
5456

5557
- name: "Fetch backup from '{{ rclone.destination }}'"
56-
command: "rclone copy '{{ rclone.destination }}/' '{{ local.destination }}' --stats=30s -v --transfers=4 --drive-chunk-size=128M --exclude 'archived/**' --log-file='{{ playbook_dir }}/restore_rclone.log'"
58+
shell: |
59+
/usr/bin/rclone copy \
60+
--user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36' \
61+
--transfers=4 \
62+
--drive-chunk-size=128M \
63+
--exclude 'archived/**' \
64+
--stats=30s \
65+
-v \
66+
--log-file='{{ playbook_dir }}/restore_rclone.log' \
67+
'{{ rclone.destination }}/' '{{ local.destination }}'
5768
become: yes
5869
become_user: "{{ user }}"
5970

@@ -68,4 +79,4 @@
6879

6980
- name: "Fail if tar files are missing"
7081
fail: msg="There must have been an issue retrieving the tar files as they are missing in '{{ local.destination }}/opt/'"
71-
when: (dir_files2.matched|int == 0)
82+
when: (dir_files2.matched|int == 0)

0 commit comments

Comments
 (0)
X Tutup