ansible/roles/bank/tasks/revbank.yaml

52 lines
1.3 KiB
YAML

---
- name: Install dependencies
ansible.builtin.apt:
name: [ git, libterm-readline-gnu-perl, libcurses-ui-perl, qrencode ]
state: present
- name: Clone revbank source
ansible.builtin.git:
repo: "{{ bank_revbank_git }}"
version: master
dest: /home/{{ bank_user }}/revbank.git
accept_hostkey: yes
- name: Create data files
ansible.builtin.command: cp /home/{{ bank_user }}/revbank.git/{{ item }} /home/{{ bank_user }}/{{ item }}
args:
creates: /home/{{ bank_user }}/{{ item }}
with_items:
- revbank.accounts
- revbank.market
- revbank.products
- name: Ensure data file permissions
ansible.builtin.file:
path: /home/{{ bank_user }}/{{ item }}
state: touch
owner: "{{ bank_user }}"
group: "{{ bank_user }}"
mode: 0644
with_items:
- revbank.accounts
- revbank.market
- revbank.products
- name: Link plugins
ansible.builtin.file:
state: link
path: /home/{{ bank_user }}/{{ item }}
src: /home/{{ bank_user }}/revbank.git/{{ item }}
with_items:
- plugins
- revbank.plugins
- name: Create git data dir
ansible.builtin.file:
path: /home/{{ bank_user }}/data.git
state: directory
- name: Install git cronjob
ansible.builtin.template:
src: git.cron
dest: /etc/cron.d/revbank-git