added azure mysql server

This commit is contained in:
David Rojas
2020-10-30 16:07:48 -07:00
parent 79211c4420
commit ad2bf1ac4f
6 changed files with 196 additions and 15 deletions

View File

@@ -3,22 +3,25 @@
## chose specific demo or choose all ## chose specific demo or choose all
# SPECIFIC - example that installs just the deploy_application job template # SPECIFIC - example that installs just the deploy_application job template
demo: azure_provision_vm demo: azure_mysql_server
# ALL - example that installs all demos # ALL - example that installs all demos
# demo: all # demo: all
## Ansible Tower login infomation ## Ansible Tower login infomation
my_tower_username: drojas my_tower_username: admin
my_tower_password: zapata my_tower_password: k8Eqnhe1Hn3tLw
my_tower_host: test.rhdemo.io my_tower_host: student1.4908.open.redhat.com
workshop_type: windows workshop_type: windows
# leave as false unless you are deploying an Azure Demo # leave as false unless you are deploying an Azure Demo
azure_demo: True azure_demo: True
#only uncomment these and supply values for setting up an Azure Cloud Demo which means azure_demo: True above #only uncomment these and supply values for setting up an Azure Cloud Demo which means azure_demo: True above
my_subscription: bb66f723-9eb9-405b-7889-2e722a5a5a45 my_subscription: bb66f723-9eb9-405b-8063-2e722a5a5a45
my_tenant: bbe51e50-8759-5cc6-93f7-71985d8dbddf my_tenant: bbe51e50-8759-4cc0-93f7-71985d8dbddf
my_client: 7e7d5fd3-c84b-b64c-ae96-cf474f4aa573 my_client: 7e7d5fd3-c84b-4f37-ae96-cf474f4aa573
my_secret: K1S5~EqpmvG68i8ni9-b1hmn3~yROfHM_I my_secret: K1S5~EqpmvG68iKw4w-b1hmn3~yROfHM_I

View File

@@ -0,0 +1,44 @@
---
- 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: Prepare random postfix
set_fact:
rpfx: "{{ 1000 | random }}"
run_once: yes
- 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 }}"
sku:
name: GP_Gen4_2
tier: GeneralPurpose
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 }}"

View File

@@ -3,16 +3,17 @@
hosts: lb hosts: lb
connection: local connection: local
gather_facts: false gather_facts: false
tasks: tasks:
- name: CREATE NODES - name: CREATE POOL
bigip_node: bigip_pool:
provider: provider:
server: "{{private_ip}}" server: "{{private_ip}}"
user: "{{ansible_user}}" user: "{{ansible_user}}"
password: "{{ansible_ssh_pass}}" password: "{{ansible_ssh_pass}}"
server_port: 8443 server_port: 8443
validate_certs: false validate_certs: false
host: "{{hostvars[item].ansible_host}}" name: "http_pool"
name: "{{hostvars[item].inventory_hostname}}" lb_method: "round-robin"
loop: "{{ groups['web'] }}" monitors: "/Common/http"
monitor_type: "and_list"

View File

@@ -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
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
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

View File

@@ -0,0 +1 @@

View File

@@ -1,8 +1,77 @@
--- ---
f5_new_node: f5_demo:
author: "David Rojas" author: "David Rojas"
readme: "https://github.com/ansible/product-demos/blob/master/docs/infrastructure/chocolatey_app_install.md" readme: "https://github.com/ansible/product-demos/blob/master/docs/infrastructure/chocolatey_app_install.md"
category: network category: network
job_templates:
f5_new_nodes:
name: 'F5 - add nodes'
description: 'add webserver nodes into F5 BIG-IP'
job_type: 'run'
inventory: 'Workshop Inventory'
playbook: '/playbooks/network/f5_new_node.yml'
credential: 'Workshop Credential'
survey_enabled: false
project:
name: 'Ansible Workshops Project'
description: 'official workshops from Ansible'
organization: 'Default'
scm_type: git
scm_url: 'https://github.com/davidrojas25/product-demos'
workshop_type:
- f5
- demo
f5_add_pool:
name: 'F5 - add pool'
description: 'add webserver nodes into F5 BIG-IP'
job_type: 'run'
inventory: 'Workshop Inventory'
playbook: 'playbooks/network/f5_add_pool.yml'
credential: 'Workshop Credential'
survey_enabled: false
project:
name: 'Ansible Workshops Project'
description: 'official workshops from Ansible'
organization: 'Default'
scm_type: git
scm_url: 'https://github.com/davidrojas25/product-demos'
workshop_type:
- f5
- demo
f5_add_pool_members:
name: 'F5 - add pool members'
description: 'add webserver nodes into pool'
job_type: 'run'
inventory: 'Workshop Inventory'
playbook: 'exercises/ansible_f5/1.4-add-pool-members/bigip-pool-members.yml'
credential: 'Workshop Credential'
survey_enabled: false
project:
name: 'Ansible Workshops Project'
description: 'official workshops from Ansible'
organization: 'Default'
scm_type: git
scm_url: 'https://github.com/ansible/workshops'
workshop_type:
- f5
- demo
f5_add_vip:
name: 'F5 - add virtual server'
description: 'create VIP and add pool to virtual server'
job_type: 'run'
inventory: 'Workshop Inventory'
playbook: 'exercises/ansible_f5/1.5-add-virtual-server/bigip-virtual-server.yml'
credential: 'Workshop Credential'
survey_enabled: false
project:
name: 'Ansible Workshops Project'
description: 'official workshops from Ansible'
organization: 'Default'
scm_type: git
scm_url: 'https://github.com/ansible/workshops'
workshop_type:
- f5
- demo
name: "NETWORK / f5 New Node" name: "NETWORK / f5 New Node"
description: "Define multiple new nodes" description: "Define multiple new nodes"
job_type: "run" job_type: "run"