From 55542d3204314c170c123dc066f93b4c8f9ac4bc Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Sun, 1 Jan 2023 21:39:42 -0800 Subject: config: add beancount --- .../config/roles/beancount/tasks/main.yaml | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 bean.jinwei.me/config/roles/beancount/tasks/main.yaml (limited to 'bean.jinwei.me/config/roles/beancount/tasks') diff --git a/bean.jinwei.me/config/roles/beancount/tasks/main.yaml b/bean.jinwei.me/config/roles/beancount/tasks/main.yaml new file mode 100644 index 0000000..98bf49d --- /dev/null +++ b/bean.jinwei.me/config/roles/beancount/tasks/main.yaml @@ -0,0 +1,38 @@ +- name: login to docker hub + community.docker.docker_login: + username: "{{ lookup('aws_ssm', '/jinwei-me/docker/username') }}" + password: "{{ lookup('aws_ssm', '/jinwei-me/docker/token') }}" + +- name: pull ledger Docker image + community.docker.docker_image: + name: "{{ bean_image }}:{{ bean_image_tag }}" + source: pull + +- name: Create directory + file: + path: "{{ bean_home }}" + state: directory + mode: '0755' + +- name: render config file + template: + src: docker-compose.yaml.j2 + dest: "{{ bean_home }}/docker-compose.yaml" + mode: 0644 + +- name: start ledger container using docker-compose + community.docker.docker_compose: + project_name: ledger + project_src: "{{ bean_home }}" + register: output + +#- name: setup cronjob for additional backup +# cron: +# cron_file: wordpress_backup_hetzner +# user: root +# state: present +# name: "wordpress backup" +# minute: "0" +# hour: "0" +# day: "*" +# job: "tar caf /tmp/wordpress-$(date -u +\\%Y-\\%m-\\%d-\\%H-\\%M-\\%S\\%Z).tar.xz {{ wordpress_home }} && rsync -azvP /tmp/wordpress-*.tar.xz {{ samba_backup_path }}" -- cgit v1.2.3