-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from abikouo/play_doc_v1
Document collection playbooks
- Loading branch information
Showing
7 changed files
with
203 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## cloud.azure_ops.validate_deployment playbook | ||
|
||
A playbook to validate successful deployment of a web application. | ||
|
||
Variables | ||
-------------- | ||
|
||
* **azure_app_url**: (Required) URL of the Web application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## cloud.azure_ops.vmss_migrate playbook | ||
|
||
A playbook to migrate virtual machines of a web application from one Azure region to another region. | ||
|
||
Variables | ||
-------------- | ||
|
||
###### Common | ||
-------------- | ||
|
||
* **source_resource_group**: The origin resource group. Should not be equal to **destination_resource_group**. Default: `src_rg` | ||
* **source_region**: The origin Azure region. Default: `eastus` | ||
* **destination_resource_group**: The destination resource group. Should not be equal to **source_resource_group**. Default: `dst_rg` | ||
* **destination_region**: The destination Azure region. Default: `canadacentral` | ||
|
||
|
||
-------------- | ||
###### Networking | ||
-------------- | ||
|
||
* **azure_vnet_address_prefixes_cidr**: The virtual network CIDR address prefixes. Default: `['10.1.0.0/16']` | ||
* **azure_subnet_address_prefixes_cidr**: The subnet CIDR address prefixes. Default: `10.1.0.0/24` | ||
|
||
-------------- | ||
###### Virtual machines | ||
-------------- | ||
* **azure_vm_name**: Virtual machine scaleset name prefix, the name of the scaleset will be `{{ azure_vm_name }}ss`. Default: `webapp-vm-` | ||
* **azure_vm_user**: Virtual machine user. Default: `ansible` | ||
* **azure_vm_user_password**: Virtual machine user password. Default: `4fB5In3ueO7,` | ||
|
||
-------------- | ||
###### PostgreSQL | ||
-------------- | ||
* **azure_postgresql_name**: The name of the PostgreSQL server. Default: `{{ azure_resource_group | replace('_', '-') }}-dbserver` | ||
* **azure_postgresql_admin_username**: The database server admin user. Default: `ansible` | ||
* **azure_postgresql_admin_password**: The database server admin user password. Default: `4fB5In3ueO7,` | ||
* **azure_postgresql_database_instances**: The list of database instances. Default: `[{'name': 'pyapp', 'charset': 'UTF8'}]` | ||
* **azure_postgresql_firewall_rules**: The database firewall rules. Default: `[{'name': 'allow_all', 'start_ip_address': '0.0.0.0', 'end_ip_address': '255.255.255.255'}]` | ||
|
||
-------------- | ||
###### Web application | ||
-------------- | ||
|
||
* **py_application**: Object used to provide details for the web application. Contains the following: | ||
- * **env**: The python flask application environment. Default: `development` | ||
- * **admin_user**: The web application admin user. Default: `admin` | ||
- * **admin_password**: The web application admin user password: Default: `admin` | ||
- * **docker_image**: The name of the Docker image to build. Default: `pywebapp` | ||
- * **docker_dir**: Path on virtual machine where Docker files will be downloaded. Default: `/app/pyapp` | ||
- * **container_name**: The name of the container to start on the VM. Default: `myapp-container` | ||
|
||
* **application_force_init**: Whether to force application initialization, this will delete existing data from the databse. Default: `false` | ||
* **application_src**: Remote repository application source code. Default: `https://github.com/abikouo/webapp_pyflask_demo.git` | ||
* **playbook_number_forks**: number of parallel fork to use to deploy application into VM. Default: `15` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
## cloud.azure_ops.webapp playbook | ||
|
||
A playbook to deploy a web application on Azure using virtual machines. | ||
|
||
Variables | ||
-------------- | ||
|
||
###### Common | ||
-------------- | ||
|
||
* **azure_resource_group**: (Required) Resource group on/from which the web application resources will reside. | ||
* **azure_region**: An Azure location for the resources. Default: `eastus` | ||
* **azure_tags**: Dictionary of string:string pairs to assign as metadata to the resources. | ||
Default: `{'application': 'python-demo-webapp-for-ansible-cloud-team'}` | ||
|
||
-------------- | ||
###### Networking | ||
-------------- | ||
|
||
* **azure_virtual_network**: The name of the virtual network for VMs. Default: `{{ azure_resource_group }}-vnet` | ||
* **azure_vnet_address_prefixes_cidr**: The virtual network CIDR address prefixes. Default: `['10.1.0.0/16']` | ||
* **azure_subnet**: The name of the subnet inside the virtual network. Default: `{{ azure_resource_group }}-subnet` | ||
* **azure_subnet_address_prefixes_cidr**: The subnet CIDR address prefixes. Default: `10.1.0.0/24` | ||
* **azure_security_group**: The network security group name. Default: `{{ azure_resource_group }}-nsg` | ||
* **azure_load_balancer**: Object used to provide details for a load balancer. Contains the following: | ||
- **name**: Name of the load balancer. Default: `{{ azure_resource_group }}-lb` | ||
- **public_ip_name**: Name of load balancer's public ip. Default: `{{ azure_resource_group }}-lb-public-ip` | ||
- **backend_address_pool**: Name of backend address pools where network interfaces can be attached. Default: `{{ azure_resource_group }}-vm-pool` | ||
- **domain_name**: Load balancer domain name. | ||
|
||
-------------- | ||
###### Virtual machines | ||
-------------- | ||
* **azure_vm_name**: Virtual machine scaleset name prefix, the name of the scaleset will be `{{ azure_vm_name }}ss`. Default: `webapp-vm-` | ||
* **azure_vm_user**: Virtual machine user. Default: `ansible` | ||
* **azure_vm_user_password**: Virtual machine user password. Default: `4fB5In3ueO7,` | ||
* **azure_vm_image**: The image used to build the VM. See [azure.azcollection.azure_rm_virtualmachine](https://github.com/ansible-collections/azure/blob/5df571fbbb4cd83ad98b143157ae947f1d15b2d9/plugins/modules/azure_rm_virtualmachine.py#L136-L141). Default: `{'offer': 'RHEL', 'publisher': 'RedHat', 'sku': '7-LVM', 'version': 'latest'}` | ||
* **azure_vm_size**: The Azure VM size. Default: `Standard_A2` | ||
* **azure_bastion_vm_size**: The Azure VM size for the bastion VM. Default: `Standard_A1_v2` | ||
* **azure_number_vm**: The number of VM on the virtual machine scaleset. Default: `3` | ||
|
||
-------------- | ||
###### PostgreSQL | ||
-------------- | ||
* **azure_postgresql_name**: The name of the PostgreSQL server. Default: `{{ azure_resource_group | replace('_', '-') }}-dbserver` | ||
* **azure_postgresql_admin_username**: The database server admin user. Default: `ansible` | ||
* **azure_postgresql_admin_password**: The database server admin user password. Default: `4fB5In3ueO7,` | ||
* **azure_postgresql_database_instances**: The list of database instances. Default: `[{'name': 'pyapp', 'charset': 'UTF8'}]` | ||
* **azure_postgresql_firewall_rules**: The database firewall rules. Default: `[{'name': 'allow_all', 'start_ip_address': '0.0.0.0', 'end_ip_address': '255.255.255.255'}]` | ||
|
||
-------------- | ||
###### Web application | ||
-------------- | ||
|
||
* **py_application**: Object used to provide details for the web application. Contains the following: | ||
- * **env**: The python flask application environment. Default: `development` | ||
- * **admin_user**: The web application admin user. Default: `admin` | ||
- * **admin_password**: The web application admin user password: Default: `admin` | ||
- * **docker_image**: The name of the Docker image to build. Default: `pywebapp` | ||
- * **docker_dir**: Path on virtual machine where Docker files will be downloaded. Default: `/app/pyapp` | ||
- * **container_name**: The name of the container to start on the VM. Default: `myapp-container` | ||
|
||
* **application_force_init**: Whether to force application initialization, this will delete existing data from the database. Default: `false` | ||
* **application_src**: Remote repository application source code. Default: `https://github.com/abikouo/webapp_pyflask_demo.git` | ||
* **playbook_number_forks**: number of parallel fork to use to deploy application into VM. Default: `15` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
## cloud.azure_ops.webapp_container playbook | ||
|
||
A playbook to deploy a web application on Azure using containers. | ||
|
||
Variables | ||
-------------- | ||
|
||
###### Common | ||
-------------- | ||
|
||
* **azure_resource_group**: (Required) Resource group on/from which the web application resources will reside. | ||
* **azure_region**: An Azure location for the resources. Default: `eastus` | ||
* **migrate_app**: Flag for migrating from VM / creating from scratch. Default: `false` | ||
|
||
-------------- | ||
###### Networking | ||
-------------- | ||
|
||
* **azure_virtual_network**: The name of the virtual network for VMs. Default: `{{ azure_resource_group }}-vnet` | ||
* **azure_vnet_address_prefixes_cidr**: The virtual network CIDR address prefixes. Default: `['10.1.0.0/16']` | ||
* **azure_subnet**: The name of the subnet inside the virtual network. Default: `{{ azure_resource_group }}-subnet` | ||
* **azure_subnet_address_prefixes_cidr**: The subnet CIDR address prefixes. Default: `10.1.0.0/24` | ||
* **azure_security_group**: The network security group name. Default: `{{ azure_resource_group }}-nsg` | ||
* **azure_load_balancer**: Object used to provide details for a load balancer. Contains the following: | ||
- **name**: Name of the load balancer. Default: `{{ azure_resource_group }}-lb` | ||
- **public_ip_name**: Name of load balancer's public ip. Default: `{{ azure_resource_group }}-lb-public-ip` | ||
- **backend_address_pool**: Name of backend address pools where network interfaces can be attached. Default: `{{ azure_resource_group }}-vm-pool` | ||
|
||
-------------- | ||
###### Container | ||
-------------- | ||
* **azure_app_force_update**: Whether to force update of existing instance when creating container instance. Default: `false` | ||
* **azure_vm_os**: Container instance OS type. Default: `Linux` | ||
|
||
-------------- | ||
###### PostgreSQL | ||
-------------- | ||
* **azure_postgresql_name**: The name of the PostgreSQL server. Default: `{{ azure_resource_group | regex_replace('[^a-zA-Z0-9]', '-') }}-dbserver` | ||
* **azure_postgresql_admin_username**: The database server admin user. Default: `ansible` | ||
* **azure_postgresql_admin_password**: The database server admin user password. Default: `4fB5In3ueO7,` | ||
* **azure_postgresql_database_instances**: The list of database instances. Default: `[{'name': 'pyapp', 'charset': 'UTF8'}]` | ||
|
||
-------------- | ||
###### Web application | ||
-------------- | ||
|
||
* **azure_app_image**: Application Docker image. Default: `quay.io/jtorcass/pywebapp` | ||
* **azure_app_container_name**: Application container name: Default: `{{ azure_resource_group | regex_replace('[^a-zA-Z0-9]', '-') }}-container` | ||
* **azure_app_mem**: Application memory. Default: `1` | ||
* **azure_app_ports**: Application ports: Default: `[5000]` | ||
* **azure_app_env_vars**: Application environment variables. | ||
Default: | ||
```yaml | ||
- name: FLASK_APP | ||
value: /app/pyapp | ||
- name: FLASK_ENV | ||
value: development | ||
- name: DATABASE_HOST | ||
value: "{{ azure_postgresql_name }}" | ||
- name: DATABASE_INSTANCE | ||
value: "{{ azure_postgresql_database_instances[0].name }}" | ||
- name: DATABASE_USER | ||
value: "{{ azure_postgresql_admin_username }}" | ||
- name: DATABASE_PASSWORD | ||
value: "{{ azure_postgresql_admin_password }}" | ||
- name: ADMIN_USER | ||
value: admin | ||
- name: ADMIN_PASSWORD | ||
value: admin | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters