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

View File

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

View File

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