Skip to content

Commit f39ea2b

Browse files
committed
Add ansible role
1 parent 3f8a42d commit f39ea2b

6 files changed

Lines changed: 89 additions & 0 deletions

File tree

ansible/ynab2splitwise/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
ynab2splitwise
2+
=========
3+
4+
5+
6+
Requirements
7+
------------
8+
9+
This role requires docker to be install on the target host.
10+
11+
Role Variables
12+
--------------
13+
14+
Required:
15+
- y2s_accounts_configuration: List of accounts and their configuration. See ynab2splitwise documentation for details.
16+
17+
With defaults:
18+
- y2s_image_repository: Docker image repository for the ynab2splitwise image, "
19+
- y2s_image_tag: Docker image tag
20+
- y2s_cron_minute: Cron Minute
21+
- y2s_cron_hour: Cron Hour
22+
- y2s_cron_day: Cron Day
23+
- y2s_cron_month: Cron Month
24+
- y2s_cron_weekday: Cron Weekday
25+
26+
Dependencies
27+
------------
28+
29+
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
30+
31+
Example Playbook
32+
----------------
33+
34+
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
35+
36+
- hosts: servers
37+
vars_file:
38+
- vault.yml # Contains y2s_accounts_configuration with credentials
39+
roles:
40+
- role: gperiard.ynab2splitwise
41+
42+
43+
License
44+
-------
45+
46+
GNU GPLv3
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# defaults file for ynab2splitwise
3+
y2s_image_repository: ghcr.io/gperiard/ynab2splitwise
4+
y2s_image_tag: latest
5+
y2s_cron_minute: "0"
6+
y2s_cron_hour: "*"
7+
y2s_cron_day: "*"
8+
y2s_cron_month: "*"
9+
y2s_cron_weekday: "*"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
galaxy_info:
2+
author: Gabriel Périard-Tremblay
3+
description: Configure a cronjob to run ynab2splitwise
4+
license: GPL-3.0-only
5+
min_ansible_version: "2.1"
6+
galaxy_tags: []
7+
8+
dependencies: []
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
- name: Create configuration folder
3+
file:
4+
path: "{{ config_dir }}"
5+
state: directory
6+
mode: 0755
7+
8+
- name: Create configuration file
9+
template:
10+
src: config.yml.j2
11+
dest: "{{ config_dir }}/config.yml"
12+
mode: 0644
13+
14+
- name: Configure Cronjob
15+
ansible.builtin.cron:
16+
name: "ynab2splitwise"
17+
minute: "{{ y2s_cron_minute }}"
18+
hour: "{{ y2s_cron_minute }}"
19+
day: "{{ y2s_cron_day }}"
20+
month: "{{ y2s_cron_month }}"
21+
weekday: "{{ y2s_cron_weekday }}"
22+
job: "docker run --rm -v {{ config_dir }}/config.yml:/app/config.yml {{ y2s_image_repository }}:{{ y2s_image_tag }}"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
accounts: {{ y2s_accounts_configuration }}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# vars file for ynab2splitwise

0 commit comments

Comments
 (0)