mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-04 07:37:20 +02:00
Update to 2023-07-08 16:00
This commit is contained in:
46
roles/nomad_bin/tasks/install.yml
Normal file
46
roles/nomad_bin/tasks/install.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
|
||||
- name: Install needed tools
|
||||
package:
|
||||
name: "{{ nomad_packages }}"
|
||||
tags: nomad
|
||||
|
||||
# Migrate from the old nomad role
|
||||
- name: Check if nomad is a link
|
||||
stat: path=/usr/local/bin/nomad
|
||||
register: nomad_link
|
||||
tags: vault
|
||||
|
||||
- when: nomad_link.stat.islnk is defined and nomad_link.stat.islnk
|
||||
block:
|
||||
- name: Remove nomad link
|
||||
file: path=/usr/local/bin/nomad state=absent
|
||||
- set_fact: nomad_install_mode='upgrade'
|
||||
tags: vault
|
||||
|
||||
- when: nomad_install_mode != 'none'
|
||||
block:
|
||||
- name: Download nomad
|
||||
get_url:
|
||||
url: "{{ nomad_archive_url }}"
|
||||
dest: /tmp
|
||||
checksum: sha256:{{ nomad_archive_sha256 }}
|
||||
|
||||
- name: Extract the archive
|
||||
unarchive:
|
||||
src: "/tmp/nomad_{{ nomad_version }}_linux_amd64.zip"
|
||||
dest: /usr/local/bin
|
||||
include: nomad
|
||||
mode: 755
|
||||
remote_src: True
|
||||
|
||||
tags: nomad
|
||||
|
||||
- name: Install bash completion support
|
||||
copy:
|
||||
content: |
|
||||
complete -C /usr/local/bin/nomad nomad
|
||||
dest: /etc/bash_completion.d/nomad
|
||||
mode: 0644
|
||||
tags: nomad
|
||||
|
Reference in New Issue
Block a user