This commit is contained in:
ipvsean
2020-02-24 14:29:00 -05:00
parent 92b7d6f4b0
commit fdfe937462
7 changed files with 80 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
---
- 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

View File

@@ -0,0 +1,18 @@
---
- name: setup deploy_application.yml demo
hosts: localhost
gather_facts: false
become: yes
tasks:
- name: add tower project
tower_project:
name: "Ansible official demo project"
description: "prescriptive demos from Red Hat Management Buisness Unit"
organization: "Default"
scm_type: git
scm_url: https://github.com/ansible/product-demos
tower_username: "{{my_tower_username}}"
tower_password: "{{my_tower_password}}"
tower_host: "{{my_tower_host}}"
validate_certs: no