Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
739 B

---
- set_fact: install_mode='none'
- set_fact: current_version=''
- name: Check if app is installed
stat: path={{ root_dir }}/meta/ansible_version
register: version_file
- name: Check installed version
slurp: src={{ root_dir }}/meta/ansible_version
register: current_version
when: version_file.stat.exists
- set_fact: current_version={{ current_version.content | b64decode | trim }}
when: version_file.stat.exists
- name: Set install mode to install
set_fact: install_mode='install'
when: not version_file.stat.exists
- name: Set install mode to upgrade
set_fact: install_mode='upgrade'
when:
- version_file.stat.exists
- current_version | string != version | string
- manage_upgrade | default(True)