Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Add restic_mode variable #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
owner: 'root'
group: '{{ restic_group }}'

- name: Read status of restic binary
stat:
path: '{{ restic_install_path }}/restic'
register: restic_binary

- name: Install libcap on Debian systems
apt:
name: "libcap2-bin"
Expand All @@ -80,6 +85,7 @@
when:
- ansible_os_family | lower == "debian"
- restic_user != 'root'
- restic_group != 'root'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheLastProject I think this line is wrong too, right? libcap2-bin should be installed if restic_user OR restic_group are not 'root', like this:

 - restic_user != 'root' or restic_group != 'root'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is @paulfantom's code, but it seems to me that that indeed should be changed.


- name: Set proper capabilities for restic binary
capabilities:
Expand All @@ -88,4 +94,6 @@
state: present
when:
- restic_user != 'root'
- restic_group != 'root'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

- not ansible_check_mode
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheLastProject This does not come from my PR, but still: what is this line for? The tasks are always run when not ansible_check_mode, no? Did I make a mistake in my thinking?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. and skipped when in Check/Test-Mode.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just to not fail if the capabilities are not set

- not restic_binary.stat.xoth