Merge pull request #13 from davidrojas25/master
New Azure MySQL database demo plus small typo correction on azure_provision_vm
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,4 +2,5 @@
|
||||
sean_login_info.yml
|
||||
.DS_Store
|
||||
choose_demo.yml
|
||||
choose_demo_example_azure.yml
|
||||
.ansible.cfg
|
||||
|
||||
@@ -22,3 +22,6 @@ my_tenant: bbe51e50-8759-5cc6-93f7-71985d8dbddf
|
||||
my_client: 7e7d5fd3-c84b-b64c-ae96-cf474f4aa573
|
||||
my_secret: K1S5~EqpmvG68i8ni9-b1hmn3~yROfHM_I
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
103
docs/infrastructure/azure_mysql_server.md
Normal file
103
docs/infrastructure/azure_mysql_server.md
Normal file
@@ -0,0 +1,103 @@
|
||||
# Demo: Azure MySQL Server
|
||||
|
||||
[Click here to return to master demo list](../../README.md#demo-repository)
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Objective](#objective)
|
||||
* [What business problem is solved?](#what-business-problem-is-solved)
|
||||
* [Features show cased](#features-show-cased)
|
||||
* [Video](#video)
|
||||
* [Guide](#guide)
|
||||
|
||||
# Objective
|
||||
|
||||
Demostrate how anisble can be used to provision a MySQL server and Database in the Azure Cloud
|
||||
|
||||
# What business problem is solved?
|
||||
|
||||
- **speed to market**:
|
||||
reducing human time to provision a database
|
||||
- **reduce human error**:
|
||||
standardize and automation a complex set of steps to reduce human errors
|
||||
- **reduce complexity**:
|
||||
does not require a System Administrator familiar with any cloud provider or its interface in order to provision any resources
|
||||
|
||||
|
||||
# Features show cased
|
||||
|
||||
- Push button cloud provisioning
|
||||
- Self Service IT - Surveys
|
||||
|
||||
For description of these and other features of the Red Hat Ansible Automation Platform please refer to the [features README](../features.md)
|
||||
|
||||
# Video
|
||||
|
||||
Coming Soon
|
||||
|
||||
# Installing Demo
|
||||
|
||||
1. You will need to create a Service Principal following these [Azure Docs instructions](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal)
|
||||
|
||||
2. Then set the azure_demo variable to True. As well as provide the folowing variable values before loading this demo as shown below.
|
||||
- azure_demo: True
|
||||
- my_subscription:
|
||||
- my_tenant:
|
||||
- my_client:
|
||||
- my_secret:
|
||||
|
||||
See sample file named choose_demo_example_azure.yml
|
||||
|
||||
# Guide
|
||||
|
||||
1. Login to Ansible Platform UX
|
||||
|
||||
2. Navigate to **Templates**
|
||||
|
||||

|
||||
|
||||
3. Click the rocket next to **INFRASTRUCTURE / Azure create a MySQL Server** to launch the Job
|
||||
|
||||

|
||||
|
||||
4. The survey will prompt you to define the resource group, Azure region, name MySQL database, and admin login for database.
|
||||
|
||||

|
||||
|
||||
5. Enter values and press **NEXT**
|
||||
|
||||

|
||||
|
||||
Explain to audience what is happening here depending on audience persona
|
||||
|
||||
**Persona A**: Technical audience that has written Ansible Playbooks before:
|
||||
Ansible can be used for more than on prem infrustructure it can also be used to provision many resource on the public clouds. Surveys create variables that the Job can use within Ansible Playbooks. This gives you the ability to create one playbook that can be used for reoccuring database provisioning in various Azure regions instead of a job template for each region or mySQL provisioned. Again saving you time and effort to write seperate playbooks for each use case. In the screenshot you will see the variables are named **resource_group**, **location**, **sqlserver_name**, **admin_pw**, **and adminuser** with the values you entered
|
||||
|
||||
**Persona B**: Decision maker audience, IT manager or above:
|
||||
reiterate business values above. This allows a non Azure Cloud expert the ability to automate routine tasks within a cloud environment. They can't provision servers that are not vetted and put within the job template or to locations that are not preapproved within the Survey. Freeing them from the mundance and repeative task of datebase provisioning while maintaining the highest level of security and compliance across your organization. In the event that your IT process does not allow the Red Hat Ansible Automation Platform to be the front end, it has a rich and powerful API that can work with existing workflows such as ServiceNow.
|
||||
|
||||
6. Execute the job by pressing the green **LAUNCH** button
|
||||
|
||||
7. Explain what is happening:
|
||||
|
||||
- Job has started executed in the background. The user can navigate off this page and the job will continue to execute.
|
||||
- On the left is the **Job Details Pane** labeled simply with **DETAILS**. This information is logged and tells you who, what, when and how.
|
||||
- **who** - who launched the job, in this example is the admin user
|
||||
- **what** - the project and Ansible Playbook used, and which credential to login to the infrastructure
|
||||
- **when** - time stamps for start, end and duration of the job run.
|
||||
- **how** - the job status (pass, fail), enviornment and execution node
|
||||
- The larger window on the right is the **Standard Out Pane**. This provides the same console output the user would be used to on the command-line for troubleshooting purposes. Some important takeways to showcase are:
|
||||
- aggregate info is at the top including the amount of Plays, tasks, hosts and time duration.
|
||||
- this pane can be expanded to take up entire browser window
|
||||
- Ansible Playbook can be downloaded for troubleshooting purposes
|
||||
- **click on task output** to show them task-by-task JSON output that can be used for troubleshooting or just getting additional information
|
||||

|
||||
|
||||
8. Circle back and summarize
|
||||
|
||||
You need to circle back what has been showcased to the [business reasons listed above](#what-business-problem-is-solved). You are welcome to verify on the Azure Portal that the MySQL server database was actually provisioned but unless you have a very technical audience you are going to start losing folks. The real business solution here is automating away the mundane and repetative.
|
||||
|
||||
|
||||
|
||||
---
|
||||
You have finished this demo. [Click here to return to master demo list](../../README.md#demo-repository)
|
||||
@@ -19,7 +19,7 @@ Demostrate how anisble can be used to provision a RHEL VM in the Azure Cloud
|
||||
- **speed to market**:
|
||||
reducing human time to provision VMs
|
||||
- **reduce human error**:
|
||||
stadardize and automation a complex set of steps to reduce human errors
|
||||
standardize and automation a complex set of steps to reduce human errors
|
||||
- **reduce complexity**:
|
||||
does not require a System Administrator familiar with any cloud provider or its interface in order to provision any resources
|
||||
|
||||
@@ -46,7 +46,7 @@ Coming Soon
|
||||
- my_client:
|
||||
- my_secret:
|
||||
|
||||
See sample file named choose_demmo_example_azure.yml
|
||||
See sample file named choose_demo_example_azure.yml
|
||||
|
||||
# Guide
|
||||
|
||||
@@ -71,7 +71,7 @@ Coming Soon
|
||||
Explain to audience what is happening here depending on audience persona
|
||||
|
||||
**Persona A**: Technical audience that has written Ansible Playbooks before:
|
||||
Ansible can be used for more than on prem infrustructure it can also be used to provision many resource on the public clouds. Surveys create variables that the Job can use within Ansible Playbooks. This gives you the ability to create one playbook that can be used for reoccuring RHEL provisioning in various Aure regions instead of a job template for each region or VM provisioned. Again saving you time and effort to write seperate playbooks for each use case. In the screenshot you will see the variables are named **resource_group**, **location**, and **vm_name** with the values of testdemorg7, eastus, and test-server07.
|
||||
Ansible can be used for more than on prem infrustructure it can also be used to provision many resource on the public clouds. Surveys create variables that the Job can use within Ansible Playbooks. This gives you the ability to create one playbook that can be used for reoccuring RHEL provisioning in various Azure regions instead of a job template for each region or VM provisioned. Again saving you time and effort to write seperate playbooks for each use case. In the screenshot you will see the variables are named **resource_group**, **location**, and **vm_name** with the values of testdemorg7, eastus, and test-server07.
|
||||
|
||||
**Persona B**: Decision maker audience, IT manager or above:
|
||||
reiterate business values above. This allows a non Azure Cloud expert the ability to automate routine tasks within a cloud environment. They can't provision servers that are not vetted and put within the job template or to locations that are not preapproved within the Survey. Freeing them from the mundance and repeative task of VM provisioning while maintaining the highest level of security and compliance across your organization. In the event that your IT process does not allow the Red Hat Ansible Automation Platform to be the front end, it has a rich and powerful API that can work with existing workflows such as ServiceNow.
|
||||
|
||||
BIN
images/azure_mysql_server/azure_mysql_survey.jpeg
Normal file
BIN
images/azure_mysql_server/azure_mysql_survey.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
BIN
images/azure_mysql_server/azure_mysql_survey_preview.jpeg
Normal file
BIN
images/azure_mysql_server/azure_mysql_survey_preview.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
BIN
images/azure_mysql_server/azure_mysql_task_output.jpeg
Normal file
BIN
images/azure_mysql_server/azure_mysql_task_output.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
44
playbooks/infrastructure/azure_mysql_server.yml
Normal file
44
playbooks/infrastructure/azure_mysql_server.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
tasks:
|
||||
- name: Prepare random postfix
|
||||
set_fact:
|
||||
rpfx: "{{ 1000 | random }}"
|
||||
run_once: yes
|
||||
|
||||
- hosts: localhost
|
||||
|
||||
vars:
|
||||
resource_group: "{{ resource_group_name }}"
|
||||
location: "{{ azure_region }}"
|
||||
mysqlserver_name: mysql{{ rpfx }}
|
||||
mysqldb_name: "{{ sqlserver_name }}"
|
||||
admin_username: "{{ admin_user }}"
|
||||
admin_password: "{{ admin_pw }}"
|
||||
|
||||
collections:
|
||||
- azure.azcollection
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Create a resource group
|
||||
azure_rm_resourcegroup:
|
||||
name: "{{ resource_group }}"
|
||||
location: "{{ location }}"
|
||||
|
||||
- name: Create MySQL Server
|
||||
azure_rm_mysqlserver:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ mysqlserver_name }}"
|
||||
location: "{{ location }}"
|
||||
version: 5.6
|
||||
enforce_ssl: True
|
||||
admin_username: "{{ admin_username }}"
|
||||
admin_password: "{{ admin_password }}"
|
||||
storage_mb: 51200
|
||||
|
||||
- name: Create instance of MySQL Database
|
||||
azure_rm_mysqldatabase:
|
||||
resource_group: "{{ resource_group }}"
|
||||
server_name: "{{ mysqlserver_name }}"
|
||||
name: "{{ mysqldb_name }}"
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
azure_mysql_server:
|
||||
author: "David Rojas"
|
||||
readme: "https://github.com/ansible/product-demos/blob/master/docs/infrastructure/azure_provision_vm.md"
|
||||
category: infrastructure
|
||||
name: "INFRASTRUCTURE / Azure create a MySQL Server"
|
||||
description: "Provision MySQL server on Azure with Ansible Tower Survey and Environmental variables"
|
||||
job_type: "run"
|
||||
inventory: "Workshop Inventory"
|
||||
playbook: "playbooks/infrastructure/azure_mysql_server.yml"
|
||||
credential: "azure_credential"
|
||||
survey_enabled: true
|
||||
survey_spec:
|
||||
name: Azure mysql server
|
||||
description: Provisioning a mySQL server in Azure
|
||||
spec:
|
||||
- type: text
|
||||
question_name: Enter name of your resource group
|
||||
question_description: This can be an existing or new resource group
|
||||
variable: resource_group
|
||||
required: true
|
||||
#default:
|
||||
|
||||
- type: multiplechoice
|
||||
question_name: What Azure region do you want to host your VM
|
||||
question_description: Select one from the drop-down
|
||||
variable: location
|
||||
required: true
|
||||
default: eastus
|
||||
choices:
|
||||
- eastus
|
||||
- eastus2
|
||||
- westus
|
||||
- centralus
|
||||
|
||||
- type: text
|
||||
question_name: Enter the name of MySQL Server Database
|
||||
question_description: You can't use any special characters or whitesapces
|
||||
variable: sqlserver_name
|
||||
required: true
|
||||
#default:
|
||||
|
||||
- type: text
|
||||
question_name: Set the name of the Admin user
|
||||
question_description: This will be used to login to your mySql. Do not use Admin or other reserved names
|
||||
variable: admin_user
|
||||
required: true
|
||||
|
||||
- type: password
|
||||
question_name: Set the admin password to use
|
||||
question_description: This will be used to login to your mySQL. Must be at least 8 characters long, must contain upper adn lower case, numbers, and special character.
|
||||
variable: admin_pw
|
||||
required: true
|
||||
#video: "https://www.youtube.com/watch?v=pU8ZgSBuEJw&list=PLdu06OJoEf2bp-PNtxPP_2n7Avkax8TED"
|
||||
project:
|
||||
name: "Ansible official demo project"
|
||||
description: "prescriptive demos from Red Hat Management Business Unit"
|
||||
organization: "Default"
|
||||
scm_type: git
|
||||
scm_url: "https://github.com/davidrojas25/product-demos"
|
||||
workshop_type:
|
||||
- windows
|
||||
- demo
|
||||
Reference in New Issue
Block a user