From 22372c931d9828c70ec5512e0e89af1f8221a86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Jonas=20S=C3=A4mann?= Date: Sat, 20 Jun 2020 22:36:29 +0200 Subject: [PATCH] Update role acertmgr add var acertmgr_version Defining variable acertmgr_version from role defaults, allows version string to be overridden. Role defaults are set in connection: local scope. This also shortens long line to make this role linter compliant --- roles/acertmgr/defaults/main.yml | 3 +++ roles/acertmgr/tasks/main.yml | 9 +-------- 2 files changed, 4 insertions(+), 8 deletions(-) create mode 100644 roles/acertmgr/defaults/main.yml diff --git a/roles/acertmgr/defaults/main.yml b/roles/acertmgr/defaults/main.yml new file mode 100644 index 0000000..03c5328 --- /dev/null +++ b/roles/acertmgr/defaults/main.yml @@ -0,0 +1,3 @@ +--- + +acertmgr_version: "{{ lookup('url', 'https://raw.githubusercontent.com/moepman/acertmgr/master/version.txt') | trim }}" diff --git a/roles/acertmgr/tasks/main.yml b/roles/acertmgr/tasks/main.yml index 6d8df43..56f0a78 100644 --- a/roles/acertmgr/tasks/main.yml +++ b/roles/acertmgr/tasks/main.yml @@ -8,16 +8,9 @@ - python3-yaml - python3-pkg-resources -- name: Find current acertmgr version - get_url: - url: "https://raw.githubusercontent.com/moepman/acertmgr/master/version.txt" - dest: /tmp/acertmgr.version - vars: - ansible_connection: local - - name: Install acertmgr apt: - deb: "https://github.com/moepman/acertmgr/releases/download/{{ lookup('file', '/tmp/acertmgr.version') }}/python3-acertmgr_{{ lookup('file', '/tmp/acertmgr.version') }}-1_all.deb" + deb: "https://github.com/moepman/acertmgr/releases/download/{{ acertmgr_version }}/python3-acertmgr_{{ acertmgr_version }}-1_all.deb" - name: Create config directories file: