added azure mysql server
This commit is contained in:
44
playbooks/infrastructure/azure_mysql_server.yml
Normal file
44
playbooks/infrastructure/azure_mysql_server.yml
Normal 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 }}"
|
||||
@@ -3,16 +3,17 @@
|
||||
hosts: lb
|
||||
connection: local
|
||||
gather_facts: false
|
||||
|
||||
|
||||
tasks:
|
||||
- name: CREATE NODES
|
||||
bigip_node:
|
||||
- name: CREATE POOL
|
||||
bigip_pool:
|
||||
provider:
|
||||
server: "{{private_ip}}"
|
||||
user: "{{ansible_user}}"
|
||||
password: "{{ansible_ssh_pass}}"
|
||||
server_port: 8443
|
||||
validate_certs: false
|
||||
host: "{{hostvars[item].ansible_host}}"
|
||||
name: "{{hostvars[item].inventory_hostname}}"
|
||||
loop: "{{ groups['web'] }}"
|
||||
name: "http_pool"
|
||||
lb_method: "round-robin"
|
||||
monitors: "/Common/http"
|
||||
monitor_type: "and_list"
|
||||
Reference in New Issue
Block a user