CentOS 8 support (#29)

* Load vars and tasks by OS family instaed of package manager. Fix Dockerfile for CentOS 8.
* Config for CentOS 8 and others
* Make monthly repo checking the default
This commit is contained in:
Manu 2020-02-18 14:35:20 +08:00 committed by GitHub
parent f66105f94b
commit e5738e9114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 44 additions and 11 deletions

View File

@ -2,7 +2,7 @@
[![Build Status](https://travis-ci.org/borgbase/ansible-role-borgbackup.svg?branch=master)](https://travis-ci.org/borgbase/ansible-role-borgbackup) [![Ansible Galaxy](https://img.shields.io/ansible/role/30531)](https://galaxy.ansible.com/m3nu/ansible_role_borgbackup)
Set up encrypted, compressed and deduplicated backups using [BorgBackup](https://borgbackup.readthedocs.io/en/stable/) and [Borgmatic](https://github.com/witten/borgmatic). Currently supports Debian/Ubuntu and CentOS/RHEL/Fedora.
Set up encrypted, compressed and deduplicated backups using [BorgBackup](https://borgbackup.readthedocs.io/en/stable/) and [Borgmatic](https://github.com/witten/borgmatic). Currently supports Debian/Ubuntu and CentOS/Red Hat.
Works great with [BorgBase.com](https://www.borgbase.com) - Simple and Secure Hosting for your Borg Repositories.

View File

@ -14,9 +14,9 @@ ENV {{ var }} {{ value }}
{% endfor %}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 python-apt aptitude && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install /usr/bin/python3 /usr/bin/python3-config /usr/bin/dnf-3 sudo bash iproute && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y /usr/bin/python /usr/bin/python2-config sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi

View File

@ -8,14 +8,20 @@ lint:
platforms:
- name: centos-7
image: centos:7
# - name: centos-latest
# image: centos:latest
- name: centos-latest
image: centos:latest
# - name: fedora-latest # epel package not available
# image: fedora:latest
- name: debian-oldstable
image: debian:oldstable
- name: debian-stable
image: debian:stable
# - name: ubuntu-latest
# image: ubuntu:latest
- name: ubuntu-xenial
image: ubuntu:xenial
# - name: ubuntu-trusty # Python too old
# image: ubuntu:trusty
- name: ubuntu-latest
image: ubuntu:latest
provisioner:
name: ansible
lint:

View File

@ -1,9 +1,15 @@
---
- name: Include OS-specific variables
include_vars: '{{ ansible_pkg_mgr }}.yml'
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_os_family }}.yml"
- name: Run OS-specific setup
include: "{{ ansible_pkg_mgr }}.yml"
include: "{{ item }}"
with_first_found:
- "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_os_family }}.yml"
- name: Install required System Packages
package:

21
vars/RedHat-8.yml Normal file
View File

@ -0,0 +1,21 @@
---
borg_packages:
- libacl-devel
- libacl
- gcc
- gcc-c++
- openssl-devel
- python3-pip
- python3-wheel
- python3-devel
- python3-setuptools
- openssh-clients
- cronie
python_bin: python3
pip_bin: pip3
borg_python_packages:
- cython
- borgbackup
- borgmatic