mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2024-11-19 19:07:42 +01:00
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"
|