MVP
This commit is contained in:
31
roles/deploy_application/tasks/deploy_application.yml
Normal file
31
roles/deploy_application/tasks/deploy_application.yml
Normal 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
|
||||
18
roles/deploy_application/tasks/main.yml
Normal file
18
roles/deploy_application/tasks/main.yml
Normal 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
|
||||
Reference in New Issue
Block a user