diff --git a/choose_demo_example_azure.yml b/choose_demo_example_azure.yml index 51753c1..534f015 100644 --- a/choose_demo_example_azure.yml +++ b/choose_demo_example_azure.yml @@ -3,22 +3,25 @@ ## chose specific demo or choose all # SPECIFIC - example that installs just the deploy_application job template -demo: azure_provision_vm +demo: azure_mysql_server # ALL - example that installs all demos # demo: all ## Ansible Tower login infomation -my_tower_username: drojas -my_tower_password: zapata -my_tower_host: test.rhdemo.io +my_tower_username: admin +my_tower_password: k8Eqnhe1Hn3tLw +my_tower_host: student1.4908.open.redhat.com workshop_type: windows + # leave as false unless you are deploying an Azure Demo azure_demo: True #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_tenant: bbe51e50-8759-5cc6-93f7-71985d8dbddf -my_client: 7e7d5fd3-c84b-b64c-ae96-cf474f4aa573 -my_secret: K1S5~EqpmvG68i8ni9-b1hmn3~yROfHM_I +my_subscription: bb66f723-9eb9-405b-8063-2e722a5a5a45 +my_tenant: bbe51e50-8759-4cc0-93f7-71985d8dbddf +my_client: 7e7d5fd3-c84b-4f37-ae96-cf474f4aa573 +my_secret: K1S5~EqpmvG68iKw4w-b1hmn3~yROfHM_I + + diff --git a/playbooks/infrastructure/azure_mysql_server.yml b/playbooks/infrastructure/azure_mysql_server.yml new file mode 100644 index 0000000..175af1b --- /dev/null +++ b/playbooks/infrastructure/azure_mysql_server.yml @@ -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 }}" \ No newline at end of file diff --git a/playbooks/network/new_node.yml b/playbooks/network/f5_add_pool.yml similarity index 60% rename from playbooks/network/new_node.yml rename to playbooks/network/f5_add_pool.yml index b0f16c0..b33c0c8 100644 --- a/playbooks/network/new_node.yml +++ b/playbooks/network/f5_add_pool.yml @@ -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'] }}" \ No newline at end of file + name: "http_pool" + lb_method: "round-robin" + monitors: "/Common/http" + monitor_type: "and_list" \ No newline at end of file diff --git a/roles/install_demo/vars/main/infrastructure/azure_mysql_server.yml b/roles/install_demo/vars/main/infrastructure/azure_mysql_server.yml new file mode 100644 index 0000000..8401ccb --- /dev/null +++ b/roles/install_demo/vars/main/infrastructure/azure_mysql_server.yml @@ -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 diff --git a/roles/install_demo/vars/main/network/f5_add_pool.yml b/roles/install_demo/vars/main/network/f5_add_pool.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/roles/install_demo/vars/main/network/f5_add_pool.yml @@ -0,0 +1 @@ + diff --git a/roles/install_demo/vars/main/network/f5_new_node.yml b/roles/install_demo/vars/main/network/f5_new_node.yml index 5a6766e..d12cc61 100644 --- a/roles/install_demo/vars/main/network/f5_new_node.yml +++ b/roles/install_demo/vars/main/network/f5_new_node.yml @@ -1,8 +1,77 @@ --- -f5_new_node: +f5_demo: author: "David Rojas" readme: "https://github.com/ansible/product-demos/blob/master/docs/infrastructure/chocolatey_app_install.md" 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" description: "Define multiple new nodes" job_type: "run"