1
0
Fork 0
mirror of https://github.com/roles-ansible/role-grafana-kiosk.git synced 2024-08-16 10:09:49 +02:00

Download binary

This commit is contained in:
L3D 2020-06-30 17:07:25 +02:00 committed by L3D
parent ad0d89a8f8
commit f93d492be4
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
5 changed files with 46 additions and 3 deletions

View file

@ -1,7 +1,12 @@
---
# default variables
grafana_kiosk:
foo: bar
git_release: 'v1.0.2'
git_url: 'https://github.com/grafana/grafana-kiosk'
install_requirements: true
required_packages: []
install_state: 'present'
architecture: 'autodetect'
# perform basic versionscheck?
submodules_versioncheck: false

20
tasks/install.yml Normal file
View file

@ -0,0 +1,20 @@
---
- name: generate download URL for detected architecture
set_fact:
_download_url: "{{ grafana_kiosk.git_url }}/releases/download/{{ grafana_kiosk.git_release }}/{{ _dl_matrix[ansible_architecture] }}"
when: grafana_kiosk.architecture == 'autodetect'
- name: generate download URL for predefined architecture
set_fact:
_download_url: "{{ grafana_kiosk.git_url }}/releases/download/{{ grafana_kiosk.git_release }}/grafana-kiosk.linux.{{ grafana_kiosk.architecture }}"
when: not grafana_kiosk.architecture == 'autodetect'
- name: download grafana-kiosk binary
become: true
get_url:
url: "{{ _download_url }}"
dest: /usr/bin/grafana-kiosk
owner: root
group: root
mode: 0755
force: true

View file

@ -6,4 +6,7 @@
- include_tasks: versioncheck.yml
when: submodules_versioncheck|bool
- include_tasks: packages.yml
when: grafana_kiosk.install_requirements | bool
- include_tasks: install.yml

6
tasks/packages.yml Normal file
View file

@ -0,0 +1,6 @@
---
- name: install requirements for grafana-kiosk
become: true
package:
name: "{{ grafana_kiosk.required_packages }}"
state: "{{ grafana_kiosk.install_state }}"

View file

@ -1,6 +1,15 @@
---
_grafana_kiosk:
foo: bar
install_requirements: true
required_packages: []
install_state: 'present'
playbook_version_number: 1 # should be an integer
_dl_matrix:
'x86_64': "grafana-kiosk.linux.amd64"
'i386': "grafana-kiosk.linux.386"
'armv7l': "grafana-kiosk.linux.armv7"
'armv6l': "grafana-kiosk.linux.armv6"
'armv5l': "grafana-kiosk.linux.armv5"
playbook_version_number: 2 # should be an integer
playbook_version_path: 'role-grafana-kiosk_roles-ansible_github.com.version' # unique string