mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-10-08 07:25:14 +02:00
Update to 2022-07-21 01:00
This commit is contained in:
55
roles/nomad/tasks/install.yml
Normal file
55
roles/nomad/tasks/install.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
|
||||
- name: Install needed tools
|
||||
package:
|
||||
name:
|
||||
- tar
|
||||
- zstd
|
||||
- unzip
|
||||
tags: nomad
|
||||
|
||||
- when: nomad_install_mode != 'none'
|
||||
block:
|
||||
- name: Download nomad
|
||||
get_url:
|
||||
url: "{{ nomad_archive_url }}"
|
||||
dest: "{{ nomad_root_dir }}/tmp"
|
||||
checksum: sha256:{{ nomad_archive_sha256 }}
|
||||
|
||||
- name: Extract the archive
|
||||
unarchive:
|
||||
src: "{{ nomad_root_dir }}/tmp/nomad_{{ nomad_version }}_linux_amd64.zip"
|
||||
dest: "{{ nomad_root_dir }}/tmp"
|
||||
remote_src: True
|
||||
|
||||
- name: Install nomad binary
|
||||
copy:
|
||||
src: "{{ nomad_root_dir }}/tmp/nomad"
|
||||
dest: "{{ nomad_root_dir }}/bin/nomad"
|
||||
remote_src: True
|
||||
mode: 755
|
||||
|
||||
- name: Link in /usr/local/bin
|
||||
file: src={{ nomad_root_dir }}/bin/nomad dest=/usr/local/bin/nomad state=link force=True
|
||||
|
||||
tags: nomad
|
||||
|
||||
- name: Install bash completion support
|
||||
copy:
|
||||
content: |
|
||||
complete -C {{ nomad_root_dir }}/bin/nomad nomad
|
||||
dest: /etc/bash_completion.d/nomad
|
||||
mode: 755
|
||||
tags: nomad
|
||||
|
||||
- name: Deploy systemd service unit
|
||||
template: src=nomad.service.j2 dest=/etc/systemd/system/nomad.service
|
||||
register: nomad_unit
|
||||
notify: restart nomad
|
||||
tags: nomad
|
||||
|
||||
- name: Reload systemd
|
||||
systemd: daemon_reload=True
|
||||
when: nomad_unit.changed
|
||||
tags: nomad
|
||||
|
Reference in New Issue
Block a user