Add support for RPM-based distros (CentOS, RHEL, Fedora)

This commit is contained in:
Manu 2019-05-27 18:12:13 +08:00
parent e30ce279c4
commit e809ec597d
6 changed files with 34 additions and 10 deletions

View File

@ -1,6 +1,6 @@
# Ansible Role: BorgBackup Client
An Ansible Role that sets up automated remote backups on the target machine. Uses [BorgBackup](https://borgbackup.readthedocs.io/en/stable/) and [Borgmatic](https://github.com/witten/borgmatic). Currently supports Debian and Ubuntu.
An Ansible Role that sets up automated remote backups on the target machine. Uses [BorgBackup](https://borgbackup.readthedocs.io/en/stable/) and [Borgmatic](https://github.com/witten/borgmatic). Currently supports Debian/Ubuntu and CentOS/RHEL/Fedora.
## Role Variables

1
tasks/apt.yml Normal file
View File

@ -0,0 +1 @@
---

View File

@ -1,25 +1,23 @@
---
- name: Regenerate apt-cache and update packages
apt:
update_cache: yes
cache_valid_time: 120
- include_vars: '{{ ansible_pkg_mgr }}.yml'
- include: "{{ ansible_pkg_mgr }}.yml"
- name: Install required System Packages
apt:
package:
pkg: "{{ item }}"
state: installed
with_items: "{{ borg_apt_packages }}"
with_items: "{{ borg_packages }}"
- name: Update setuptools if needed
pip:
name: setuptools
state: latest
executable: pip3
executable: "{{ pip_bin }}"
- name: Install required Python Packages
pip:
name: "{{ item }}"
executable: pip3
executable: "{{ pip_bin }}"
with_items: "{{ borg_python_packages }}"
- name: Ensure root has SSH key.

6
tasks/yum.yml Normal file
View File

@ -0,0 +1,6 @@
---
- name: Install EPEL repo
yum:
pkg: epel-release
state: installed
update_cache: yes

View File

@ -1,5 +1,5 @@
---
borg_apt_packages:
borg_packages:
- libssl-dev
- libacl1-dev
- libacl1
@ -8,6 +8,9 @@ borg_apt_packages:
- python3-pip
- python3-msgpack
python_bin: python3
pip_bin: pip3
borg_python_packages:
- borgbackup
- borgmatic

16
vars/yum.yml Normal file
View File

@ -0,0 +1,16 @@
---
borg_packages:
- libacl-devel
- libacl
- gcc
- gcc-c++
- openssl-devel
- python36-pip
- python36-devel
python_bin: python3
pip_bin: pip3
borg_python_packages:
- borgbackup
- borgmatic