add restic
- fix packages that were broken - change the way configuration is done - define default facts for packages with os_family level vars - refine the default facts into an os_family specfic config
This commit is contained in:
@@ -5,9 +5,25 @@
|
||||
files: "{{ pkg.files | default([]) }}"
|
||||
ansible.builtin.include_tasks: helpers/clean_install.yml
|
||||
|
||||
- name: Install go package using system go
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
when:
|
||||
- go_imethod == 'system'
|
||||
environment:
|
||||
GOBIN: "{{ path_bin }}"
|
||||
ansible.builtin.command:
|
||||
creates: "{{ pkg.bin }}"
|
||||
argv:
|
||||
- go
|
||||
- install
|
||||
- "{{ pkg.url }}"
|
||||
|
||||
- name: Install go package "{{ pkg.url }}"
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
when:
|
||||
- go_imethod != 'system'
|
||||
environment:
|
||||
GOBIN: "{{ path_bin }}"
|
||||
GOROOT: "{{ path_go }}"
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Dump npm pkg
|
||||
ansible.builtin.debug:
|
||||
var: pkg
|
||||
- name: Install npm
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
|
||||
@@ -66,10 +66,6 @@
|
||||
ansible.builtin.include_tasks:
|
||||
file: "pkgs/{{ pkg }}.yml"
|
||||
|
||||
- name: Dump pkg_sys
|
||||
debug:
|
||||
var: pkg_sys
|
||||
|
||||
- name: Install pkg_sys list using system package manager
|
||||
when:
|
||||
- pkg_sys|length > 0
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
- source
|
||||
go_pkg: github.com/cheat/cheat/cmd/cheat
|
||||
version: latest
|
||||
pkg_deps:
|
||||
- go
|
||||
# }}}
|
||||
- name: Configure cheat
|
||||
when:
|
||||
@@ -28,6 +30,12 @@
|
||||
when:
|
||||
- cheat_imethod == 'source'
|
||||
block:
|
||||
- name: Queue package dependencies
|
||||
loop: "{{ cheat.pkg_deps }}"
|
||||
loop_control:
|
||||
loop_var: dep
|
||||
ansible.builtin.include_tasks: pkgs/{{ dep }}.yml
|
||||
|
||||
- name: Configure cheat go install
|
||||
ansible.builtin.set_fact:
|
||||
cheat_go_install:
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
- name: Go system package install
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + [go_pkgname] }}"
|
||||
go_install: "{{ go_imethod }}={{ go_pkgname }}"
|
||||
|
||||
- name: Configure go archive installation
|
||||
when:
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
#
|
||||
## Package: restic
|
||||
## Description: backup with builtin encryption and compression
|
||||
## Version: system
|
||||
## Methods: system
|
||||
## Helpers: -
|
||||
---
|
||||
- name: Set restic default facts # {{{
|
||||
ansible.builtin.set_fact:
|
||||
restic:
|
||||
methods:
|
||||
default: [system]
|
||||
pkgname:
|
||||
default: restic
|
||||
- name: Finalise restic default facts
|
||||
ansible.builtin.set_fact:
|
||||
restic:
|
||||
methods: "{{ restic.methods[os_family] | default(restic.methods.default) }}"
|
||||
pkgname: "{{ restic.pkgname[os_family] | default(restic.pkgname.default) }}"
|
||||
# }}}
|
||||
- name: Configure restic
|
||||
when:
|
||||
- "'restic' not in __configured"
|
||||
block:
|
||||
- name: Set restic install method
|
||||
when:
|
||||
- restic_imethod is undefined
|
||||
ansible.builtin.set_fact:
|
||||
restic_imethod: "{{ imethod if imethod in restic.methods else restic.methods[0] }}"
|
||||
|
||||
- name: Configure restic system install
|
||||
when:
|
||||
- restic_imethod == 'system'
|
||||
block:
|
||||
- name: Queue restic system install
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + [restic.pkgname] }}"
|
||||
restic_install: "{{ restic_imethod }}={{ restic.pkgname }}"
|
||||
|
||||
- name: Finalise restic configuration
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine( { 'restic': restic_install } ) }}"
|
||||
|
||||
Reference in New Issue
Block a user