Introduce support for Archlinux. By @michalroxorpl (#79)

This commit is contained in:
michalroxorpl 2021-09-23 12:07:49 +02:00 committed by GitHub
parent 10ed2c3f44
commit aa5830aca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 2 deletions

View File

@ -18,6 +18,9 @@ galaxy_info:
- trusty - trusty
- xenial - xenial
- bionic - bionic
- name: Archlinux
versions:
- all
galaxy_tags: galaxy_tags:
- backup - backup
- cloud - cloud

View File

@ -19,4 +19,5 @@ RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y pyth
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 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 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 apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v pacman) ]; then pacman --noconfirm -Suy python sudo openssh; \
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

@ -2,10 +2,21 @@
- name: Converge - name: Converge
hosts: all hosts: all
pre_tasks: pre_tasks:
- name: Set ssh server package name for non-Archlinux ansible_os_family
set_fact:
openssh_package: "openssh-server"
when: ansible_os_family != "Archlinux"
- name: Set ssh server package name for Archlinux ansible_os_family
set_fact:
openssh_package: "openssh"
when: ansible_os_family == "Archlinux"
- name: Install openssh - name: Install openssh
package: package:
name: openssh-server name: "{{ openssh_package }}"
state: present state: present
roles: roles:
- role: m3nu.ansible_role_borgbackup - role: m3nu.ansible_role_borgbackup
borg_encryption_passphrase: CHANGEME borg_encryption_passphrase: CHANGEME

View File

@ -4,6 +4,8 @@ dependency:
driver: driver:
name: docker name: docker
platforms: platforms:
- name: archlinux-latest
image: archlinux:latest
- name: centos-7 - name: centos-7
image: centos:7 image: centos:7
- name: centos-8 - name: centos-8

1
tasks/Archlinux.yml Normal file
View File

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

14
vars/Archlinux.yml Normal file
View File

@ -0,0 +1,14 @@
---
borg_packages:
- gcc
- python-pip
- openssh
- cronie
borg_python_packages:
- cython
- borgbackup
- borgmatic
python_bin: python3
pip_bin: pip3