Install borgmatic in virtualenv. By @stroobl. Fixes #60 (#68)

This commit is contained in:
Luc Stroobant 2021-06-21 19:58:51 +02:00 committed by GitHub
parent 995c866c22
commit b99de011fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 6 deletions

View File

@ -19,19 +19,29 @@
name: "{{ borg_packages }}"
state: present
- name: Update setuptools if needed
tags: skip_ansible_lint
- name: Create virtualenv for borg
pip:
name: setuptools
state: latest
executable: "{{ pip_bin }}"
name: pip-tools
virtualenv: /opt/borgmatic
virtualenv_command: "{{ python_bin }} -m venv"
- name: Install required Python Packages
pip:
name: "{{ borg_python_packages }}"
executable: "{{ pip_bin }}"
virtualenv: /opt/borgmatic
when: borg_python_packages is defined
- 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"
- name: Ensure root has SSH key.
user:
name: "root"

View File

@ -8,6 +8,7 @@ borg_packages:
- python3-dev
- python3-pip
- python3-msgpack
- python3-venv
- openssh-client
- cron

View File

@ -9,6 +9,7 @@ borg_packages:
- python3-wheel
- python3-devel
- python3-setuptools
- python3-virtualenv
- openssh-clients
- cronie