mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2024-11-19 19:07:42 +01:00
981d4f9072
* allow to installation via os package manager or pip * Run a second time to install via package manager * Check for EPEL if distro package requested. * Split dep lists to avoid installing build deps when using distro pkg Co-authored-by: Stefan Morgenthaler <dev@morgenthaler.at> Co-authored-by: Manu <manu@snapdragon.cc>
40 lines
959 B
YAML
40 lines
959 B
YAML
---
|
|
- name: Install build dependencies
|
|
package:
|
|
name: "{{ borg_pip_packages }}"
|
|
state: present
|
|
|
|
- name: Create virtualenv for borg # noqa package-latest
|
|
pip:
|
|
name:
|
|
- pip
|
|
- setuptools
|
|
state: latest
|
|
virtualenv: /opt/borgmatic
|
|
virtualenv_command: "{{ python_bin }} -m venv"
|
|
|
|
- name: Install dependent Python Packages
|
|
pip:
|
|
name: "{{ borg_dependent_python_packages }}"
|
|
virtualenv: /opt/borgmatic
|
|
when: borg_dependent_python_packages is defined
|
|
|
|
- name: Install main Python Packages
|
|
pip:
|
|
name: "{{ item.name }}"
|
|
version: "{{ item.version | default(omit, true) }}"
|
|
virtualenv: /opt/borgmatic
|
|
when: borg_python_packages is defined
|
|
loop: "{{ borg_python_packages }}"
|
|
|
|
- name: Create borgmatic command in /usr/local/bin
|
|
copy:
|
|
content: |
|
|
#!/bin/bash
|
|
. /opt/borgmatic/bin/activate
|
|
borgmatic "$@"
|
|
dest: /usr/local/bin/borgmatic
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|