Skip to content

Commit

Permalink
mergerfs role update
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Sep 15, 2019
1 parent 82acb8b commit c18bb68
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
26 changes: 21 additions & 5 deletions menu/roles/mergerfs/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
---
- name: "Merge variables with defaults"
- name: "MergerFS | Get URL for latest mergerfs release"
shell: |
curl -s https://api.github.com/repos/trapexit/mergerfs/releases/latest \
| jq -r ".assets[] | select(.name | test(\"{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}_amd64\")) \
| .browser_download_url"
args:
executable: /bin/bash
warn: no
register: mergerfs_download_url
ignore_errors: yes

- name: "MergerFS | Set 'mergerfs_download_url_backup' variable"
set_fact:
merged_unions: "{{ (merged_unions | default([])) + [ union_default_args | combine(item) ] }}"
loop: "{{ unions }}"
mergerfs_download_url_backup: https://github.com/trapexit/mergerfs/releases/download/2.28.1/mergerfs_2.28.1.{{ ansible_distribution|lower
}}-{{ ansible_distribution_release|lower }}_amd64.deb

- name: "MergerFS | Install mergerfs"
apt:
deb: "{{ mergerfs_download_url.stdout | default('{{ mergerfs_download_url_backup }}') }}"
state: present

- name: "Install mergerfs packages and prereqs"
include: install.yml
- name: "MergerFS | Start 'mergerfs.service'"
systemd: name=mergerfs.service state=started enabled=yes daemon_reload=yes
8 changes: 8 additions & 0 deletions menu/roles/mergerfs/tasks/old.main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: "Merge variables with defaults"
set_fact:
merged_unions: "{{ (merged_unions | default([])) + [ union_default_args | combine(item) ] }}"
loop: "{{ unions }}"

- name: "Install mergerfs packages and prereqs"
include: install.yml

0 comments on commit c18bb68

Please sign in to comment.