mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-07 00:57:00 +02:00
Update to 2022-08-01 12:00
This commit is contained in:
@@ -1,12 +1,25 @@
|
||||
---
|
||||
|
||||
- name: Detect installed version
|
||||
block:
|
||||
- import_tasks: ../includes/webapps_set_install_mode.yml
|
||||
vars:
|
||||
- root_dir: "{{ nomad_root_dir }}"
|
||||
- version: "{{ nomad_version }}"
|
||||
- set_fact: nomad_install_mode={{ install_mode | default('none') }}
|
||||
- set_fact: nomad_current_version={{ current_version | default('') }}
|
||||
- set_fact: nomad_install_mode='none'
|
||||
tags: nomad
|
||||
|
||||
- name: Detect if nomad is installed
|
||||
stat: path=/usr/local/bin/nomad
|
||||
register: nomad_bin
|
||||
tags: nomad
|
||||
|
||||
- when: not nomad_bin.stat.exists
|
||||
set_fact: nomad_install_mode='install'
|
||||
tags: nomad
|
||||
|
||||
- when: nomad_bin.stat.exists
|
||||
block:
|
||||
- name: Detect installed version
|
||||
shell: /usr/local/bin/nomad version | perl -pe 's/Nomad v(\d+(\.\d+)*)\s.*/$1/'
|
||||
changed_when: False
|
||||
register: nomad_current_version
|
||||
- set_fact: nomad_current_version={{ nomad_current_version.stdout }}
|
||||
tags: nomad
|
||||
|
||||
- when: nomad_bin.stat.exists and nomad_current_version != nomad_version
|
||||
set_fact: nomad_install_mode='upgrade'
|
||||
|
Reference in New Issue
Block a user