MVP
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
sean_login_info.yml
|
||||||
@@ -1 +1,7 @@
|
|||||||
# product-demos
|
# Official Ansible Product Demos
|
||||||
|
|
||||||
|
this is currently under construction and working on a minimal viable demo for testing purposes
|
||||||
|
|
||||||
|
# Contribute
|
||||||
|
|
||||||
|
please refer to the [contribute.md](docs/contribute.md) documentation included in this collection.
|
||||||
|
|||||||
9
docs/contribute.md
Normal file
9
docs/contribute.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Contribute
|
||||||
|
|
||||||
|
This project is **not** currently taking PRs (pull requests) or code contributions. This is currently a work in progress and not at a point that would make sense to take contributions. Please try to make PRs into [ansible-examples](https://github.com/ansible/ansible-examples) if you want to showcase Ansible Playbooks or roles.
|
||||||
|
|
||||||
|
# Going Further
|
||||||
|
|
||||||
|
The following links will be helpful if you want to contribute code to the Ansible Workshops project, or any Ansible project:
|
||||||
|
- [Ansible Committer Guidelines](http://docs.ansible.com/ansible/latest/committer_guidelines.html)
|
||||||
|
- [Learning Git](https://git-scm.com/book/en/v2)
|
||||||
10
playbooks/deploy_application.yml
Normal file
10
playbooks/deploy_application.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
- name: setup deploy_application.yml demo
|
||||||
|
hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
become: yes
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: Conditional role
|
||||||
|
include_role:
|
||||||
|
name: "{{playbook_dir}}/../deploy_application"
|
||||||
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
|
||||||
3
tower_login_info.yml
Normal file
3
tower_login_info.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
my_tower_username: colin
|
||||||
|
my_tower_password: mahalo
|
||||||
|
my_tower_host: test.rhdemo.io
|
||||||
Reference in New Issue
Block a user