From 5a152e7965f9ff1a0d16ff579dbaadc0c4220580 Mon Sep 17 00:00:00 2001 From: Damien Dart Date: Mon, 16 Dec 2024 23:14:50 +0000 Subject: [PATCH] Add VueScan-installing Ansible role. --- playbook-provision.yml | 1 + roles/vuescan/defaults/main.yml | 18 ++++++++++++++++++ roles/vuescan/meta/main.yml | 6 ++++++ roles/vuescan/tasks/main.yml | 26 ++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 roles/vuescan/defaults/main.yml create mode 100644 roles/vuescan/meta/main.yml create mode 100644 roles/vuescan/tasks/main.yml diff --git a/playbook-provision.yml b/playbook-provision.yml index 5daa208..b232dc2 100644 --- a/playbook-provision.yml +++ b/playbook-provision.yml @@ -21,6 +21,7 @@ - 'syncthing' - 'tailscale' - 'virtualbox' + - 'vuescan' - 'webserver' vars: webserver__vhosts_cleanup: '{{ cli__website_cleanup | default(False) }}' diff --git a/roles/vuescan/defaults/main.yml b/roles/vuescan/defaults/main.yml new file mode 100644 index 0000000..86091b1 --- /dev/null +++ b/roles/vuescan/defaults/main.yml @@ -0,0 +1,18 @@ +# This file was written by Damien Dart, . This is +# free and unencumbered software released into the public domain. For +# more information, please refer to the accompanying "UNLICENCE" file. + +--- + +# VueScan releases are available at +# . +vuescan__vuescan_package_checksum: 'sha256:96674ee595fb6ec7a047da9d653de49eff7c04474c3412a8007c23a8eb301b72' + + +# The following variables will have host-specific and/or sensitive +# values and must be defined elsewhere (in an inventory, playbook, at +# runtime, etc). + +# A string containing the directory where downloaded files are stored to +# prevent unnecessary downloading when tasks are rerun. +vuescan__download_cache_directory: '{{ undef() }}' diff --git a/roles/vuescan/meta/main.yml b/roles/vuescan/meta/main.yml new file mode 100644 index 0000000..69268e3 --- /dev/null +++ b/roles/vuescan/meta/main.yml @@ -0,0 +1,6 @@ +# This file was written by Damien Dart, . This is +# free and unencumbered software released into the public domain. For +# more information, please refer to the accompanying "UNLICENCE" file. + +--- +dependencies: [] diff --git a/roles/vuescan/tasks/main.yml b/roles/vuescan/tasks/main.yml new file mode 100644 index 0000000..05c742b --- /dev/null +++ b/roles/vuescan/tasks/main.yml @@ -0,0 +1,26 @@ +# This file was written by Damien Dart, . This is +# free and unencumbered software released into the public domain. For +# more information, please refer to the accompanying "UNLICENCE" file. + +--- +- name: 'Ensure download cache directory exists' + ansible.builtin.file: + path: '{{ vuescan__download_cache_directory }}' + group: 'root' + mode: '0777' + owner: 'root' + state: 'directory' + +- name: 'Ensure the VueScan Debian package is downloaded' + ansible.builtin.get_url: + checksum: '{{ vuescan__vuescan_package_checksum }}' + dest: '{{ vuescan__download_cache_directory }}/vuex6498.deb' + group: 'root' + mode: 0755 + owner: 'root' + url: 'https://www.hamrick.com/files/vuex6498.deb' + +- name: 'Ensure VueScan is installed' + ansible.builtin.apt: + deb: '{{ vuescan__download_cache_directory }}/vuex6498.deb' + state: 'present'