mirror of
https://github.com/status-im/infra-role-s3cmd-upload.git
synced 2025-02-20 03:58:04 +00:00
install s3cmd from apt
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
3e41d2ac69
commit
3356b07065
@ -1,11 +1,4 @@
|
||||
---
|
||||
# tool for uploading to s3 compatible backends
|
||||
s3cmd_version: '2.1.0'
|
||||
s3cmd_name: 's3cmd-{{ s3cmd_version }}'
|
||||
s3cmd_archive: '{{ s3cmd_name }}.tar.gz'
|
||||
s3cmd_checksum: 'md5:2637f1b36f5d9db4f60af3b18eb34958'
|
||||
s3cmd_url: 'https://github.com/s3tools/s3cmd/releases/download/v{{ s3cmd_version }}/{{ s3cmd_archive }}'
|
||||
|
||||
backup_name: 'default'
|
||||
backup_directory: ~
|
||||
backup_script_dir: '/var/lib/backups'
|
||||
|
10
tasks/install.yml
Normal file
10
tasks/install.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Install s3cmd tool
|
||||
apt:
|
||||
name: s3cmd
|
||||
|
||||
- name: Create s3cmd config
|
||||
template:
|
||||
src: s3cfg.j2
|
||||
dest: /root/.s3cfg
|
||||
mode: 0400
|
@ -1,4 +1,4 @@
|
||||
---
|
||||
- include_tasks: s3cmd.yml
|
||||
- include_tasks: install.yml
|
||||
- include_tasks: script.yml
|
||||
- include_tasks: timer.yml
|
||||
|
@ -1,30 +0,0 @@
|
||||
---
|
||||
- name: Check if s3cmd is installed
|
||||
stat:
|
||||
path: /usr/local/bin/s3cmd
|
||||
register: s3cmd
|
||||
|
||||
- name: Download s3cmd archive
|
||||
get_url:
|
||||
url: '{{ s3cmd_url }}'
|
||||
dest: /tmp
|
||||
when: not s3cmd.stat.exists
|
||||
|
||||
- name: Extract s3cmd archive
|
||||
unarchive:
|
||||
src: '/tmp/{{ s3cmd_archive }}'
|
||||
dest: /tmp
|
||||
remote_src: yes
|
||||
when: not s3cmd.stat.exists
|
||||
|
||||
- name: Install s3cmd
|
||||
command: python setup.py install
|
||||
args:
|
||||
chdir: '/tmp/{{ s3cmd_name }}'
|
||||
when: not s3cmd.stat.exists
|
||||
|
||||
- name: Create s3cmd config
|
||||
template:
|
||||
src: s3cfg.j2
|
||||
dest: /root/.s3cfg
|
||||
mode: 0400
|
@ -8,5 +8,5 @@ ARCHIVES=$(ls -Art ${BACKUPS_DIR} | tail -n ${BACKUPS_NUM})
|
||||
|
||||
for ARCHIVE in ${ARCHIVES}; do
|
||||
echo "Uploading: ${ARCHIVE} >> ${BUCKET_NAME}"
|
||||
/usr/local/bin/s3cmd put "${BACKUPS_DIR}/${ARCHIVE}" "${BUCKET_NAME}"
|
||||
/usr/bin/s3cmd put "${BACKUPS_DIR}/${ARCHIVE}" "${BUCKET_NAME}"
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user