Install Deno for strfry-policies.

This commit is contained in:
Brian Lee 2023-08-03 08:49:38 -07:00
parent ba610b97f3
commit 26275894fa
4 changed files with 59 additions and 3 deletions

View File

@ -2,6 +2,11 @@
This Ansible Role builds and installs [strfry](https://github.com/hoytech/strfry). It is intended to be composed with a separate role to handle the web proxy configuration. This Ansible Role builds and installs [strfry](https://github.com/hoytech/strfry). It is intended to be composed with a separate role to handle the web proxy configuration.
Tested on:
* Archlinux
* Debian 11
* Ubuntu 22.04
## Requirements ## Requirements
None. None.

View File

@ -17,15 +17,18 @@
cmd: git submodule update --init cmd: git submodule update --init
chdir: "{{ ansible_env.HOME }}/src/strfry" chdir: "{{ ansible_env.HOME }}/src/strfry"
# when: git_repository.changed # when: git_repository.changed
changed_when: git_repository.changed
- name: Run make setup-golpe - name: Run make setup-golpe
ansible.builtin.command: ansible.builtin.command:
cmd: make setup-golpe cmd: make setup-golpe
chdir: "{{ ansible_env.HOME }}/src/strfry" chdir: "{{ ansible_env.HOME }}/src/strfry"
# when: git_repository.changed # when: git_repository.changed
changed_when: git_repository.changed
- name: Build strfry - name: Build strfry
ansible.builtin.command: ansible.builtin.command:
cmd: "make -j{{ strfry_make_jobs|default(1) }}" cmd: "make -j{{ strfry_make_jobs|default(1) }}"
chdir: "{{ ansible_env.HOME }}/src/strfry" chdir: "{{ ansible_env.HOME }}/src/strfry"
# when: git_repository.changed # when: git_repository.changed
changed_when: git_repository.changed

41
tasks/deno.yml Normal file
View File

@ -0,0 +1,41 @@
---
- name: Ensure unzip is installed
ansible.builtin.package:
name: unzip
state: present
- name: Ensure custom facts directory exists
ansible.builtin.file:
mode: 0755
path: /etc/ansible/facts.d
state: directory
- name: 'Detect the latest {{ app_name }} version'
ansible.builtin.uri:
url: https://api.github.com/repos/denoland/deno/releases/latest
register: deno_latest_release_tag
- name: 'Determine whether or not the latest version of {{ app_name }} is already installed'
ansible.builtin.set_fact:
install_deno: "{{ (ansible_local.deno is not defined) or \
((ansible_local.deno is defined) and \
(ansible_local['deno']['settings']['version'] != deno_latest_release_tag.json.tag_name | replace('v',''))) }}"
- name: 'Ensure {{ app_name }} is installed'
unarchive:
src: 'https://github.com/denoland/deno/releases/download/{{ deno_latest_release_tag.json.tag_name }}/deno-x86_64-unknown-linux-gnu.zip'
dest: /usr/local/bin
mode: 0755
remote_src: true
extra_opts:
- -j
- name: 'Save meta information about the version of {{ app_name }} that was installed'
community.general.ini_file:
path: /etc/ansible/facts.d/deno.fact
mode: 0644
section: settings
option: version
value: "{{ deno_latest_release_tag.json.tag_name | replace('v','') }}"
backup: true
no_extra_spaces: true

View File

@ -6,6 +6,13 @@
- "{{ ansible_distribution }}.yml" - "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml" - "{{ ansible_os_family }}.yml"
- name: Install Deno
ansible.builtin.include_tasks:
file: deno.yml
apply:
tags: deno
become: true
- name: Install build dependencies - name: Install build dependencies
ansible.builtin.package: ansible.builtin.package:
name: "{{ strfry_build_dependencies }}" name: "{{ strfry_build_dependencies }}"