mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2024-11-19 19:07:42 +01:00
52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
|
---
|
||
|
- name: Install Borg and Borgmatic via pip
|
||
|
block:
|
||
|
- name: Install build dependencies
|
||
|
ansible.builtin.package:
|
||
|
name: "{{ borg_pip_packages }}"
|
||
|
state: present
|
||
|
|
||
|
- name: Create virtualenv for borg # noqa package-latest
|
||
|
ansible.builtin.pip:
|
||
|
name:
|
||
|
- pip
|
||
|
- setuptools
|
||
|
state: latest
|
||
|
virtualenv: "{{ borg_venv_path }}"
|
||
|
virtualenv_command: "{{ python_bin }} -m venv"
|
||
|
|
||
|
- name: Install dependent Python packages
|
||
|
ansible.builtin.pip:
|
||
|
name: "{{ borg_dependent_python_packages }}"
|
||
|
virtualenv: "{{ borg_venv_path }}"
|
||
|
when: borg_dependent_python_packages is defined
|
||
|
|
||
|
- name: Install main Python packages
|
||
|
ansible.builtin.pip:
|
||
|
name: "{{ item.name }}"
|
||
|
version: "{{ item.version | default(omit, true) }}"
|
||
|
virtualenv: "{{ borg_venv_path }}"
|
||
|
when: borg_python_packages is defined
|
||
|
loop: "{{ borg_python_packages }}"
|
||
|
|
||
|
- name: Create links to Borgmatic and Borg binaries
|
||
|
block:
|
||
|
- name: Create borgmatic command in /usr/local/bin
|
||
|
ansible.builtin.copy:
|
||
|
content: |
|
||
|
#!/bin/bash
|
||
|
. "{{ borg_venv_path }}"/bin/activate
|
||
|
borgmatic "$@"
|
||
|
dest: /usr/local/bin/borgmatic
|
||
|
mode: "0755"
|
||
|
|
||
|
- name: Create borg command in /usr/local/bin
|
||
|
ansible.builtin.copy:
|
||
|
content: |
|
||
|
#!/bin/bash
|
||
|
. "{{ borg_venv_path }}"/bin/activate
|
||
|
borg "$@"
|
||
|
dest: /usr/local/bin/borg
|
||
|
mode: "0755"
|
||
|
...
|