-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) Fork the Deno role until ProfessorManhattan/ansible-deno#1 is f…
…ixed
- Loading branch information
1 parent
40e94a1
commit e68408c
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copied from the (broken) ansible-deno: | ||
# <https://github.com/megabyte-labs/ansible-deno/blob/3a0f96ed5049f145c3e45c8e336cf9e536af771a/tasks/install-Linux.yml> | ||
|
||
--- | ||
- name: Ensure custom facts directory exists | ||
file: | ||
mode: 0755 | ||
path: /etc/ansible/facts.d | ||
state: directory | ||
|
||
- name: "Detect the latest {{ app_name }} version" | ||
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" | ||
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 | ||
when: install_deno | ||
|
||
- 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 | ||
when: install_deno |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# @action Installs Deno | ||
# Ensures Deno is installed on macOS, Linux, and Windows systems | ||
- name: Include tasks based on the operating system | ||
become: true | ||
block: | ||
- include_tasks: "install.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
app_name: Deno |