--- - 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 != version - manage_upgrade | default(True)