Skip to content

Commit

Permalink
feat: initial support for FreeBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
hadret committed Oct 5, 2020
1 parent c9b138e commit 93ad1c6
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Ansible Role: Restic

[![Build Status](https://travis-ci.com/hadret/ansible-role-restic.svg?branch=master)](https://travis-ci.com/hadret/ansible-role-restic)

An Ansible role that installs [restic](https://restic.net) on Linux.
An Ansible role that installs [restic](https://restic.net) on Linux & FreeBSD.

Requirements
------------
Expand Down
3 changes: 0 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ restic_install_path: '/usr/local/bin'
restic_password_file_path: '/root'
restic_discard_cron_stdout: false

restic_user: root
restic_group: "{{ restic_user }}"

restic_repos: []
# restic_repos:
# - name: s3-example
Expand Down
8 changes: 7 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies: []
galaxy_info:
role_name: restic
author: donat-b, Pawel Krupa (paulfantom), Filip Chabik (hadret)
description: Restic installation for Ubuntu Linux.
description: Restic installation for Linux & FreeBSD.
license: MIT
min_ansible_version: 2.7
platforms:
Expand All @@ -16,6 +16,12 @@ galaxy_info:
- xenial
- bionic
- focal
- name: FreeBSD
versions:
- 11.4
- 12.1
- 12.2
- 13.0
galaxy_tags:
- restic
- backup
Expand Down
14 changes: 14 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
---
- name: include OS-specific variables
include_vars: "{{ ansible_os_family }}.yml"

- name: define restic_user.
set_fact:
restic_user: "{{ __restic_user }}"
when: restic_user is not defined

- name: define restic_group
set_fact:
restic_group: "{{ __restic_group }}"
when: restic_group is not defined

- name: ensure restic group is present
group:
name: "{{ restic_group }}"
Expand Down Expand Up @@ -57,6 +70,7 @@
path: "{{ restic_install_path }}/restic"
capability: cap_dac_read_search+ep
state: present
when: ansible_system == "Linux"
become: true

- name: deploy password files
Expand Down
3 changes: 3 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
__restic_user: "root"
__restic_group: "{{ __restic_user }}"
3 changes: 3 additions & 0 deletions vars/FreeBSD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
__restic_user: "root"
__restic_group: "wheel"

0 comments on commit 93ad1c6

Please sign in to comment.