ansible/roles/rclone/tasks/main.yaml

43 lines
1.3 KiB
YAML
Raw Normal View History

2019-11-10 21:36:23 +00:00
---
- name: gather OS specific variables
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- name: OS specific tasks
include: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- name: create configuration directory
file:
path: "{{ rclone_config_path }}"
state: directory
- name: configure
template:
src: rclone.conf.j2
dest: "{{ rclone_config_path }}/{{ item.name }}.conf"
owner: "{{ item.owner | default('root') }}"
group: "{{ item.group | default('root') }}"
mode: "{{ item.mode | default('0600') }}"
with_items: "{{ rclone_config }}"
2019-11-22 03:46:34 +00:00
no_log: true
2019-11-10 21:36:23 +00:00
- name: cron jobs
cron:
name: "{{ item.name }}"
user: "{{ item.user | default('root') }}"
minute: "{{ item.minute | default(omit) }}"
hour: "{{ item.hour | default(omit) }}"
day: "{{ item.day | default(omit) }}"
month: "{{ item.month | default(omit) }}"
weekday: "{{ item.weekday | default(omit) }}"
job: "{{ item.job }}"
state: "{{ item.state | default('present') }}"
with_items: "{{ rclone_cron }}"