Skip to content

Commit 5d436b5

Browse files
committed
Add ansible documentation
1 parent 8b06cf7 commit 5d436b5

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,37 @@ Here's a configuration example to run the script every hour:
5858
0 * * * * docker run -v <CONFIGURATION PATH>:/app/config.yml ghcr.io/gperiard/ynab2splitwise:latest
5959
```
6060
61+
#### Provision with Ansible
62+
There's an Ansible role in this project to simplify the configuration of the cronjob.
63+
64+
1. Add this repo in your requirements.yml file:
65+
```
66+
roles:
67+
- src: https://github.com/gperiard/ynab2splitwise.git
68+
version: v0.2.0
69+
name: ynab2splitwise
70+
```
71+
2. Download it.
72+
```
73+
ansible-galaxy install -r requirements.yml
74+
```
75+
3. Create a playbook. Here's an example:
76+
```yaml
77+
# cronjobs.yml
78+
---
79+
- hosts: cronjobs.periard.ca
80+
become: true
81+
vars_file:
82+
- vault.yml # <- contains your account configuration under y2s_accounts_configuration
83+
roles:
84+
- role: ynab2splitwise
85+
y2s_config_dir: /opt/docker/ynab2splitwise
86+
```
87+
4. Run it.
88+
```
89+
ansible-playbook -i inventory cronjobs.yml
90+
```
91+
6192
## Contributing
6293
Pull requests are welcome.
6394

0 commit comments

Comments
 (0)