Browse Source

[FIX] manual isntallation upgrade path

master
Justin Lecher 3 weeks ago
parent
commit
b40f70db15
  1. 54
      roles/nomad/tasks/manual.yml

54
roles/nomad/tasks/manual.yml

@ -11,26 +11,38 @@
shell: /usr/sbin/nologin
system: yes
- name: Install deployment deps
apt:
name:
- unzip
- name: Test if nomad is installed
stat:
path: /usr/local/bin/nomad
register: st
- name: Install nomad
unarchive:
# yamllint disable-line rule:line-length
src: "https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_{{ nomad_arch_map[ansible_architecture] }}.zip"
remote_src: yes
dest: /usr/local/bin
creates: /usr/local/bin/nomad
mode: '0755'
notify: Restart nomad
- name: Check nomad version
command: nomad version
register: nomad_version_cmd
when: st.stat.exists
- name: Install Nomad Systemd Unit
template:
src: nomad.service.j2
dest: /etc/systemd/system/nomad.service
mode: '0644'
notify:
- Systemd Daemon Reload
- Restart nomad
- name: Upgrade nomad
block:
- name: Install deployment deps
apt:
name:
- unzip
- name: Install nomad
unarchive:
# yamllint disable-line rule:line-length
src: "https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_{{ nomad_arch_map[ansible_architecture] }}.zip"
remote_src: yes
dest: /usr/local/bin
mode: '0755'
notify: Restart nomad
- name: Install Nomad Systemd Unit
template:
src: nomad.service.j2
dest: /etc/systemd/system/nomad.service
mode: '0644'
notify:
- Systemd Daemon Reload
- Restart nomad
when: nomad_version_cmd is not search(nomad_version)
Loading…
Cancel
Save