mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-04 07:37:20 +02:00
Update to 2022-08-19 16:00
This commit is contained in:
35
roles/linstor_gateway/tasks/facts.yml
Normal file
35
roles/linstor_gateway/tasks/facts.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
|
||||
# Load distribution specific variables
|
||||
- include_vars: "{{ item }}"
|
||||
with_first_found:
|
||||
- "{{ role_path }}/vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||
- "{{ role_path }}/vars/{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
|
||||
- "{{ role_path }}/vars/{{ ansible_distribution }}.yml"
|
||||
- "{{ role_path }}/vars/{{ ansible_os_family }}.yml"
|
||||
tags: drbd
|
||||
|
||||
- set_fact: lingw_install_mode='none'
|
||||
tags: drbd
|
||||
|
||||
- name: Check if linstor-gateway is installed
|
||||
stat: path=/usr/local/bin/linstor-gateway
|
||||
register: lingw_bin
|
||||
tags: drbd
|
||||
|
||||
- when: not lingw_bin.stat.exists
|
||||
set_fact: lingw_install_mode='install'
|
||||
tags: drbd
|
||||
|
||||
- when: lingw_bin.stat.exists
|
||||
block:
|
||||
- name: Detect installed version
|
||||
shell: linstor-gateway version | perl -ne 'm/version (\d+(\.\d+)*)/ && print "$1\n"'
|
||||
changed_when: False
|
||||
register: lingw_current_version
|
||||
- set_fact: lingw_current_version={{ lingw_current_version.stdout }}
|
||||
tags: drbd
|
||||
|
||||
- when: lingw_bin.stat.exists and lingw_current_version != lingw_version
|
||||
set_fact: lingw_install_mode='upgrade'
|
||||
tags: drbd
|
Reference in New Issue
Block a user