trying alternate method

This commit is contained in:
ipvsean
2020-02-25 10:11:25 -05:00
parent 193aaabb93
commit fea4d61a04
6 changed files with 47 additions and 28 deletions

View File

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

@@ -1,27 +0,0 @@
---
- 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
- name: add deploy application job template
tower_job_template:
name: "Deploy Application (survey)"
job_type: "run"
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "roles/deploy_application/tasks/deploy_application.yml"
credential: "Demo Credential"
tower_username: "{{my_tower_username}}"
tower_password: "{{my_tower_password}}"
tower_host: "{{my_tower_host}}"
validate_certs: no
# survey_enabled: yes
# survey_spec: "{{ lookup('file', 'my_survey.json') }}"

View File

@@ -0,0 +1,30 @@
---
- 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
- name: print out values
debug:
msg: "{{demos["demo"].name}}"
# - name: add deploy application job template
# tower_job_template:
# name: "{{demos["demo"].name}}"
# job_type: "{{job_type}}"
# inventory: "{{inventory}}"
# project: "{{project}}"
# playbook: "{{playbook}}"
# credential: "{{credential}}"
# survey_enabled: "{{survey_enabled}}"
# survey_spec: "{{survey_spec}}"
# tower_username: "{{my_tower_username}}"
# tower_password: "{{my_tower_password}}"
# tower_host: "{{my_tower_host}}"
# validate_certs: no