mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 00:05:44 +02:00
Update to 2022-01-30 13:00
This commit is contained in:
8
roles/babashka/defaults/main.yml
Normal file
8
roles/babashka/defaults/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
# Babashka version to deploy
|
||||
bb_version: 0.7.4
|
||||
# URL of the archive
|
||||
bb_archive_url: https://github.com/babashka/babashka/releases/download/v{{ bb_version }}/babashka-{{ bb_version }}-linux-amd64-static.tar.gz
|
||||
# Expected sha256sum of the archive
|
||||
bb_archive_sha256: 707aab21b40921d0d3323e24ebc7330680e650e6bb3aab6ba67abdcf4f2f146c
|
4
roles/babashka/meta/main.yml
Normal file
4
roles/babashka/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- role: clojure
|
8
roles/babashka/tasks/cleanup.yml
Normal file
8
roles/babashka/tasks/cleanup.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Remove tmp and obsolete files
|
||||
file: path={{ item }} state=absent
|
||||
loop:
|
||||
- /tmp/babashka-{{ bb_version }}-linux-amd64-static.tar.gz
|
||||
- /tmp/bb
|
||||
tags: bb
|
30
roles/babashka/tasks/facts.yml
Normal file
30
roles/babashka/tasks/facts.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
|
||||
- name: Set default install mode
|
||||
set_fact: bb_install_mode='none'
|
||||
tags: bb
|
||||
|
||||
- name: Check if bb is installed
|
||||
stat: path=/usr/local/bin/bb
|
||||
register: bb_bin
|
||||
changed_when: False
|
||||
tags: bb
|
||||
|
||||
- name: Set install mode to install
|
||||
set_fact: bb_install_mode='install'
|
||||
when: not bb_bin.stat.exists
|
||||
tags: bb
|
||||
|
||||
- name: Detect installed version
|
||||
block:
|
||||
- shell: bb --version | perl -ne 'm/babashka\s+v(\d+(\.\d+)*)/ && print "$1"'
|
||||
changed_when: False
|
||||
register: bb_current_version
|
||||
- set_fact: bb_current_version={{ bb_current_version.stdout }}
|
||||
tags: bb
|
||||
|
||||
- name: Set install mode to upgrade
|
||||
set_fact: bb_install_mode='upgrade'
|
||||
when: bb_current_version != bb_version
|
||||
tags: bb
|
||||
|
25
roles/babashka/tasks/install.yml
Normal file
25
roles/babashka/tasks/install.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
|
||||
- when: bb_install_mode != 'none'
|
||||
block:
|
||||
|
||||
- name: Download babashka archive
|
||||
get_url:
|
||||
url: "{{ bb_archive_url }}"
|
||||
dest: /tmp/
|
||||
checksum: sha256:{{ bb_archive_sha256 }}
|
||||
|
||||
- name: Extract archive
|
||||
unarchive:
|
||||
src: /tmp/babashka-{{ bb_version }}-linux-amd64-static.tar.gz
|
||||
dest: /tmp/
|
||||
remote_src: True
|
||||
|
||||
- name: Install babashka binary
|
||||
copy:
|
||||
src: /tmp/bb
|
||||
dest: /usr/local/bin/bb
|
||||
remote_src: True
|
||||
mode: 755
|
||||
|
||||
tags: bb
|
5
roles/babashka/tasks/main.yml
Normal file
5
roles/babashka/tasks/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
|
||||
- include: facts.yml
|
||||
- include: install.yml
|
||||
- include: cleanup.yml
|
Reference in New Issue
Block a user