Files
product-demos/roles/deploy_application/tasks/deploy_application.yml
ipvsean fdfe937462 MVP
2020-02-24 14:29:00 -05:00

32 lines
845 B
YAML

---
- name: application deployment
hosts: webservers
gather_facts: false
become: yes
tasks:
- name: make sure application is not empty
assert:
that:
- "application != ''"
- name: printing to terminal application information
debug:
msg: "This Ansible Playbook will install {{application}}"
- name: install application
yum:
name: "{{application}}"
use_backend: yum
allow_downgrade: true
register: result
- name: printing to terminal application information
debug:
msg: "The application: {{application}} has been installed"
when: result.changed|bool
- name: printing to terminal application information
debug:
msg: "The application: {{application}} was already installed"
when: not result.changed|bool