add rclone_yandex role

This commit is contained in:
Sergey Malyuk
2025-12-16 14:05:16 +03:00
parent b94dd89c56
commit 18fb8ad52a
23 changed files with 335 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
---
- name: Converge
hosts: all
pre_tasks:
- name: "Install basic tools"
ansible.builtin.apt:
name:
- curl
update_cache: true
cache_valid_time: 3600
autoremove: true
autoclean: true
roles:
- role: genlab.rclone_yandex
rclone_mountpoint: /mnt/yandex-disk
rclone_group: yandex
rclone_secrets: secrets/token.yml

View File

@@ -0,0 +1,27 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: ubuntu
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest
pre_build_image: true
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
provisioner:
name: ansible
verifier:
name: ansible
lint: |
set -e
yamllint .
ansible-lint .

View File

@@ -0,0 +1,5 @@
rclone:
access_token: "y0_Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..."
token_type: "OAuth"
refresh_token: "1:SPUlxxxxxxxxxxxxxxxxxxxxxxxx..."
expiry: "2024-05-16T05:26:26.319196346Z"

View File

@@ -0,0 +1,18 @@
---
- name: Verify
hosts: all
gather_facts: false
any_errors_fatal: true
become: true
tasks:
- name: "Gather facts about the service"
ansible.builtin.service_facts:
- name: "Check if the `rclone-yandex` service is running"
ansible.builtin.assert:
that:
- "'rclone-yandex.service' in ansible_facts.services"
- "ansible_facts.services['rclone-yandex.service'].state == 'running'"
fail_msg: "the 'rclone-yandex' service is not running!"
success_msg: "the 'rclone-yandex' service is up and running"