trying alternate method
This commit is contained in:
31
playbooks/01_deploy_application.yml
Normal file
31
playbooks/01_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
|
||||
13
playbooks/group_vars/all.yml
Normal file
13
playbooks/group_vars/all.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
demos:
|
||||
deploy_application:
|
||||
name: "Deploy Application (survey)"
|
||||
job_type: "run"
|
||||
inventory: "Workshop Inventory"
|
||||
project: "Ansible official demo project"
|
||||
playbook: "01_deploy_application.yml"
|
||||
credential: "Demo Credential"
|
||||
survey_enabled: yes
|
||||
survey_spec: "{{ lookup('file', 'my_survey.json') }}"
|
||||
workshop_type:
|
||||
- f5
|
||||
- rhel
|
||||
@@ -8,4 +8,4 @@
|
||||
|
||||
- name: install demo
|
||||
include_role:
|
||||
name: "../roles/deploy_application"
|
||||
name: "../roles/install_demo"
|
||||
Reference in New Issue
Block a user