rclone: Move more generic stuff away from web-logs role
This commit is contained in:
parent
06f173cba2
commit
06f4645127
3 changed files with 18 additions and 22 deletions
|
@ -19,3 +19,19 @@
|
|||
mode: 0644
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: create log directory
|
||||
file:
|
||||
path: /var/log/rclone
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ local_user | default('root') }}"
|
||||
group: "{{ local_user | default(ansible_wheel) }}"
|
||||
|
||||
- name: copy logsync script
|
||||
template:
|
||||
dest: /usr/local/bin/rclone-sync
|
||||
src: rclone-sync.sh.j2
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
|
|
@ -3,18 +3,13 @@
|
|||
set -u
|
||||
umask 027
|
||||
|
||||
TARGET="/var/cache/sync-http-logs"
|
||||
TARGET="{{ destination }}"
|
||||
CONFIG="/etc/rclone/rclone.conf"
|
||||
LOGDIR="/var/log/rclone"
|
||||
RCLONE="/usr/local/bin/rclone"
|
||||
|
||||
timestamp="$(date +%Y%m%d%H%M%S)"
|
||||
|
||||
if [ "$(whoami)" != "logsync" ]; then
|
||||
echo "ERR: Script needs to be run as logsync user" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$TARGET" ]; then
|
||||
echo "ERR: Destination directory '${TARGET}' does not exist" 1>&2
|
||||
exit 1
|
|
@ -19,6 +19,7 @@
|
|||
vars:
|
||||
remote_user: logsync
|
||||
hostgroup: webservers
|
||||
destination: /var/cache/sync-http-logs
|
||||
|
||||
- name: create data directories
|
||||
file:
|
||||
|
@ -30,22 +31,6 @@
|
|||
with_items:
|
||||
- /var/cache/sync-http-logs
|
||||
|
||||
- name: create log directory
|
||||
file:
|
||||
path: /var/log/rclone
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: logsync
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: copy logsync script
|
||||
copy:
|
||||
dest: /usr/local/bin/sync-http-logs
|
||||
src: sync-http-logs.sh
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: add log sync cron job
|
||||
cron:
|
||||
name: sync-http-logs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue