---
- hosts: local
gather_facts: no
vars_prompt:
- name: dest_env
prompt: "Enter the destination ENV to be installed (eg. dev, qa or default: prd)? "
default: ""
private: no
when: dest_env is not defined
- name: src_env
prompt: "Enter the source ENV to use as the base for packages (eg. dev, qa or default: prd)? "
default: "prd"
private: no
when: src_env is not defined
- name: force
prompt: "Would you like to force all packages to be re-deployed? "
default: "no"
private: no
when: force is not defined
- name: confirmation
prompt: "Are you sure you want to run this playbook for PRODUCTION? Answer with 'YES'"
default: "NO"
private: no
when: dest_env == "prd"
vars:
ensure_packages:
- app: "test"
tasks:
# - include_vars: ../../vault/{{ tower_user_name|default(lookup('env','USER')) }}.yml
- name: Check confirmation
fail: msg="Playbook run confirmation failed"
when: confirmation != "YES" and dest_env == "prd"
- name: deploy the specified applications and their associated dependencies
# ignore_errors: yes
pause:
seconds: "5"
with_items: ensure_packages