Skip to content

Commit

Permalink
Introduce support for Archlinux. By @michalroxorpl (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalroxorpl authored Sep 23, 2021
1 parent 10ed2c3 commit aa5830a
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
5 changes: 4 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ galaxy_info:
- trusty
- xenial
- bionic
- name: Archlinux
versions:
- all
galaxy_tags:
- backup
- cloud
- system
- security

allow_duplicates: true
allow_duplicates: true
1 change: 1 addition & 0 deletions molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 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
13 changes: 12 additions & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@
- name: Converge
hosts: all
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
package:
name: openssh-server
name: "{{ openssh_package }}"
state: present

roles:
- role: m3nu.ansible_role_borgbackup
borg_encryption_passphrase: CHANGEME
Expand Down
2 changes: 2 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ dependency:
driver:
name: docker
platforms:
- name: archlinux-latest
image: archlinux:latest
- name: centos-7
image: centos:7
- name: centos-8
Expand Down
1 change: 1 addition & 0 deletions tasks/Archlinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
14 changes: 14 additions & 0 deletions vars/Archlinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
borg_packages:
- gcc
- python-pip
- openssh
- cronie

borg_python_packages:
- cython
- borgbackup
- borgmatic

python_bin: python3
pip_bin: pip3

0 comments on commit aa5830a

Please sign in to comment.