├── .gitignore ├── ACI_Ansible ├── Complex │ ├── hosts_aci.yml │ ├── playbook_aci_create.yml │ ├── playbook_aci_delete.yml │ └── vars │ │ └── variables_aci.yml ├── MSO │ ├── hosts.yml │ ├── playbook_create_mso_tenant.yml │ └── vars │ │ └── mso_variables.yml ├── Simple │ ├── hosts_aci.yml │ ├── playbook_aci_create.yml │ ├── playbook_aci_delete.yml │ └── vars │ │ └── variables_aci.yml └── Vault │ ├── .gitignore │ ├── hosts_aci.yml │ ├── playbook_aci_create.yml │ ├── playbook_aci_delete.yml │ └── vars │ └── variables_aci.yml ├── ACI_MSO ├── authenticate.py └── get_tenants.py ├── ACI_Python_ACITookit ├── .gitignore ├── Complex │ ├── create_aci.py │ └── vars │ │ └── aci_variables.yml └── Simple │ ├── create_tenant_vrf_bd.py │ ├── create_tenant_vrf_bd_subnet.py │ └── variables.yml ├── ACI_Python_Requests ├── Complex │ ├── acicontroller.py │ ├── assign_contract.py │ ├── create_all.py │ ├── create_ap.py │ ├── create_bd.py │ ├── create_contract.py │ ├── create_epg.py │ ├── create_filter.py │ ├── create_tenant.py │ ├── create_vrf.py │ ├── delete_tenant.py │ ├── templates │ │ ├── add_ap.j2.json │ │ ├── add_bd.j2.json │ │ ├── add_contract.j2.json │ │ ├── add_epg.j2.json │ │ ├── add_filter.j2.json │ │ ├── add_tenant.j2.json │ │ ├── add_vrf.j2.json │ │ ├── assign_contract_cons.j2.json │ │ ├── assign_contract_prov.j2.json │ │ ├── delete_tenant.j2.json │ │ └── login.j2.json │ └── vars │ │ └── aci_variables.yml └── Simple │ ├── aci_login.py │ ├── create_tenant.py │ ├── delete_tenant.py │ └── get_tenants.py ├── ACI_Python_Requests_Jinja ├── aci.py ├── example.py ├── loopbacks │ ├── normal │ │ ├── loopback.py │ │ └── loopback.yml │ └── variant │ │ ├── loopback_variant.py │ │ └── loopback_variant.yml ├── templates │ ├── login.j2.json │ ├── loopback.j2 │ ├── loopback_variant.j2 │ ├── tenant.j2.json │ └── vlans.j2 └── vlans │ ├── vlan.py │ ├── vlans.yml │ ├── vlans_file.py │ ├── vlans_file_yml_file.py │ └── vlans_multiple.py ├── ACI_Terraform ├── Complex │ ├── credentials.tf │ ├── main_aci.tf │ └── variables_aci.tf └── Simple │ ├── main.tf │ ├── provider.tf │ ├── terraform.tf │ └── variables.tf ├── ACI_Terraform_Gitlab ├── .gitignore ├── .gitlab-ci_create.yml ├── .gitlab-ci_destroy.yml ├── cli_mdt.py ├── main_aci.tf ├── terraform.tf └── variables_aci.tf ├── ACI_Terraform_sequel ├── part1 │ ├── main.tf │ ├── output.tf │ ├── provider.tf │ └── variables.tf ├── part2 │ ├── main.tf │ ├── output.tf │ ├── provider.tf │ ├── terraform.tfvars │ └── variables.tf ├── part3 │ ├── main.tf │ ├── modules │ │ ├── aci_ap │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ ├── aci_bd │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ ├── aci_tenant │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ └── aci_vrf │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ ├── output.tf │ ├── provider.tf │ ├── terraform.tfvars │ └── variables.tf ├── part4 │ ├── main.tf │ ├── modules │ │ ├── aci_ap │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ ├── aci_bd │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ ├── aci_tenant │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ └── aci_vrf │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ ├── output.tf │ ├── provider.tf │ ├── terraform.tfvars │ └── variables.tf ├── part5 │ ├── main.tf │ ├── modules │ │ ├── aci_ap │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ ├── aci_bd │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ ├── aci_tenant │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ ├── aci_tenant_vrf_ap │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ └── aci_vrf │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ ├── output.tf │ ├── provider.tf │ ├── terraform.tfvars │ └── variables.tf ├── part6 │ ├── main.tf │ ├── modules │ │ ├── aci_bd │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ ├── aci_tenant │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ └── aci_tenant_vrf_ap │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ ├── output.tf │ ├── provider.tf │ ├── terraform.tfvars │ └── variables.tf ├── part7 │ ├── main.tf │ ├── modules │ │ ├── aci_bd │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ │ └── aci_tenant_vrf_ap │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── provider.tf │ │ │ └── variables.tf │ ├── output.tf │ ├── provider.tf │ ├── terraform.tfvars │ └── variables.tf └── part8 │ ├── main.tf │ ├── modules │ ├── aci_bd │ │ ├── main.tf │ │ ├── output.tf │ │ ├── provider.tf │ │ └── variables.tf │ └── aci_tenant_vrf_ap │ │ ├── main.tf │ │ ├── output.tf │ │ ├── provider.tf │ │ └── variables.tf │ ├── output.tf │ ├── provider.tf │ ├── terraform.tfvars │ └── variables.tf ├── ACI_vSphere_Terraform ├── main_aci.tf ├── main_vsphere.tf ├── variables_aci.tf └── variables_vsphere.tf ├── AWS_Kubernetes_Ansible ├── Ansible │ ├── ansible.cfg │ ├── hosts │ ├── initial.yml │ ├── kube-dependencies.yml │ ├── master.yml │ └── workers.yml └── Terraform │ ├── main.tf │ ├── provider.tf │ └── variables_AWS.tf ├── AWS_Terraform ├── main.tf ├── provider.tf └── variables_AWS.tf ├── AWS_Terraform_Gitlab ├── .gitlab-ci.yml ├── main.tf ├── provider.tf ├── terraform.tf └── variables.tf ├── AWS_Terraform_RemoteState ├── main.tf ├── provider.tf ├── terraform.tf └── variables.tf ├── Ansible_IOSXE ├── ios_modules │ ├── ansible.cfg │ ├── change_description.yaml │ ├── change_description_multipleinterface_variant.yaml │ ├── change_description_multipleinterfaces.yaml │ ├── command_show.yaml │ ├── command_show_variant1.yaml │ ├── command_show_variant2.yaml │ ├── group_vars │ │ └── iosxe.yaml │ ├── hosts │ ├── loopback_create_multiple.yaml │ ├── loopback_create_single.yaml │ ├── loopback_remove_multiple.yaml │ ├── loopback_remove_single.yaml │ └── vars │ │ ├── loopbacks.yaml │ │ └── loopbacks_interfaces.yaml ├── napalm │ ├── ansible.cfg │ ├── bijhouden.yml │ ├── create_loopback.yml │ ├── diff │ ├── get_facts.yml │ ├── group_vars │ │ └── iosxe.yaml │ ├── hosts │ ├── loopbacks.txt │ ├── show_command.yml │ ├── validate_command.yml │ └── validation.yml ├── netconf │ ├── ansible.cfg │ ├── group_vars │ │ └── iosxe.yaml │ ├── hosts │ ├── loopback_create_netconf.yaml │ └── show_command._tobechanged.yaml └── restconf │ └── Method1 │ ├── ansible.cfg │ ├── create_interfaces_restconf.yml │ ├── create_interfaces_restconf_variant.yml │ ├── delete_interfaces_restconf.yml │ ├── get_interfaces_restconf.yml │ ├── group_vars │ └── iosxe.yaml │ ├── hosts │ ├── loopback.json │ └── test.json ├── DNAC_PythonRequests ├── Assurance │ ├── authenticate.py │ └── get_client_health.py ├── CommandRunner │ ├── authenticate.py │ └── commandrunner.py ├── Devices │ ├── authenticate.py │ ├── get_devicelist.py │ └── get_interfaces.py ├── FlowAnalysis │ ├── authenticate.py │ └── flowanalysis.py ├── NetworkDiscovery │ ├── authenticate.py │ ├── run_discovery.py │ └── templates │ │ └── discovery.j2.json ├── Sites │ ├── add_assign_device.py │ ├── add_building.py │ ├── add_device.py │ ├── add_floor.py │ ├── add_site.py │ ├── add_site_building_floor.py │ ├── authenticate.py │ ├── delete_site.py │ ├── get_membership.py │ ├── get_sites.py │ └── templates │ │ ├── building.j2.json │ │ ├── dummy_device.json │ │ ├── floor.j2.json │ │ ├── site.j2.json │ │ └── site_building_floor.j2.json └── Webhooks │ ├── authenticate.py │ └── webhooks.py ├── DigitalOcean_Kubernetes_Ansible ├── Ansible │ ├── ansible.cfg │ ├── hosts │ ├── initial.yml │ ├── kube-dependencies.yml │ ├── master.yml │ └── workers.yml └── Terraform │ ├── create_server.tf │ └── variables.tf ├── ESXi_ARM_VMTools └── install_openvm_tools.sh ├── Express_Mongo_REST_API ├── app.js ├── bin │ └── www ├── config │ └── database.js ├── models │ └── todo.js ├── package.json ├── public │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ ├── todo.js │ └── users.js └── views │ ├── error.pug │ ├── index.pug │ └── layout.pug ├── Express_Mongo_REST_Angular ├── app.js ├── bin │ └── www ├── config │ └── database.js ├── models │ └── todo.js ├── package.json ├── public │ ├── controllers │ │ └── controller.js │ ├── images │ │ └── empty.js │ ├── index.html │ ├── javascript │ │ └── empty.js │ └── stylesheets │ │ └── style.css └── routes │ ├── index.js │ ├── todo.js │ └── users.js ├── Flask ├── Flask-Basic-Beanstalk │ ├── .gitignore │ ├── application.py │ ├── requirements.txt │ ├── templates │ │ └── index.html │ ├── test_application.py │ └── wsgi.py ├── Flask-Basic-CICD-GithubActions-Beanstalk │ ├── .github │ │ └── workflows │ │ │ └── main.yml │ ├── .gitignore │ ├── application.py │ ├── requirements.txt │ ├── templates │ │ └── index.html │ ├── test_application.py │ └── wsgi.py ├── Flask-Basic-CICD-GithubActions-DigitalOcean-Apps │ ├── .gitignore │ ├── README.md │ ├── app.py │ ├── gunicorn_config.py │ ├── requirements.txt │ ├── templates │ │ └── index.html │ └── wsgi.py ├── Flask-Basic-CICD-GithubActions-DigitalOcean-Droplet │ ├── .github │ │ └── workflows │ │ │ └── main.yml │ ├── .gitignore │ ├── Dockerfile │ ├── app │ │ ├── app.py │ │ ├── templates │ │ │ └── index.html │ │ └── wsgi.py │ ├── docker-compose.yml │ └── requirements.txt ├── Flask-Basic-CICD-GithubActions-DigitalOcean-K8S │ ├── .github │ │ └── workflows │ │ │ └── main.yml │ ├── Dockerfile │ ├── app │ │ ├── app.py │ │ ├── templates │ │ │ └── index.html │ │ └── wsgi.py │ ├── config │ │ └── deployment.yml │ ├── docker-compose.yml │ └── requirements.txt ├── Flask-Basic-CICD-GithubActions-Docker-ECS-herdoen │ ├── .github │ │ └── workflows │ │ │ └── main.yml │ ├── Dockerfile │ ├── app │ │ ├── app.py │ │ ├── templates │ │ │ └── index.html │ │ └── wsgi.py │ ├── aws-task-definition.json │ ├── docker-compose.yml │ └── requirements.txt ├── Flask-Basic-CICD-GithubActions-Heroku │ ├── .github │ │ └── workflows │ │ │ └── main.yml │ ├── .gitignore │ ├── Dockerfile │ ├── Procfile │ ├── app │ │ ├── app.py │ │ └── templates │ │ │ └── index.html │ ├── requirements.txt │ └── wsgi.py ├── Flask-Basic-CICD-Heroku │ ├── .gitignore │ ├── Dockerfile │ ├── Procfile │ ├── README.md │ ├── app │ │ ├── app.py │ │ └── templates │ │ │ └── index.html │ ├── requirements.txt │ └── wsgi.py ├── Flask-Basic-Docker │ ├── Dockerfile │ ├── app │ │ ├── app.py │ │ ├── templates │ │ │ └── index.html │ │ └── wsgi.py │ ├── docker-compose.yml │ └── requirements.txt ├── Flask-Basic-Heroku │ ├── .gitignore │ ├── Dockerfile │ ├── Procfile │ ├── app │ │ ├── app.py │ │ └── templates │ │ │ └── index.html │ ├── requirements.txt │ └── wsgi.py ├── Flask-Basic-Waypoint-Docker │ ├── Dockerfile │ ├── app │ │ ├── app.py │ │ ├── templates │ │ │ └── index.html │ │ └── wsgi.py │ ├── requirements.txt │ └── waypoint.hcl ├── Flask-Basic-Waypoint-ECR-ECS │ ├── Dockerfile │ ├── Procfile │ ├── app │ │ ├── app.py │ │ └── templates │ │ │ └── index.html │ ├── requirements.txt │ ├── waypoint.hcl │ └── wsgi.py ├── Flask-Basic-Waypoint-Gitlab │ ├── .gitlab-ci.yml │ ├── Dockerfile │ ├── Procfile │ ├── app │ │ ├── app.py │ │ └── templates │ │ │ └── index.html │ ├── requirements.txt │ ├── waypoint.hcl │ └── wsgi.py ├── Flask-Basic │ ├── app │ │ ├── app.py │ │ ├── templates │ │ │ └── index.html │ │ └── wsgi.py │ └── requirements.txt └── Flask-Todo-Bootstrap │ ├── .env.dev │ ├── .gitignore │ ├── docker-compose.yml │ └── web │ ├── Dockerfile │ ├── app │ ├── __init__.py │ ├── admin │ │ ├── __init__.py │ │ ├── forms.py │ │ └── routes.py │ ├── auth │ │ ├── __init__.py │ │ ├── forms.py │ │ └── routes.py │ ├── entrypoint.sh │ ├── home │ │ ├── __init__.py │ │ └── routes.py │ ├── models.py │ ├── static │ │ └── css │ │ │ └── style.css │ ├── templates │ │ ├── admin │ │ │ └── todo │ │ │ │ ├── todo.html │ │ │ │ └── todos.html │ │ ├── auth │ │ │ ├── login.html │ │ │ └── register.html │ │ ├── base.html │ │ ├── errors │ │ │ ├── 403.html │ │ │ ├── 404.html │ │ │ └── 500.html │ │ └── home │ │ │ ├── admin_dashboard.html │ │ │ ├── dashboard.html │ │ │ └── index.html │ └── todo │ │ ├── __init__.py │ │ └── routes.py │ ├── config.py │ ├── entrypoint.sh │ ├── migrations │ ├── README │ ├── alembic.ini │ ├── env.py │ ├── script.py.mako │ └── versions │ │ └── 4aaed8e460be_.py │ ├── requirements.txt │ └── run.py ├── IOSXE_ModelDrivenTelemetry ├── netconf │ ├── mdt_create_subscriptions_netconf_jinja2-variant.py │ ├── mdt_create_subscriptions_netconf_jinja2.py │ ├── mdt_create_subscriptions_netconf_xml.py │ ├── mdt_get_subscriptions_netconf.py │ ├── templates │ │ ├── netconf_mdt_jinja2-variant.j2.xml │ │ ├── netconf_mdt_jinja2.j2 │ │ └── netconf_mdt_xml.xml │ └── vars │ │ └── variables.yml ├── netmiko │ ├── mdt_create_subcriptions_netmiko.py │ ├── mdt_get_subcriptions_netmiko.py │ ├── templates │ │ └── netmiko.j2 │ └── vars │ │ └── variables.yml └── restconf │ ├── get_interfaces.py │ └── mdt_create_subscriptions_restconf.py ├── InfraAsCode └── Webserver │ ├── Amazon-CDK │ ├── .gitignore │ ├── README.md │ ├── amazon_cdk │ │ ├── __init__.py │ │ └── amazon_cdk_stack.py │ ├── app.py │ ├── cdk.context.json │ ├── cdk.json │ ├── requirements.txt │ ├── setup.py │ └── source.bat │ ├── AmazonCDK_existingVPC │ ├── .gitignore │ ├── README.md │ ├── amazon_cdk_existing_vpc │ │ ├── __init__.py │ │ └── amazon_cdk_existing_vpc_stack.py │ ├── app.py │ ├── cdk.context.json │ ├── cdk.json │ ├── requirements.txt │ ├── setup.py │ └── source.bat │ ├── AmazonCDK_newVPC │ ├── .gitignore │ ├── README.md │ ├── amazon_cdk_new_vpc │ │ ├── __init__.py │ │ └── amazon_cdk_new_vpc_stack.py │ ├── app.py │ ├── cdk.context.json │ ├── cdk.json │ ├── requirements.txt │ ├── setup.py │ └── source.bat │ ├── Pulumi_AWS_defaultVPC │ ├── .gitignore │ ├── Pulumi.yaml │ ├── __main__.py │ └── requirements.txt │ ├── Pulumi_AWS_existingVPC │ ├── .gitignore │ ├── Pulumi.yaml │ ├── __main__.py │ └── requirements.txt │ ├── Pulumi_AWS_newVPC │ ├── .gitignore │ ├── Pulumi.dev.yaml │ ├── Pulumi.yaml │ ├── __main__.py │ └── requirements.txt │ ├── Terraform │ ├── .terraform.lock.hcl │ ├── main.tf │ ├── modules │ │ └── ec2 │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ └── variables.tf │ ├── terraform.tfstate │ └── terraform.tfstate.backup │ └── TerraformCDK │ ├── .gitignore │ ├── Pipfile │ ├── Pipfile.lock │ ├── cdktf.json │ ├── help │ └── main.py ├── KVM_Kubernetes_Ansible └── Ansible │ ├── ansible.cfg │ ├── hosts │ ├── initial.yml │ ├── kube-dependencies.yml │ ├── master.yml │ └── workers.yml ├── Meraki_PythonRequests ├── getCameras.py ├── getOrganizationNetworks.py └── getSSIDs.py ├── Meraki_PythonSDK └── getOrganizations.py ├── Napalm_Introduction ├── change_config.j2 ├── change_config.py ├── change_config.yml ├── execute_commands.py ├── get_interfaces.py ├── start.py ├── validate.py └── validation.yml ├── Netconf_Python ├── capabilities.py ├── connect.py ├── edit_config_format.py ├── edit_config_jinja2.py ├── ios-xe-mgmt-latest.cisco.com.xml ├── netconf_filter_part1.py ├── netconf_filter_part2.py ├── running_config.py ├── running_config_toFile.py └── templates │ ├── interface.j2.xml │ └── interface.xml ├── Netmiko_Introduction ├── changes.txt ├── get_prompt.py ├── loopback │ ├── hosts.yml │ ├── loopback.j2 │ ├── loopback.py │ └── loopback.yml ├── netmiko_logging.py ├── set_description.py ├── set_description_textfile.py ├── show_interface_description.py ├── show_uptime.py ├── test.log └── textFSM.py ├── Netpalm_Introduction ├── get_configuration.py └── netpalm │ ├── .gitignore │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── Dockerfile │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── backend │ ├── core │ │ ├── confload │ │ │ ├── __init__.py │ │ │ └── confload.py │ │ ├── redis │ │ │ ├── __init__.py │ │ │ ├── rediz.py │ │ │ └── rediz_workers.py │ │ └── routes │ │ │ ├── __init__.py │ │ │ └── routes.py │ └── plugins │ │ ├── __init__.py │ │ ├── custom_scripts │ │ ├── __init__.py │ │ └── hello_world.py │ │ ├── getconfig │ │ ├── __init__.py │ │ └── exec_command.py │ │ ├── jinja2 │ │ ├── __init__.py │ │ └── j2.py │ │ ├── jinja2_templates │ │ ├── __init__.py │ │ ├── cisco_ios_add_ip_int.j2 │ │ ├── cisco_ios_create_vlans.j2 │ │ ├── cisco_ios_remove_ip_int.j2 │ │ ├── cisco_ios_remove_vlans.j2 │ │ ├── loopback.j2 │ │ ├── loopback_create.j2 │ │ ├── loopback_remove.j2 │ │ └── test.j2 │ │ ├── napalm │ │ ├── __init__.py │ │ └── napalm_drvr.py │ │ ├── ncclient │ │ ├── __init__.py │ │ └── ncclient_drvr.py │ │ ├── netmiko │ │ ├── __init__.py │ │ └── netmiko_drvr.py │ │ ├── ntc-templates │ │ ├── ntc-templates (WAUTERW-M-65P7's conflicted copy 2020-04-24) │ │ ├── restconf │ │ ├── __init__.py │ │ └── restconf.py │ │ ├── scriptrunner │ │ ├── __init__.py │ │ └── script.py │ │ ├── service │ │ ├── __init__.py │ │ └── service.py │ │ ├── service_templates │ │ ├── args.txt │ │ ├── boilerplate.j2 │ │ ├── ip_int_service.j2 │ │ ├── loopback.j2 │ │ ├── loopback_multiple.j2 │ │ └── vlan_service.j2 │ │ ├── setconfig │ │ ├── __init__.py │ │ └── exec_config.py │ │ └── textfsm │ │ ├── __init__.py │ │ └── template.py │ ├── config.json │ ├── docker-compose.yml │ ├── images │ ├── arch.png │ ├── netpalm.png │ ├── netpalm_concept.png │ ├── netpalm_eg_1.png │ ├── netpalm_eg_2.png │ ├── netpalm_eg_3.png │ ├── netpalm_eg_4.png │ ├── netpalm_ingest.gif │ └── netpalm_postman.png │ ├── netpalm.postman_collection.json │ ├── netpalm.py │ ├── requirements.txt │ └── tests │ ├── __init__.py │ ├── j2.py │ └── test.py ├── Nornir_Introduction ├── inventory │ ├── defaults.yml │ ├── groups.yml │ └── hosts.yml ├── nornir.log ├── nornir_config.yml ├── nornir_part1.py ├── nornir_part2.py ├── nornir_part3.py ├── nornir_part4.py └── test.py ├── Packer ├── DigitalOcean-Packer │ ├── .gitignore │ ├── digitalocean.pkr.hcl │ ├── scripts │ │ └── software_install.sh │ └── variables.pkr.hcl ├── Docker_Packer_HashicorpTools │ ├── docker-ubuntu.pkr.hcl │ ├── scripts │ │ ├── packer_install.sh │ │ └── terraform_install.sh │ └── variables.pkr.hcl ├── vSphere-Packer_20.04 │ ├── .gitignore │ ├── http │ │ ├── meta-data │ │ └── user-data │ ├── scripts │ │ ├── fix_vm_customization_bug.sh │ │ └── software_install.sh │ ├── ubuntu_20.04.pkr.hcl │ └── variables_20.04.pkr.hcl └── vSphere-Packer_22.04 │ ├── .gitignore │ ├── http │ ├── meta-data │ └── user-data │ ├── scripts │ ├── fix_vm_customization_bug.sh │ └── software_install.sh │ ├── ubuntu_22.04.pkr.hcl │ └── variables_22.04.pkr.hcl ├── Packer_Introduction ├── AWS │ ├── Simple │ │ └── aws.json │ └── WithProvisioner │ │ ├── aws.json │ │ ├── helloworld.sh │ │ └── helloworld.txt ├── DigitalOcean │ ├── do.json │ └── scripts │ │ └── nginx.sh └── vSphere │ ├── preseed.cfg │ ├── server.json │ └── variables.json ├── Paramiko_Introduction ├── ExecuteMultipleCommandsMultipleDevices.py ├── ExecuteMultipleCommandsMultipleDevicesIssue.py ├── ExecuteMultipleCommandsMultipleDevices_toFile.py ├── ExecuteSingleCommand.py ├── ExecuteSingleCommandMultipleDevices.py ├── GetDescription.py ├── SetDescription_modular.py └── connection.py ├── Parse_JSON_Python ├── parseCustomers.py ├── parseOrders.py └── sample.json ├── Parse_XML_Python ├── parseCustomers.py ├── parseOrders.py └── sample.xml ├── Parse_YAML_Python ├── parseYAML.py └── variables.yaml ├── Python_AMQP ├── receive.py └── send.py ├── Python_Coinbase_DCA ├── dca.py └── dcatest.py ├── Python_Coinmarketcap ├── .gitignore ├── coinmarket_top10.py └── coinmarket_top10_24hrPercentage.py ├── Python_Scraping_BeautifulSoup └── scrape.py ├── RestConf_Python ├── add_interfaces_cisco.py ├── change_interfaces_cisco.py ├── change_interfaces_ietf.py ├── delete_interfaces_cisco.py ├── delete_interfaces_ietf.py ├── get_interfaces_cisco.py ├── get_interfaces_ietf.py ├── get_static_routes_ietf.py └── update.py ├── SDWAN_PythonRequests ├── authenticate.py ├── bijhouden.txt ├── buildtemplate_TOFINNISH.py ├── change_password_user.py ├── create_user.py ├── get_alarms.py ├── get_auditlog.py ├── get_certificate_summary.py ├── get_certificates.py ├── get_controller_status.py ├── get_device_control_connections.py ├── get_devicecontrollers.py ├── get_stats.py ├── get_template_feature.py ├── get_templates.py ├── get_tunnel_statistics.py └── get_vEdges.py ├── Scrapli Introduction ├── example1.py ├── example2.py ├── example3.py └── response.py ├── Terraform ├── DigitalOcean-K8S │ ├── config │ ├── create_k8s.tf │ ├── variables.tf │ └── versions.tf ├── DigitalOcean-SingleDroplet │ ├── create_server.tf │ └── variables.tf ├── DigitalOcean-Terraform-LoadbalancerSetup │ ├── main.tf │ ├── provider.tf │ ├── scripts │ │ └── software_install.sh │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative │ ├── main.tf │ ├── modules │ │ ├── project │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ │ ├── record │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ │ └── server │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── scripts │ │ │ └── software_install.sh │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── outputs.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── DigitalOcean-Terraform-MultipleServers-Modules-Improved │ ├── main.tf │ ├── modules │ │ ├── project │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ │ ├── record │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ │ └── server │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── scripts │ │ │ └── software_install.sh │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── outputs.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── DigitalOcean-Terraform-MultipleServers │ ├── main.tf │ ├── provider.tf │ ├── scripts │ │ └── software_install.sh │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── DigitalOcean-Terraform-SingleServer-Modules-Improved │ ├── main.tf │ ├── modules │ │ ├── project │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ │ ├── record │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ │ └── server │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── scripts │ │ │ └── software_install.sh │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── outputs.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── DigitalOcean-Terraform-SingleServer-Modules │ ├── main.tf │ ├── modules │ │ └── server │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ ├── scripts │ │ │ └── software_install.sh │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── DigitalOcean-Terraform-SingleServer │ ├── main.tf │ ├── provider.tf │ ├── scripts │ │ └── software_install.sh │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── Import │ ├── ec2.tf │ └── variables.tf ├── MSO │ ├── .terraform.tfstate.lock.info │ ├── create_tenant_schema_2ap_1epg_ctr.tf │ ├── provider.tf │ └── variables.tf ├── Terraform_Python_Jinja2 │ ├── main.py │ ├── requirements.txt │ ├── templates │ │ └── terraform.j2 │ └── variables.yml ├── Terraform_vSphere_21.10 │ ├── main.tf │ ├── modules │ │ └── ubuntu-server │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── output.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── Terraform_vSphere_21.10_install_software │ ├── main.tf │ ├── modules │ │ └── ubuntu-server │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ ├── scripts │ │ │ ├── 01_create_user.sh │ │ │ ├── 02_install_nginx.sh │ │ │ ├── 03_install_docker.sh │ │ │ └── 04_docker_playbook.yaml │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── output.tf │ ├── ssh_keys │ │ └── ed25519_git.pub │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf └── UseCases_Terraform │ ├── UseCase1 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase10 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase11 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase12 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase13 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase2 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase3 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase4 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase5 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase6-list_of_objects │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase6 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase7 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase8-overlap │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ ├── UseCase8 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf │ └── UseCase9 │ ├── main.tf │ ├── provider.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── WebexTeams_Chatbots ├── botkit_deckofcards │ ├── .gitignore │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── assets │ │ └── images │ │ │ └── heroku_config-variables.png │ ├── bot.js │ ├── features │ │ ├── about.js │ │ ├── coffee.js │ │ ├── deckofcards.js │ │ ├── deckofcards_function.js │ │ ├── favorite.js │ │ ├── favorite_restricted.js │ │ ├── hello.js │ │ ├── help.js │ │ ├── loop.js │ │ ├── math_quiz.js │ │ ├── restricted.js │ │ ├── sample_echo.js │ │ ├── sample_hears.js │ │ ├── source.js │ │ ├── storage.js │ │ ├── threads.js │ │ ├── webex_cards.js │ │ ├── webex_features.js │ │ ├── welcome.js │ │ └── z-fallback.js │ ├── package-lock.json │ ├── package.json │ └── www │ │ ├── monitor.png │ │ └── stats.png └── python_deckofcards │ ├── aci_bot │ ├── Procfile │ ├── aci.py │ ├── chatbot.py │ ├── messenger.py │ ├── requirements.txt │ ├── templates │ │ ├── login.j2.json │ │ └── tenant.j2.json │ ├── test.json │ └── test.yaml │ ├── deckofcards_bot │ ├── Procfile │ ├── chatbot.py │ ├── messenger.py │ └── requirements.txt │ └── webexteamsbot_aci │ ├── Procfile │ ├── aci.py │ ├── chatbot.py │ ├── messenger.py │ ├── requirements.txt │ ├── templates │ ├── login.j2.json │ └── tenant.j2.json │ ├── test.json │ └── test.yaml ├── Webex_Chatbot_Messages ├── Part1 │ ├── webex_create.py │ ├── webex_delete_messages.py │ └── webex_markdown.py ├── Part2 │ ├── authenticate.py │ ├── get_devicelist.py │ └── webexteams.py ├── Part3 │ ├── Procfile │ ├── app.py │ └── requirements.txt └── Part4 │ ├── authenticate.py │ ├── get_devicelist.py │ └── webexteams.py ├── vSphere_Kubernetes_Ansible ├── Ansible │ ├── ansible.cfg │ ├── hosts │ ├── initial.yml │ ├── kube-dependencies.yml │ ├── master.yml │ └── workers.yml └── Terraform │ ├── main.tf │ └── variables.tf └── vSphere_Terraform ├── main.tf └── variables.tf /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | __pycache__/ 4 | venv/ 5 | .DS_Store 6 | .vscode 7 | .terraform 8 | -------------------------------------------------------------------------------- /ACI_Ansible/Complex/hosts_aci.yml: -------------------------------------------------------------------------------- 1 | [apic] 2 | 10.48.108.214 3 | 4 | [apic:vars] 5 | ansible_connection = local 6 | ansible_python_interpreter = /usr/bin/python3 7 | username = admin 8 | password = --- -------------------------------------------------------------------------------- /ACI_Ansible/MSO/hosts.yml: -------------------------------------------------------------------------------- 1 | [mso] 2 | 10.48.109.10 3 | 4 | [mso:vars] 5 | username=admin 6 | password=Cisco123456! 7 | ansible_python_interpreter=/usr/bin/python3 8 | 9 | -------------------------------------------------------------------------------- /ACI_Ansible/Simple/hosts_aci.yml: -------------------------------------------------------------------------------- 1 | [apic] 2 | 10.48.108.214 3 | 4 | [apic:vars] 5 | ansible_connection = local 6 | ansible_python_interpreter = /usr/bin/python3 7 | username = admin 8 | password = --- 9 | -------------------------------------------------------------------------------- /ACI_Ansible/Simple/vars/variables_aci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | tenant: "Tenant_Ansible" 3 | vrf: "VRF_Ansible" 4 | bridge_domains: 5 | - bd: "BD_Ansible" 6 | gateway: "10.16.100.1" 7 | mask: "24" 8 | scope: "shared" 9 | ap: "AP_Ansible" 10 | epgs: 11 | - epg: "EPG_Ansible" 12 | bd: "BD_Ansible" 13 | 14 | 15 | -------------------------------------------------------------------------------- /ACI_Ansible/Vault/.gitignore: -------------------------------------------------------------------------------- 1 | .vault_pass 2 | -------------------------------------------------------------------------------- /ACI_Ansible/Vault/hosts_aci.yml: -------------------------------------------------------------------------------- 1 | [apic] 2 | sandboxapicdc.cisco.com 3 | 4 | [apic:vars] 5 | ansible_connection = local 6 | ansible_python_interpreter = /usr/bin/python3 7 | username = admin 8 | password = ciscopsdt 9 | -------------------------------------------------------------------------------- /ACI_Python_ACITookit/.gitignore: -------------------------------------------------------------------------------- 1 | acitoolkit/ 2 | venv/ -------------------------------------------------------------------------------- /ACI_Python_ACITookit/Simple/variables.yml: -------------------------------------------------------------------------------- 1 | --- 2 | tenant: "Tenant_Blog" 3 | vrf: "VRF_Blog" 4 | bridge_domains: 5 | - bd: "BD_Blog" 6 | gateway: "10.16.100.1" 7 | mask: "24" 8 | scope: "shared" 9 | l3_out: "labinfra-l3out-ro" -------------------------------------------------------------------------------- /ACI_Python_Requests/Complex/templates/add_ap.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvAp": 3 | { 4 | "attributes":{ 5 | "dn":"uni/tn-{{tenant_name}}/ap-{{ap_name}}", 6 | "name":"{{ap_name}}", 7 | "rn":"ap-{{ap_name}}", 8 | "status":"created" 9 | }, 10 | "children":[] 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /ACI_Python_Requests/Complex/templates/add_epg.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvAEPg": 3 | { 4 | "attributes":{ 5 | "dn":"uni/tn-{{tenant_name}}/ap-{{ap_name}}/epg-{{epg_name}}", 6 | "name":"{{epg_name}}", 7 | "rn":"epg-{{epg_name}}", 8 | "status":"created" 9 | }, 10 | "children":[ 11 | { 12 | "fvRsBd": 13 | { 14 | "attributes": 15 | { 16 | "tnFvBDName":"{{bd_name}}", 17 | "status":"created,modified" 18 | }, 19 | "children":[] 20 | } 21 | } 22 | ] 23 | } 24 | } -------------------------------------------------------------------------------- /ACI_Python_Requests/Complex/templates/add_tenant.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvTenant": { 3 | "attributes": { 4 | "dn": "uni/tn-{{name}}", 5 | "name": "{{name}}", 6 | "descr": "{{description}}", 7 | "rn": "tn-{{name}}", 8 | "status": "created" 9 | }, 10 | "children": [] 11 | } 12 | } -------------------------------------------------------------------------------- /ACI_Python_Requests/Complex/templates/add_vrf.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvTenant": { 3 | "attributes": { "name": "{{tenant_name}}" }, 4 | "children": [ 5 | { 6 | "fvCtx": { 7 | "attributes": { "name": "{{vrf_name}}", "pcEnfPref": "enforced" }, 8 | "children": [] 9 | } 10 | } 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /ACI_Python_Requests/Complex/templates/assign_contract_cons.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvRsCons": 3 | { 4 | "attributes": 5 | { 6 | "tnVzBrCPName":"{{contract_name}}", 7 | "status":"created,modified" 8 | }, 9 | "children":[] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACI_Python_Requests/Complex/templates/assign_contract_prov.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvRsProv": 3 | { 4 | "attributes": 5 | { 6 | "tnVzBrCPName":"{{contract_name}}", 7 | "status":"created,modified" 8 | }, 9 | "children":[] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ACI_Python_Requests/Complex/templates/delete_tenant.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvTenant": { 3 | "attributes": { 4 | "dn": "uni/tn-{{name}}", 5 | "name": "{{name}}", 6 | "rn": "tn-{{name}}", 7 | "status": "deleted" 8 | }, 9 | "children": [] 10 | } 11 | } -------------------------------------------------------------------------------- /ACI_Python_Requests/Complex/templates/login.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "aaaUser": { 3 | "attributes": { 4 | "name": "{{ username }}", 5 | "pwd": "{{ password }}" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/example.py: -------------------------------------------------------------------------------- 1 | from jinja2 import Template 2 | template = Template("Hello {{ something }}!") 3 | print(template.render(something="World")) -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/loopbacks/normal/loopback.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | from jinja2 import Environment, FileSystemLoader 3 | 4 | loopbacks = yaml.load(open('loopback.yml'), Loader=yaml.SafeLoader) 5 | 6 | env = Environment(loader = FileSystemLoader('../../templates'), trim_blocks=True, lstrip_blocks=True) 7 | template = env.get_template('loopback.j2') 8 | loopback_config = template.render(loopbacks) 9 | 10 | print(loopback_config) -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/loopbacks/normal/loopback.yml: -------------------------------------------------------------------------------- 1 | interfaces: 2 | Loopback2000: 3 | description: Description for Loopback 2000 4 | ipv4_addr: 200.200.200.200 5 | ipv4_mask: 255.255.255.255 6 | Loopback2001: 7 | description: Description for Loopback 2001 8 | ipv4_addr: 200.200.200.201 9 | ipv4_mask: 255.255.255.255 -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/loopbacks/variant/loopback_variant.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | from jinja2 import Environment, FileSystemLoader 3 | 4 | interfaces = yaml.load(open('loopback_variant.yml'), Loader=yaml.SafeLoader) 5 | 6 | env = Environment(loader = FileSystemLoader('../../templates'), trim_blocks=True, lstrip_blocks=True) 7 | template = env.get_template('loopback_variant.j2') 8 | loopback_config = template.render(data=interfaces) 9 | 10 | print(loopback_config) -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/loopbacks/variant/loopback_variant.yml: -------------------------------------------------------------------------------- 1 | interfaces: 2 | - name: Loopback2001 3 | description: Description for Loopback 2000 4 | ipv4_addr: 200.200.200.200 5 | ipv4_mask: 255.255.255.255 6 | - name: Loopback2002 7 | description: Description for Loopback 2001 8 | ipv4_addr: 200.200.200.201 9 | ipv4_mask: 255.255.255.255 -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/templates/login.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "aaaUser": { 3 | "attributes": { 4 | "name": "{{ username }}", 5 | "pwd": "{{ password }}" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/templates/loopback.j2: -------------------------------------------------------------------------------- 1 | interface Loopback2000 2 | description {{interfaces.Loopback2000.description}} 3 | ip address {{interfaces.Loopback2000.ipv4_addr}} {{interfaces.Loopback2000.ipv4_mask}} 4 | ! 5 | interface Loopback2001 6 | description {{interfaces.Loopback2001.description}} 7 | ip address {{interfaces.Loopback2001.ipv4_addr}} {{interfaces.Loopback2001.ipv4_mask}} 8 | end -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/templates/loopback_variant.j2: -------------------------------------------------------------------------------- 1 | {%- for interface in data.interfaces %} 2 | interface {{interface.name}} 3 | description {{interface.description}} 4 | ip address {{interface.ipv4_addr}} {{interface.ipv4_mask}} 5 | {%- endfor %} -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/templates/tenant.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvTenant": { 3 | "attributes": { 4 | "dn": "uni/tn-{{name}}", 5 | "name": "{{name}}", 6 | "rn": "tn-{{name}}", 7 | "status": "created" 8 | }, 9 | "children": [] 10 | } 11 | } -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/templates/vlans.j2: -------------------------------------------------------------------------------- 1 | {%- for vlan_id, vlan_name in vlans.items() %} 2 | vlan {{ vlan_id }} 3 | name {{ vlan_name }} 4 | {%- endfor %} 5 | -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/vlans/vlan.py: -------------------------------------------------------------------------------- 1 | import jinja2 2 | 3 | template_vars = { 4 | "vlan_id": 620, 5 | "vlan_name": "vlan-620" 6 | } 7 | 8 | vlan_template = """ 9 | vlan {{ vlan_id }} 10 | name {{ vlan_name }} 11 | """ 12 | 13 | template = jinja2.Template(vlan_template) 14 | print(template.render(template_vars)) -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/vlans/vlans.yml: -------------------------------------------------------------------------------- 1 | 620: VLAN-620 2 | 621: VLAN-621 3 | 622: VLAN-622 4 | 623: VLAN-623 5 | -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/vlans/vlans_file.py: -------------------------------------------------------------------------------- 1 | from jinja2 import Environment 2 | from jinja2 import FileSystemLoader 3 | 4 | my_template = Environment(loader=FileSystemLoader('../templates')) 5 | 6 | vlans = { 7 | "620": "VLAN-620", 8 | "621": "VLAN-621", 9 | "622": "VLAN-622", 10 | "623": "VLAN-623", 11 | } 12 | 13 | template = my_template.get_template("vlans.j2") 14 | result = template.render(vlans=vlans) 15 | print(result) 16 | 17 | -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/vlans/vlans_file_yml_file.py: -------------------------------------------------------------------------------- 1 | from jinja2 import Environment 2 | from jinja2 import FileSystemLoader 3 | import yaml 4 | 5 | my_template = Environment(loader=FileSystemLoader('../templates')) 6 | 7 | vlans = yaml.load(open('vlans.yml'), Loader=yaml.SafeLoader) 8 | 9 | print(type(vlans)) 10 | template = my_template.get_template("vlans.j2") 11 | result = template.render(vlans=vlans) 12 | print(result) 13 | 14 | -------------------------------------------------------------------------------- /ACI_Python_Requests_Jinja/vlans/vlans_multiple.py: -------------------------------------------------------------------------------- 1 | import jinja2 2 | 3 | vlans = { 4 | "620": "VLAN-620", 5 | "621": "VLAN-621", 6 | "622": "VLAN-622", 7 | "633": "VLAN-623", 8 | } 9 | 10 | template_vars = { 11 | "vlans": vlans 12 | } 13 | 14 | 15 | vlan_template = """ 16 | {% for vlan_id, vlan_name in vlans.items() %} 17 | vlan {{ vlan_id }} 18 | name {{ vlan_name }} 19 | {% endfor %} 20 | """ 21 | 22 | template = jinja2.Template(vlan_template) 23 | print(template.render(template_vars)) -------------------------------------------------------------------------------- /ACI_Terraform/Complex/credentials.tf: -------------------------------------------------------------------------------- 1 | variable "aci_user" { 2 | default = "admin" 3 | } 4 | 5 | variable "aci_password" { 6 | default = "---" 7 | } 8 | 9 | variable "apic_ip" { 10 | default = "https://sandboxapicdc.cisco.com" 11 | } -------------------------------------------------------------------------------- /ACI_Terraform/Simple/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_tenant" "Tenant_TF_Demo" { 2 | name = var.aci_tenant 3 | description = "Tenant created by TF" 4 | } 5 | 6 | resource "aci_vrf" "VRF_TF_Demo" { 7 | tenant_dn = aci_tenant.Tenant_TF_Demo.id 8 | name = var.aci_vrf 9 | } 10 | 11 | resource "aci_bridge_domain" "BD_TF_Demo" { 12 | tenant_dn = aci_tenant.Tenant_TF_Demo.id 13 | name = var.aci_bd 14 | description = "BD created by TF" 15 | relation_fv_rs_ctx = aci_vrf.VRF_TF_Demo.name 16 | } -------------------------------------------------------------------------------- /ACI_Terraform/Simple/provider.tf: -------------------------------------------------------------------------------- 1 | provider "aci" { 2 | username = "admin" 3 | password = "---" 4 | url = "https://10.48.109.10" 5 | insecure = true 6 | } -------------------------------------------------------------------------------- /ACI_Terraform/Simple/terraform.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "s3" { 3 | bucket = "be.wymedia.terraform" 4 | key = "terraform/state" 5 | region = "eu-west-1" 6 | } 7 | } -------------------------------------------------------------------------------- /ACI_Terraform/Simple/variables.tf: -------------------------------------------------------------------------------- 1 | variable "aci_tenant" { 2 | default = "Tenant_Terraform_Demo" 3 | } 4 | 5 | variable "aci_vrf" { 6 | default = "VRF_Terraform_Demo" 7 | } 8 | 9 | variable "aci_bd" { 10 | default = "BD_Terraform_Demo" 11 | } -------------------------------------------------------------------------------- /ACI_Terraform_Gitlab/.gitignore: -------------------------------------------------------------------------------- 1 | .terraform 2 | .tfstate 3 | -------------------------------------------------------------------------------- /ACI_Terraform_Gitlab/terraform.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "s3" { 3 | bucket = "be.wymedia.terraform" 4 | key = "terraform/state" 5 | region = "eu-west-1" 6 | } 7 | } -------------------------------------------------------------------------------- /ACI_Terraform_Gitlab/variables_aci.tf: -------------------------------------------------------------------------------- 1 | variable "apic_server" { 2 | default = "https://10.16.2.1" 3 | } 4 | 5 | variable "apic_username" { 6 | default = "admin" 7 | } 8 | 9 | variable "apic_password" { 10 | default = "---" 11 | } 12 | 13 | variable "aci_tenant" { 14 | default = "Tenant_Terraform_Demo" 15 | } 16 | 17 | variable "aci_vrf" { 18 | default = "VRF_Terraform_Demo" 19 | } 20 | 21 | variable "aci_bd" { 22 | default = "BD_Terraform_Demo" 23 | } 24 | 25 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part1/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | 9 | provider "aci" { 10 | username = "apic:amslab\\\\wauterw" 11 | password = "***" 12 | url = "***" 13 | insecure = true 14 | } 15 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part2/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | 9 | provider "aci" { 10 | username = "apic:amslab\\\\wauterw" 11 | password = "***" 12 | url = "***" 13 | insecure = true 14 | } 15 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part2/terraform.tfvars: -------------------------------------------------------------------------------- 1 | aci_tenant_1_name="tenant-1" 2 | aci_tenant_2_name="tenant-2" 3 | application_profile_1_name = "applicationprofile-1" 4 | application_profile_2_name = "applicationprofile-2" 5 | vrf_1_name = "vrf-1" 6 | vrf_2_name = "vrf-2" 7 | bd_1_name = "bd-1" 8 | bd_2_name = "bd-2" -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_ap/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_application_profile" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.ap_name 4 | } 5 | 6 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_ap/output.tf: -------------------------------------------------------------------------------- 1 | output "applicationprofile" { 2 | value = aci_application_profile.this 3 | } 4 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_ap/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_ap/variables.tf: -------------------------------------------------------------------------------- 1 | variable "ap_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant" { 6 | type = any 7 | } 8 | 9 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_bd/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_bridge_domain" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.bd_name 4 | relation_fv_rs_ctx = var.vrf.id 5 | } 6 | 7 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_bd/output.tf: -------------------------------------------------------------------------------- 1 | output "bridge_domain" { 2 | value = aci_bridge_domain.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_bd/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_bd/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant" { 2 | type = any 3 | } 4 | 5 | variable "vrf" { 6 | type = any 7 | } 8 | 9 | variable "bd_name" { 10 | type = string 11 | } 12 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_tenant/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_tenant" "this" { 2 | name = var.tenant_name 3 | } 4 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_tenant/output.tf: -------------------------------------------------------------------------------- 1 | output "tenant" { 2 | value = aci_tenant.this 3 | } 4 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_tenant/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_tenant/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant_name" { 2 | type = string 3 | } 4 | 5 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_vrf/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_vrf" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.vrf_name 4 | } 5 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_vrf/output.tf: -------------------------------------------------------------------------------- 1 | output "vrf" { 2 | value = aci_vrf.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_vrf/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/modules/aci_vrf/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vrf_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant" { 6 | type = any 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | 9 | provider "aci" { 10 | username = "apic:amslab\\\\wauterw" 11 | password = "***" 12 | url = "***" 13 | insecure = true 14 | } 15 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part3/terraform.tfvars: -------------------------------------------------------------------------------- 1 | aci_tenant_1_name="tenant-1" 2 | aci_tenant_2_name="tenant-2" 3 | application_profile_1_name = "applicationprofile-1" 4 | application_profile_2_name = "applicationprofile-2" 5 | vrf_1_name = "vrf-1" 6 | vrf_2_name = "vrf-2" 7 | bd_1_name = "bd-1" 8 | bd_2_name = "bd-2" -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_ap/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_application_profile" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.ap_name 4 | } 5 | 6 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_ap/output.tf: -------------------------------------------------------------------------------- 1 | output "applicationprofile" { 2 | value = aci_application_profile.this 3 | } 4 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_ap/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_ap/variables.tf: -------------------------------------------------------------------------------- 1 | variable "ap_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant" { 6 | type = any 7 | } 8 | 9 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_bd/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_bridge_domain" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.bd_name 4 | relation_fv_rs_ctx = var.vrf.id 5 | } 6 | 7 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_bd/output.tf: -------------------------------------------------------------------------------- 1 | output "bridge_domain" { 2 | value = aci_bridge_domain.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_bd/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_bd/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant" { 2 | type = any 3 | } 4 | 5 | variable "vrf" { 6 | type = any 7 | } 8 | 9 | variable "bd_name" { 10 | type = string 11 | } 12 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_tenant/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_tenant" "this" { 2 | name = var.tenant_name 3 | description = var.tenant_description 4 | } 5 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_tenant/output.tf: -------------------------------------------------------------------------------- 1 | output "tenant" { 2 | value = aci_tenant.this 3 | } 4 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_tenant/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_tenant/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant_description" { 6 | type = string 7 | } 8 | 9 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_vrf/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_vrf" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.vrf_name 4 | } 5 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_vrf/output.tf: -------------------------------------------------------------------------------- 1 | output "vrf" { 2 | value = aci_vrf.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_vrf/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/modules/aci_vrf/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vrf_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant" { 6 | type = any 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | 9 | provider "aci" { 10 | username = "apic:amslab\\\\wauterw" 11 | password = "***" 12 | url = "***" 13 | insecure = true 14 | } 15 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/terraform.tfvars: -------------------------------------------------------------------------------- 1 | tenants = { 2 | "tenant1_name" = "Tenant-1", 3 | "tenant1_description" = "Description for Tenant 1", 4 | "tenant2_name" = "Tenant-2", 5 | "tenant2_description" = "Description for Tenant 2", 6 | } 7 | 8 | aps = { 9 | "application_profile_1_name" = "ap-1", 10 | "application_profile_2_name" = "ap-2" 11 | } 12 | 13 | 14 | vrfs = { 15 | "vrf_1_name" = "vrf-1", 16 | "vrf_2_name" = "vrf-2" 17 | } 18 | 19 | bds = { 20 | "bd_1_name" = "bd-1", 21 | "bd_2_name" = "bd-2" 22 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part4/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenants" { 2 | type = map 3 | } 4 | 5 | variable "aps" { 6 | type = map 7 | } 8 | 9 | variable "vrfs" { 10 | type = map 11 | } 12 | 13 | variable "bds" { 14 | type = map 15 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_ap/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_application_profile" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.ap_name 4 | } 5 | 6 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_ap/output.tf: -------------------------------------------------------------------------------- 1 | output "applicationprofile" { 2 | value = aci_application_profile.this 3 | } 4 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_ap/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_ap/variables.tf: -------------------------------------------------------------------------------- 1 | variable "ap_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant" { 6 | type = any 7 | } 8 | 9 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_bd/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_bridge_domain" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.bd_name 4 | relation_fv_rs_ctx = var.vrf.id 5 | } 6 | 7 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_bd/output.tf: -------------------------------------------------------------------------------- 1 | output "bridge_domain" { 2 | value = aci_bridge_domain.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_bd/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_bd/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant" { 2 | type = any 3 | } 4 | 5 | variable "vrf" { 6 | type = any 7 | } 8 | 9 | variable "bd_name" { 10 | type = string 11 | } 12 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_tenant/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_tenant" "this" { 2 | name = var.tenant_name 3 | description = var.tenant_description 4 | } 5 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_tenant/output.tf: -------------------------------------------------------------------------------- 1 | output "tenant" { 2 | value = aci_tenant.this 3 | } 4 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_tenant/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_tenant/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant_description" { 6 | type = string 7 | } 8 | 9 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_tenant_vrf_ap/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_tenant" "this" { 2 | name = var.tenant_name 3 | description = var.tenant_description 4 | } 5 | 6 | resource "aci_vrf" "this" { 7 | tenant_dn = aci_tenant.this.id 8 | name = var.vrf_name 9 | } 10 | 11 | resource "aci_application_profile" "this" { 12 | tenant_dn = aci_tenant.this.id 13 | name = var.ap_name 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_tenant_vrf_ap/output.tf: -------------------------------------------------------------------------------- 1 | output "tenant" { 2 | value = aci_tenant.this 3 | } 4 | 5 | output "applicationprofile" { 6 | value = aci_application_profile.this 7 | } 8 | 9 | output "vrf" { 10 | value = aci_vrf.this 11 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_tenant_vrf_ap/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_tenant_vrf_ap/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant_description" { 6 | type = string 7 | } 8 | 9 | variable "ap_name" { 10 | type = string 11 | } 12 | 13 | variable "vrf_name" { 14 | type = string 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_vrf/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_vrf" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.vrf_name 4 | } 5 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_vrf/output.tf: -------------------------------------------------------------------------------- 1 | output "vrf" { 2 | value = aci_vrf.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_vrf/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/modules/aci_vrf/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vrf_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant" { 6 | type = any 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/output.tf: -------------------------------------------------------------------------------- 1 | output "tenants" { 2 | value = { for p in sort(keys(var.tenants)) : p => module.tenant[p].tenant.name } 3 | } 4 | 5 | output "vrfs" { 6 | value = { for p in sort(keys(var.tenants)) : p => module.vrf[p].vrf.name } 7 | } 8 | 9 | output "aps" { 10 | value = { for p in sort(keys(var.tenants)) : p => module.app[p].applicationprofile.name } 11 | } 12 | 13 | output "bds" { 14 | value = { for p in sort(keys(var.tenants)) : p => module.bd[p].bridge_domain.name } 15 | } 16 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | 9 | provider "aci" { 10 | username = "apic:amslab\\\\wauterw" 11 | password = "***" 12 | url = "***" 13 | insecure = true 14 | } 15 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part5/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenants" { 2 | type = map 3 | } 4 | 5 | variable "vrfs" { 6 | type = map 7 | } 8 | 9 | variable "aps" { 10 | type = map 11 | } 12 | 13 | variable "bds" { 14 | type = map 15 | } 16 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_bd/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_bridge_domain" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.bd_name 4 | relation_fv_rs_ctx = var.vrf.id 5 | } 6 | 7 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_bd/output.tf: -------------------------------------------------------------------------------- 1 | output "bridge_domain" { 2 | value = aci_bridge_domain.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_bd/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_bd/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant" { 2 | type = any 3 | } 4 | 5 | variable "vrf" { 6 | type = any 7 | } 8 | 9 | variable "bd_name" { 10 | type = string 11 | } 12 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_tenant/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_tenant" "this" { 2 | name = var.tenant_name 3 | description = var.tenant_description 4 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_tenant/output.tf: -------------------------------------------------------------------------------- 1 | output "tenant" { 2 | value = aci_tenant.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_tenant/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_tenant/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant_description" { 6 | type = string 7 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_tenant_vrf_ap/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_tenant" "this" { 2 | name = var.tenant_name 3 | description = var.tenant_description 4 | } 5 | 6 | resource "aci_vrf" "this" { 7 | tenant_dn = aci_tenant.this.id 8 | name = var.vrf_name 9 | } 10 | 11 | resource "aci_application_profile" "this" { 12 | tenant_dn = aci_tenant.this.id 13 | name = var.ap_name 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_tenant_vrf_ap/output.tf: -------------------------------------------------------------------------------- 1 | output "tenant" { 2 | value = aci_tenant.this 3 | } 4 | 5 | output "applicationprofile" { 6 | value = aci_application_profile.this 7 | } 8 | 9 | output "vrf" { 10 | value = aci_vrf.this 11 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_tenant_vrf_ap/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/modules/aci_tenant_vrf_ap/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant_description" { 6 | type = string 7 | } 8 | 9 | variable "ap_name" { 10 | type = string 11 | } 12 | 13 | variable "vrf_name" { 14 | type = string 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/output.tf: -------------------------------------------------------------------------------- 1 | output "tenants" { 2 | value = { for p in sort(keys(var.tenants)) : p => module.tenantvrfap[p].tenant.name } 3 | } 4 | 5 | output "vrfs" { 6 | value = { for p in sort(keys(var.tenants)) : p => module.tenantvrfap[p].vrf.name } 7 | } 8 | 9 | output "aps" { 10 | value = { for p in sort(keys(var.tenants)) : p => module.tenantvrfap[p].applicationprofile.name } 11 | } 12 | 13 | output "bds" { 14 | value = { for p in sort(keys(var.tenants)) : p => module.bd[p].bridge_domain.name } 15 | } 16 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | 9 | provider "aci" { 10 | username = "apic:amslab\\\\wauterw" 11 | password = "***" 12 | url = "***" 13 | insecure = true 14 | } 15 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part6/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenants" { 2 | type = map 3 | } 4 | 5 | variable "vrfs" { 6 | type = map 7 | } 8 | 9 | variable "aps" { 10 | type = map 11 | } 12 | 13 | variable "bds" { 14 | type = map 15 | } 16 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/modules/aci_bd/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_bridge_domain" "this" { 2 | tenant_dn = var.tenant.id 3 | name = var.bd_name 4 | relation_fv_rs_ctx = var.vrf.id 5 | } 6 | 7 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/modules/aci_bd/output.tf: -------------------------------------------------------------------------------- 1 | output "bridge_domain" { 2 | value = aci_bridge_domain.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/modules/aci_bd/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/modules/aci_bd/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant" { 2 | type = any 3 | } 4 | 5 | variable "vrf" { 6 | type = any 7 | } 8 | 9 | variable "bd_name" { 10 | type = string 11 | } 12 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/modules/aci_tenant_vrf_ap/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_tenant" "this" { 2 | name = var.tenant_name 3 | description = var.tenant_description 4 | } 5 | 6 | resource "aci_vrf" "this" { 7 | tenant_dn = aci_tenant.this.id 8 | name = var.vrf_name 9 | } 10 | 11 | resource "aci_application_profile" "this" { 12 | tenant_dn = aci_tenant.this.id 13 | name = var.ap_name 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/modules/aci_tenant_vrf_ap/output.tf: -------------------------------------------------------------------------------- 1 | output "tenant" { 2 | value = aci_tenant.this 3 | } 4 | 5 | output "applicationprofile" { 6 | value = aci_application_profile.this 7 | } 8 | 9 | output "vrf" { 10 | value = aci_vrf.this 11 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/modules/aci_tenant_vrf_ap/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/modules/aci_tenant_vrf_ap/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant_description" { 6 | type = string 7 | } 8 | 9 | variable "ap_name" { 10 | type = string 11 | } 12 | 13 | variable "vrf_name" { 14 | type = string 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/output.tf: -------------------------------------------------------------------------------- 1 | output "tenants" { 2 | value = { for p in sort(keys(var.tenants)) : p => module.tenantvrfap[p].tenant.name } 3 | } 4 | 5 | output "vrfs" { 6 | value = { for p in sort(keys(var.tenants)) : p => module.tenantvrfap[p].vrf.name } 7 | } 8 | 9 | output "aps" { 10 | value = { for p in sort(keys(var.tenants)) : p => module.tenantvrfap[p].applicationprofile.name } 11 | } 12 | 13 | output "bds" { 14 | value = { for p in sort(keys(var.tenants)) : p => module.bd[p].bridge_domain.name } 15 | } 16 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | 9 | provider "aci" { 10 | username = "apic:amslab\\\\wauterw" 11 | password = "***" 12 | url = "***" 13 | insecure = true 14 | } 15 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part7/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenants" { 2 | type = map(object({ 3 | tenant_name = string 4 | tenant_description = string 5 | })) 6 | } 7 | 8 | variable "vrfs" { 9 | type = map(object({ 10 | vrf_name = string 11 | })) 12 | } 13 | 14 | variable "aps" { 15 | type = map(object({ 16 | ap_name = string 17 | })) 18 | } 19 | 20 | variable "bds" { 21 | type = map(object({ 22 | bd_name = string 23 | })) 24 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/modules/aci_bd/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_bridge_domain" "this" { 2 | for_each = var.bds 3 | 4 | tenant_dn = var.tenant.id 5 | name = var.bds[each.key].bd_name 6 | 7 | //relation_fv_rs_ctx = var.bds[each.key].vrf 8 | } 9 | 10 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/modules/aci_bd/output.tf: -------------------------------------------------------------------------------- 1 | output "bridge_domain" { 2 | value = aci_bridge_domain.this 3 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/modules/aci_bd/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/modules/aci_bd/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant" { 2 | type = any 3 | } 4 | 5 | // variable "vrf" { 6 | // type = any 7 | // } 8 | 9 | variable "bds" { 10 | type = any 11 | } 12 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/modules/aci_tenant_vrf_ap/main.tf: -------------------------------------------------------------------------------- 1 | resource "aci_tenant" "this" { 2 | name = var.tenant_name 3 | description = var.tenant_description 4 | } 5 | 6 | resource "aci_vrf" "this" { 7 | for_each = var.vrfs 8 | 9 | tenant_dn = aci_tenant.this.id 10 | name = var.vrfs[each.key].vrf_name 11 | } 12 | 13 | resource "aci_application_profile" "this" { 14 | for_each = var.aps 15 | 16 | tenant_dn = aci_tenant.this.id 17 | name = var.aps[each.key].ap_name 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/modules/aci_tenant_vrf_ap/output.tf: -------------------------------------------------------------------------------- 1 | output "tenant" { 2 | value = aci_tenant.this 3 | } 4 | 5 | // output "applicationprofile" { 6 | // value = aci_application_profile.this 7 | // } 8 | 9 | output "vrf" { 10 | value = aci_vrf.this 11 | } -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/modules/aci_tenant_vrf_ap/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/modules/aci_tenant_vrf_ap/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenant_name" { 2 | type = string 3 | } 4 | 5 | variable "tenant_description" { 6 | type = string 7 | } 8 | 9 | variable "aps" { 10 | type = any 11 | } 12 | 13 | variable "vrfs" { 14 | type = any 15 | } 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aci = { 4 | source = "CiscoDevNet/aci" 5 | } 6 | } 7 | } 8 | 9 | provider "aci" { 10 | username = "apic:amslab\\\\wauterw" 11 | password = "***" 12 | url = "***" 13 | insecure = true 14 | } 15 | -------------------------------------------------------------------------------- /ACI_Terraform_sequel/part8/variables.tf: -------------------------------------------------------------------------------- 1 | variable "tenants" { 2 | type = map(object({ 3 | tenant_name = string 4 | tenant_description = string 5 | })) 6 | } 7 | 8 | variable "vrfs" { 9 | type = map(map(object({ 10 | vrf_name = string 11 | }))) 12 | } 13 | 14 | variable "aps" { 15 | type = map(map(object({ 16 | ap_name = string 17 | }))) 18 | } 19 | 20 | variable "bds" { 21 | type = map(map(object({ 22 | bd_name = string 23 | vrf = string 24 | }))) 25 | } 26 | -------------------------------------------------------------------------------- /AWS_Kubernetes_Ansible/Ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | host_key_checking = False 3 | -------------------------------------------------------------------------------- /AWS_Kubernetes_Ansible/Ansible/hosts: -------------------------------------------------------------------------------- 1 | #hosts 2 | [masters] 3 | master ansible_host=18.203.68.253 ansible_user=ubuntu 4 | 5 | [workers] 6 | worker1 ansible_host=3.249.4.142 ansible_user=ubuntu 7 | worker2 ansible_host=3.249.141.242 ansible_user=ubuntu 8 | 9 | [all:vars] 10 | ansible_python_interpreter=/usr/bin/python3 11 | ansible_ssh_private_key_file=~/.ssh/AWS-Cisco.pem -------------------------------------------------------------------------------- /AWS_Kubernetes_Ansible/Terraform/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_instance" "Server" { 2 | ami = var.ec2_image 3 | instance_type = var.ec2_instance_type 4 | key_name = var.ec2_keypair 5 | count = var.ec2_count 6 | tags = { 7 | Name = "${var.ec2_tags}-${count.index+1}" 8 | } 9 | } 10 | 11 | output "instance_ip_addr" { 12 | value = aws_instance.Server.*.private_ip 13 | description = "The private IP address of the main server instance." 14 | } 15 | 16 | output "instance_ips" { 17 | value = aws_instance.Server.*.public_ip 18 | } -------------------------------------------------------------------------------- /AWS_Kubernetes_Ansible/Terraform/provider.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | version = "~> 2.0" 3 | region = var.ec2_region 4 | } -------------------------------------------------------------------------------- /AWS_Kubernetes_Ansible/Terraform/variables_AWS.tf: -------------------------------------------------------------------------------- 1 | variable "ec2_region" { 2 | default = "eu-west-1" 3 | } 4 | 5 | variable "ec2_image" { 6 | default = "ami-00035f41c82244dab" 7 | } 8 | 9 | variable "ec2_instance_type" { 10 | default = "t2.medium" 11 | } 12 | 13 | variable "ec2_keypair" { 14 | default = "AWS-Cisco" 15 | } 16 | 17 | variable "ec2_tags" { 18 | default = "Kubernetes" 19 | } 20 | 21 | variable "ec2_count" { 22 | default = "3" 23 | } 24 | 25 | -------------------------------------------------------------------------------- /AWS_Terraform/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_instance" "Server" { 2 | ami = var.ec2_image 3 | instance_type = var.ec2_instance_type 4 | key_name = var.ec2_keypair 5 | count = var.ec2_count 6 | tags = { 7 | Name = var.ec2_tags 8 | } 9 | } 10 | 11 | output "instance_ip_addr" { 12 | value = aws_instance.Server.*.private_ip 13 | description = "The private IP address of the main server instance." 14 | } 15 | 16 | output "instance_ips" { 17 | value = aws_instance.Server.*.public_ip 18 | } -------------------------------------------------------------------------------- /AWS_Terraform/provider.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | version = "~> 2.0" 3 | region = var.ec2_region 4 | } -------------------------------------------------------------------------------- /AWS_Terraform/variables_AWS.tf: -------------------------------------------------------------------------------- 1 | variable "ec2_region" { 2 | default = "eu-west-1" 3 | } 4 | 5 | variable "ec2_image" { 6 | default = "ami-00035f41c82244dab" 7 | } 8 | 9 | variable "ec2_instance_type" { 10 | default = "t2.micro" 11 | } 12 | 13 | variable "ec2_keypair" { 14 | default = "AWS-Cisco" 15 | } 16 | 17 | variable "ec2_tags" { 18 | default = "Cisco-Demo-Terraform" 19 | } 20 | 21 | variable "ec2_count" { 22 | default = "2" 23 | } 24 | 25 | -------------------------------------------------------------------------------- /AWS_Terraform_Gitlab/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_instance" "OneServer" { 2 | ami = var.ec2_image 3 | instance_type = var.ec2_instance_type 4 | key_name = var.ec2_keypair 5 | count = var.ec2_count 6 | tags = { 7 | Name = var.ec2_tags 8 | } 9 | } 10 | 11 | output "instance_ip_addr" { 12 | value = aws_instance.OneServer.*.private_ip 13 | description = "The private IP address of the main server instance." 14 | } 15 | 16 | output "instance_ips" { 17 | value = aws_instance.OneServer.*.public_ip 18 | } -------------------------------------------------------------------------------- /AWS_Terraform_Gitlab/provider.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | version = "~> 2.0" 3 | region = var.ec2_region 4 | } -------------------------------------------------------------------------------- /AWS_Terraform_Gitlab/terraform.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "s3" { 3 | bucket = "be.wymedia.terraform" 4 | key = "terraform/state" 5 | region = "eu-west-1" 6 | } 7 | } -------------------------------------------------------------------------------- /AWS_Terraform_Gitlab/variables.tf: -------------------------------------------------------------------------------- 1 | variable "ec2_region" { 2 | default = "eu-west-1" 3 | } 4 | 5 | variable "ec2_image" { 6 | default = "ami-00035f41c82244dab" 7 | } 8 | 9 | variable "ec2_instance_type" { 10 | default = "t2.micro" 11 | } 12 | 13 | variable "ec2_keypair" { 14 | default = "AWS-Cisco" 15 | } 16 | 17 | variable "ec2_tags" { 18 | default = "Cisco-Demo-Terraform" 19 | } 20 | 21 | variable "ec2_count" { 22 | default = "2" 23 | } 24 | 25 | -------------------------------------------------------------------------------- /AWS_Terraform_RemoteState/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_instance" "OneServer" { 2 | ami = var.ec2_image 3 | instance_type = var.ec2_instance_type 4 | key_name = var.ec2_keypair 5 | count = var.ec2_count 6 | tags = { 7 | Name = var.ec2_tags 8 | } 9 | } 10 | 11 | output "instance_ip_addr" { 12 | value = aws_instance.OneServer.*.private_ip 13 | description = "The private IP address of the main server instance." 14 | } 15 | 16 | output "instance_ips" { 17 | value = aws_instance.OneServer.*.public_ip 18 | } -------------------------------------------------------------------------------- /AWS_Terraform_RemoteState/provider.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | version = "~> 2.0" 3 | region = var.ec2_region 4 | } -------------------------------------------------------------------------------- /AWS_Terraform_RemoteState/terraform.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "s3" { 3 | bucket = "be.wymedia.terraform" 4 | key = "terraform/state" 5 | region = "eu-west-1" 6 | } 7 | } -------------------------------------------------------------------------------- /AWS_Terraform_RemoteState/variables.tf: -------------------------------------------------------------------------------- 1 | variable "ec2_region" { 2 | default = "eu-west-1" 3 | } 4 | 5 | variable "ec2_image" { 6 | default = "ami-00035f41c82244dab" 7 | } 8 | 9 | variable "ec2_instance_type" { 10 | default = "t2.micro" 11 | } 12 | 13 | variable "ec2_keypair" { 14 | default = "AWS-Cisco" 15 | } 16 | 17 | variable "ec2_tags" { 18 | default = "Cisco-Demo-Terraform-1" 19 | } 20 | 21 | variable "ec2_count" { 22 | default = "2" 23 | } 24 | 25 | -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | hostfile = hosts 3 | host_key_checking = False 4 | deprecation_warnings=False 5 | stdout_callback = skippy 6 | 7 | [persistent_connection] 8 | connect_timeout = 100 9 | command_timeout = 80 -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/change_description.yaml: -------------------------------------------------------------------------------- 1 | #simple IOS config in ansible 2 | --- 3 | - name: Change interface description 4 | hosts: iosxe 5 | gather_facts: no 6 | 7 | tasks: 8 | - name: configure interface settings 9 | ios_config: 10 | lines: 11 | - description Changed through Ansible 12 | - ip address 172.31.1.1 255.255.255.0 13 | parents: interface GigabitEthernet3 -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/command_show_variant1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Getting started 3 | hosts: iosxe 4 | gather_facts: no 5 | 6 | tasks: 7 | - name: GATHERING FACTS 8 | ios_facts: 9 | gather_subset: hardware 10 | 11 | - name: run multiple commands 12 | ios_command: 13 | commands: 14 | - show version 15 | - show ip interface brief 16 | register: output 17 | 18 | - name: display all 19 | debug: 20 | var: output["stdout_lines"] 21 | 22 | -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/command_show_variant2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Getting started 3 | hosts: iosxe 4 | gather_facts: no 5 | 6 | tasks: 7 | - name: GATHERING FACTS 8 | ios_facts: 9 | gather_subset: hardware 10 | 11 | - name: run multiple commands 12 | ios_command: 13 | commands: "{{ commands }}" 14 | register: output 15 | 16 | - name: display all 17 | debug: 18 | var: output["stdout_lines"] 19 | 20 | -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/group_vars/iosxe.yaml: -------------------------------------------------------------------------------- 1 | ansible_connection : local 2 | ansible_python_interpreter : /usr/bin/python3 3 | host_key_checking : False 4 | ansible_ssh_user : developer 5 | ansible_ssh_pass : C1sco12345 6 | ansible_port: 8181 7 | 8 | commands: 9 | - "show version" 10 | - "show ip interface brief" 11 | -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/hosts: -------------------------------------------------------------------------------- 1 | [iosxe] 2 | ios-xe-mgmt-latest.cisco.com 3 | 4 | 5 | -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/loopback_create_single.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure loopback using ios_interface 3 | hosts: iosxe 4 | gather_facts: no 5 | 6 | tasks: 7 | - name: Creating loopback 8 | ios_interface: 9 | name: Loopback100 10 | enabled: True 11 | description: Loopback interface 100 created with Ansible 12 | - name: Assign IP to loopback 13 | ios_l3_interface: 14 | name: Loopback100 15 | ipv4: 10.10.10.10/32 -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/loopback_remove_multiple.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Delete interfaces 3 | hosts: iosxe 4 | gather_facts: no 5 | vars_files: 6 | - vars/loopbacks.yaml 7 | 8 | tasks: 9 | - name: Delete loopback interfaces 10 | ios_interface: 11 | name: "{{ item.loopbackname }}" 12 | state: absent 13 | with_items: "{{ loopbacks }}" 14 | -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/loopback_remove_single.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Delete interfaces 3 | hosts: iosxe 4 | gather_facts: no 5 | 6 | tasks: 7 | - name: Delete loopback 100 8 | ios_interface: 9 | name: Loopback100 10 | state: absent 11 | -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/vars/loopbacks.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | loopbacks: 3 | - loopbackname: "Loopback100" 4 | ip: "10.16.100.100" 5 | mask: "32" 6 | - loopbackname: "Loopback101" 7 | ip: "10.16.100.101" 8 | mask: "32" 9 | - loopbackname: "Loopback102" 10 | ip: "10.16.100.102" 11 | mask: "32" 12 | - loopbackname: "Loopback103" 13 | ip: "10.16.100.103" 14 | mask: "32" 15 | -------------------------------------------------------------------------------- /Ansible_IOSXE/ios_modules/vars/loopbacks_interfaces.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | loopbacks_interfaces: 3 | - loopbackinterface: "interface Loopback100" 4 | - loopbackinterface: "interface Loopback101" 5 | - loopbackinterface: "interface Loopback102" 6 | - loopbackinterface: "interface Loopback103" 7 | 8 | -------------------------------------------------------------------------------- /Ansible_IOSXE/napalm/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | library = /usr/local/lib/python3.7/site-packages/napalm_ansible/modules 3 | action_plugins = /usr/local/lib/python3.7/site-packages/napalm_ansible/plugins/action 4 | hostfile = hosts 5 | host_key_checking = False 6 | deprecation_warnings=False 7 | stdout_callback = skippy 8 | 9 | 10 | [persistent_connection] 11 | connect_timeout = 100 12 | command_timeout = 80 -------------------------------------------------------------------------------- /Ansible_IOSXE/napalm/bijhouden.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure loopback using ios_interface 3 | hosts: iosxe 4 | gather_facts: no 5 | vars_files: 6 | - vars/loopbacks.yaml 7 | 8 | tasks: 9 | - name: get facts from device 10 | napalm_get_facts: 11 | username: "{{ ansible_user }}" 12 | password: "{{ ansible_ssh_pass }}" 13 | filter: facts,interfaces 14 | optional_args: 15 | port: 8181 16 | register: result 17 | 18 | - name: print data 19 | debug: var=result 20 | 21 | 22 | -------------------------------------------------------------------------------- /Ansible_IOSXE/napalm/diff: -------------------------------------------------------------------------------- 1 | +description LOOPBACK 100 2 | + ip address 4.4.4.101 255.255.255.255 3 | +description LOOPBACK 100 4 | + ip address 1.1.1.20 255.255.255.255 -------------------------------------------------------------------------------- /Ansible_IOSXE/napalm/get_facts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Retrieve interfaces 3 | hosts: iosxe 4 | gather_facts: no 5 | 6 | tasks: 7 | - name: get facts from device 8 | napalm_get_facts: 9 | username: "{{ ansible_user }}" 10 | password: "{{ ansible_ssh_pass }}" 11 | filter: interfaces_ip 12 | optional_args: 13 | port: 8181 14 | register: result 15 | 16 | - name: print data 17 | debug: var=result 18 | 19 | 20 | -------------------------------------------------------------------------------- /Ansible_IOSXE/napalm/group_vars/iosxe.yaml: -------------------------------------------------------------------------------- 1 | host_key_checking : False 2 | ansible_user: developer 3 | ansible_ssh_pass: C1sco12345 4 | ansible_port: 8181 5 | ansible_python_interpreter: /usr/local/bin/python3 6 | ansible_network_os: ios 7 | ansible_connection: network_cli 8 | validate_file: "validation.yml" -------------------------------------------------------------------------------- /Ansible_IOSXE/napalm/hosts: -------------------------------------------------------------------------------- 1 | [iosxe] 2 | ios-xe-mgmt-latest.cisco.com -------------------------------------------------------------------------------- /Ansible_IOSXE/napalm/loopbacks.txt: -------------------------------------------------------------------------------- 1 | interface Loopback100 2 | description LOOPBACK 100 3 | ip address 4.4.4.101 255.255.255.255 4 | ! 5 | interface Loopback200 6 | description LOOPBACK 200 7 | ip address 1.1.1.20 255.255.255.255 8 | end -------------------------------------------------------------------------------- /Ansible_IOSXE/napalm/validate_command.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Validate command 3 | hosts: iosxe 4 | gather_facts: no 5 | 6 | tasks: 7 | - name: NaPalm Validation 8 | napalm_validate: 9 | hostname: "{{ inventory_hostname }}" 10 | username: "{{ ansible_user }}" 11 | password: "{{ ansible_ssh_pass }}" 12 | dev_os: "ios" 13 | optional_args: 14 | port: 8181 15 | validation_file: "{{ validate_file }}" 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Ansible_IOSXE/napalm/validation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - get_facts: 3 | os_version: 16.11.1a 4 | vendor: Cisco 5 | 6 | - get_interfaces_ip: 7 | Loopback100: 8 | ipv4: 9 | 4.4.4.102: 10 | prefix_length: 32 -------------------------------------------------------------------------------- /Ansible_IOSXE/netconf/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | gathering = explicit 3 | retry_files_enabled = False 4 | host_key_checking = False 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Ansible_IOSXE/netconf/group_vars/iosxe.yaml: -------------------------------------------------------------------------------- 1 | ansible_user: 'developer' 2 | ansible_password: 'C1sco12345' 3 | netconf_port: 10000 4 | ansible_port: 8181 5 | ansible_network_os: "default" 6 | -------------------------------------------------------------------------------- /Ansible_IOSXE/netconf/hosts: -------------------------------------------------------------------------------- 1 | [all:vars] 2 | ansible_python_interpreter="/usr/bin/python3" 3 | 4 | [iosxe] 5 | ios-xe-mgmt.cisco.com ansible_port=8181 6 | -------------------------------------------------------------------------------- /Ansible_IOSXE/netconf/show_command._tobechanged.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: NETCONF sample 1 3 | hosts: iosxe 4 | connection: netconf 5 | gather_facts: False 6 | 7 | tasks: 8 | - name: run multiple commands 9 | netconf_get: 10 | source: running 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Ansible_IOSXE/restconf/Method1/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | hostfile = hosts 3 | host_key_checking = False 4 | deprecation_warnings=False 5 | stdout_callback = skippy 6 | 7 | 8 | [persistent_connection] 9 | connect_timeout = 100 10 | command_timeout = 80 -------------------------------------------------------------------------------- /Ansible_IOSXE/restconf/Method1/create_interfaces_restconf.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Restconf - Config 3 | hosts: iosxe 4 | 5 | tasks: 6 | - name: Create interfaces with IETF YANG model 7 | restconf_config: 8 | method: post 9 | format: json 10 | path: /data/ietf-interfaces:interfaces 11 | content: "{{ lookup('file','./loopback.json') | string }}" 12 | register: output 13 | ignore_errors: true 14 | 15 | - name: display all 16 | debug: 17 | var: output 18 | -------------------------------------------------------------------------------- /Ansible_IOSXE/restconf/Method1/create_interfaces_restconf_variant.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Restconf - Config 3 | hosts: iosxe 4 | 5 | tasks: 6 | - name: Create interfaces with IETF YANG model 7 | restconf_config: 8 | path: /data/ietf-interfaces:interfaces 9 | content: "{{ loopback_interfaces | to_json }}" 10 | 11 | -------------------------------------------------------------------------------- /Ansible_IOSXE/restconf/Method1/delete_interfaces_restconf.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Restconf - Config 3 | hosts: iosxe 4 | 5 | tasks: 6 | - name: Delete interfaces with IETF YANG model 7 | restconf_config: 8 | method: delete 9 | path: /data/ietf-interfaces:interfaces/interface={{ item['name'] }} 10 | with_items: "{{ loopback_interfaces['interface'] }}" 11 | -------------------------------------------------------------------------------- /Ansible_IOSXE/restconf/Method1/get_interfaces_restconf.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Restconf - GET 3 | hosts: iosxe 4 | connection: local 5 | 6 | tasks: 7 | - name: Get interfaces from IETF YANG model 8 | restconf_get: 9 | content: config 10 | output: json 11 | path: /data/ietf-interfaces:interfaces 12 | register: output 13 | 14 | - name: display all 15 | debug: 16 | var: output 17 | 18 | 19 | -------------------------------------------------------------------------------- /Ansible_IOSXE/restconf/Method1/hosts: -------------------------------------------------------------------------------- 1 | [all:vars] 2 | ansible_python_interpreter="/usr/bin/python3" 3 | ansible_network_os=default 4 | 5 | [iosxe] 6 | ios-xe-mgmt.cisco.com ansible_port=8181 7 | -------------------------------------------------------------------------------- /DNAC_PythonRequests/Devices/authenticate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/DNAC_PythonRequests/Devices/authenticate.py -------------------------------------------------------------------------------- /DNAC_PythonRequests/NetworkDiscovery/templates/discovery.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ name }}", 3 | "discoveryType": "Range", 4 | "ipAddressList": "192.168.30.0-192.168.30.100", 5 | "timeOut": 1, 6 | "protocolOrder": "ssh,telnet", 7 | "preferredMgmtIPMethod": "None" 8 | } -------------------------------------------------------------------------------- /DNAC_PythonRequests/Sites/templates/building.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "building", 3 | "site": { 4 | "building": { 5 | "name": "{{building_name}}", 6 | "address": "123 Main Street", 7 | "parentName": "Global/{{site_name}}", 8 | "latitude": "51.0458", 9 | "longitude": "5.6413" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /DNAC_PythonRequests/Sites/templates/dummy_device.json: -------------------------------------------------------------------------------- 1 | { 2 | "ipAddress": [ 3 | "192.80.2.23" 4 | ], 5 | "snmpVersion": "v2", 6 | "snmpROCommunity": "readonly", 7 | "snmpRWCommunity": "readwrite", 8 | "snmpRetry": "1", 9 | "snmpTimeout": "60", 10 | "cliTransport": "ssh", 11 | "userName": "wim", 12 | "password": "cisco123", 13 | "enablePassword": "cisco1234!" 14 | } -------------------------------------------------------------------------------- /DNAC_PythonRequests/Sites/templates/floor.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "floor", 3 | "site": { 4 | "floor": { 5 | "name": "{{floor_name}}", 6 | "parentName": "Global/{{site_name}}/{{building_name}}", 7 | "rfModel": "Cubes and Walled Offices", 8 | "width": "20", 9 | "length": "30", 10 | "height": "10" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DNAC_PythonRequests/Sites/templates/site.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "area", 3 | "site": { 4 | "area": { 5 | "name": "{{site_name}}", 6 | "parentName": "Global" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /DigitalOcean_Kubernetes_Ansible/Ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | host_key_checking = False 3 | -------------------------------------------------------------------------------- /DigitalOcean_Kubernetes_Ansible/Ansible/hosts: -------------------------------------------------------------------------------- 1 | #hosts 2 | [masters] 3 | master ansible_host=192.168.80.105 4 | 5 | [workers] 6 | worker1 ansible_host=192.168.80.106 7 | worker2 ansible_host=192.168.80.107 8 | 9 | [all:vars] 10 | ansible_python_interpreter=/usr/bin/python3 11 | ansible_ssh_private_key_file=/Users/wauterw/GoogleDrive/Keys_and_Certificates/homelab 12 | ansible_user=wim -------------------------------------------------------------------------------- /DigitalOcean_Kubernetes_Ansible/Terraform/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | default = "c4a***325" 3 | } 4 | 5 | variable "region" { 6 | default = "AMS3" 7 | } 8 | 9 | variable "ssh_fingerprint" { 10 | default = "5a:25:***:c9:8d:03" 11 | } 12 | 13 | variable "number_servers" { 14 | default = "3" 15 | } 16 | 17 | variable "size" { 18 | default = "s-2vcpu-2gb" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /Express_Mongo_REST_API/config/database.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | url : 'mongodb://localhost/mean-todo' 3 | } -------------------------------------------------------------------------------- /Express_Mongo_REST_API/models/todo.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | var Schema = mongoose.Schema; 3 | 4 | // todo model 5 | var todoSchema = new Schema({ 6 | content: String, 7 | description:String, 8 | completed: { type: Boolean, default: false }, 9 | created_at: { type: Date, default: Date.now }, 10 | updated_at: { type: Date, default: Date.now } 11 | }); 12 | 13 | module.exports = mongoose.model('Todo', todoSchema); -------------------------------------------------------------------------------- /Express_Mongo_REST_API/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mean-todo-application", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "cookie-parser": "~1.4.4", 10 | "debug": "~2.6.9", 11 | "express": "~4.16.1", 12 | "http-errors": "~1.6.3", 13 | "mongoose": "^5.9.7", 14 | "morgan": "~1.9.1", 15 | "pug": "2.0.0-beta11" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Express_Mongo_REST_API/public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } 9 | -------------------------------------------------------------------------------- /Express_Mongo_REST_API/routes/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET home page. */ 5 | router.get('/', function(req, res, next) { 6 | res.render('index', { title: 'Express' }); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /Express_Mongo_REST_API/routes/users.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET users listing. */ 5 | router.get('/', function(req, res, next) { 6 | res.send('respond with a resource'); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /Express_Mongo_REST_API/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= message 5 | h2= error.status 6 | pre #{error.stack} 7 | -------------------------------------------------------------------------------- /Express_Mongo_REST_API/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= title 5 | p Welcome to #{title} 6 | -------------------------------------------------------------------------------- /Express_Mongo_REST_API/views/layout.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body 7 | block content 8 | -------------------------------------------------------------------------------- /Express_Mongo_REST_Angular/config/database.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | url : 'mongodb://localhost/mean-todo' 3 | } -------------------------------------------------------------------------------- /Express_Mongo_REST_Angular/models/todo.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | var Schema = mongoose.Schema; 3 | 4 | // todo model 5 | var todoSchema = new Schema({ 6 | content: String, 7 | description:String, 8 | completed: { type: Boolean, default: false }, 9 | created_at: { type: Date, default: Date.now }, 10 | updated_at: { type: Date, default: Date.now } 11 | }); 12 | 13 | module.exports = mongoose.model('Todo', todoSchema); -------------------------------------------------------------------------------- /Express_Mongo_REST_Angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mean-todo-application", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "cookie-parser": "~1.4.4", 10 | "debug": "~2.6.9", 11 | "express": "~4.16.1", 12 | "http-errors": "~1.6.3", 13 | "mongoose": "^5.9.7", 14 | "morgan": "~1.9.1", 15 | "pug": "2.0.0-beta11" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Express_Mongo_REST_Angular/public/images/empty.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Express_Mongo_REST_Angular/public/images/empty.js -------------------------------------------------------------------------------- /Express_Mongo_REST_Angular/public/javascript/empty.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Express_Mongo_REST_Angular/public/javascript/empty.js -------------------------------------------------------------------------------- /Express_Mongo_REST_Angular/public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } -------------------------------------------------------------------------------- /Express_Mongo_REST_Angular/routes/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET home page. */ 5 | router.get('/', function(req, res, next) { 6 | res.render('index', { title: 'Express' }); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /Express_Mongo_REST_Angular/routes/users.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET users listing. */ 5 | router.get('/', function(req, res, next) { 6 | res.send('respond with a resource'); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Beanstalk/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Elastic Beanstalk Files 3 | .elasticbeanstalk/* 4 | !.elasticbeanstalk/*.cfg.yml 5 | !.elasticbeanstalk/*.global.yml 6 | .git 7 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Beanstalk/application.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | application = Flask(__name__) 4 | 5 | # test 6 | @application.route("/") 7 | def index(): 8 | return render_template("index.html") 9 | 10 | 11 | if __name__ == "__main__": 12 | application.run() 13 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Beanstalk/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gevent==21.1.2 4 | greenlet==1.0.0 5 | gunicorn==20.0.4 6 | itsdangerous==1.1.0 7 | Jinja2==2.11.2 8 | MarkupSafe==1.1.1 9 | Werkzeug==1.0.1 10 | zope.event==4.5.0 11 | zope.interface==5.2.0 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Beanstalk/test_application.py: -------------------------------------------------------------------------------- 1 | from application import application 2 | 3 | with application.test_client() as c: 4 | response = c.get("/") 5 | assert response.status_code == 200 6 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Beanstalk/wsgi.py: -------------------------------------------------------------------------------- 1 | from application import application 2 | 3 | if __name__ == "__main__": 4 | application.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Beanstalk/.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | # Elastic Beanstalk Files 3 | .elasticbeanstalk/* 4 | !.elasticbeanstalk/*.cfg.yml 5 | !.elasticbeanstalk/*.global.yml 6 | .git 7 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Beanstalk/application.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | application = Flask(__name__) 4 | 5 | # test 6 | @application.route("/") 7 | def index(): 8 | return render_template("index.html") 9 | 10 | 11 | if __name__ == "__main__": 12 | application.run() 13 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Beanstalk/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gevent==21.1.2 4 | greenlet==1.0.0 5 | gunicorn==20.0.4 6 | itsdangerous==1.1.0 7 | Jinja2==2.11.2 8 | MarkupSafe==1.1.1 9 | Werkzeug==1.0.1 10 | zope.event==4.5.0 11 | zope.interface==5.2.0 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Beanstalk/test_application.py: -------------------------------------------------------------------------------- 1 | from application import application 2 | 3 | with application.test_client() as c: 4 | response = c.get("/") 5 | assert response.status_code == 200 6 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Beanstalk/wsgi.py: -------------------------------------------------------------------------------- 1 | from application import application 2 | 3 | if __name__ == "__main__": 4 | application.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Apps/.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | venv/* 3 | *.pyc -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Apps/README.md: -------------------------------------------------------------------------------- 1 | This is a test 2 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Apps/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | 6 | @app.route("/") 7 | def index(): 8 | return render_template("index.html") 9 | 10 | 11 | if __name__ == "__main__": 12 | app.run(host="0.0.0.0") 13 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Apps/gunicorn_config.py: -------------------------------------------------------------------------------- 1 | bind = "0.0.0.0:5000" 2 | workers = 2 3 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Apps/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gunicorn==20.1.0 4 | itsdangerous==1.1.0 5 | Jinja2==2.11.2 6 | MarkupSafe==1.1.1 7 | Werkzeug==1.0.1 8 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Apps/wsgi.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Droplet/.gitignore: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Droplet/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 5000 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:5000", "wsgi:app"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Droplet/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | 6 | @app.route("/") 7 | def index(): 8 | return render_template("index.html") 9 | 10 | 11 | if __name__ == "__main__": 12 | app.run(host="0.0.0.0") 13 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Droplet/app/wsgi.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Droplet/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | services: 4 | web: 5 | build: . 6 | networks: 7 | - default 8 | ports: 9 | - 50000:5000 10 | restart: always -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-Droplet/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gevent==21.1.2 4 | greenlet==1.0.0 5 | gunicorn==20.0.4 6 | itsdangerous==1.1.0 7 | Jinja2==2.11.2 8 | MarkupSafe==1.1.1 9 | Werkzeug==1.0.1 10 | zope.event==4.5.0 11 | zope.interface==5.2.0 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-K8S/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 5000 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:5000", "wsgi:app"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-K8S/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | 6 | @app.route("/") 7 | def index(): 8 | return render_template("index.html") 9 | 10 | 11 | if __name__ == "__main__": 12 | app.run(host="0.0.0.0") 13 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-K8S/app/wsgi.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-K8S/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | services: 4 | web: 5 | build: . 6 | networks: 7 | - default 8 | ports: 9 | - 50000:5000 10 | restart: always -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-DigitalOcean-K8S/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gevent==21.1.2 4 | greenlet==1.0.0 5 | gunicorn==20.0.4 6 | itsdangerous==1.1.0 7 | Jinja2==2.11.3 8 | MarkupSafe==1.1.1 9 | Werkzeug==1.0.1 10 | zope.event==4.5.0 11 | zope.interface==5.2.0 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Docker-ECS-herdoen/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 5000 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:5000", "wsgi:app"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Docker-ECS-herdoen/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | 6 | @app.route("/") 7 | def index(): 8 | return render_template("index.html") 9 | 10 | 11 | if __name__ == "__main__": 12 | app.run(host="0.0.0.0") 13 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Docker-ECS-herdoen/app/wsgi.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Docker-ECS-herdoen/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | services: 4 | web: 5 | build: . 6 | networks: 7 | - default 8 | ports: 9 | - 50000:5000 10 | restart: always -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Docker-ECS-herdoen/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gevent==21.1.2 4 | greenlet==1.0.0 5 | gunicorn==20.0.4 6 | itsdangerous==1.1.0 7 | Jinja2==2.11.2 8 | MarkupSafe==1.1.1 9 | Werkzeug==1.0.1 10 | zope.event==4.5.0 11 | zope.interface==5.2.0 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Heroku/.gitignore: -------------------------------------------------------------------------------- 1 | venv/ 2 | .git -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Heroku/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 5000 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:5000", "wsgi:app"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Heroku/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn wsgi:app -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Heroku/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def index(): 7 | return (render_template('index.html')) 8 | 9 | if __name__ == '__main__': 10 | app.run(host='0.0.0.0') 11 | 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Heroku/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gunicorn==20.0.4 4 | itsdangerous==1.1.0 5 | Jinja2==2.11.3 6 | MarkupSafe==1.1.1 7 | Werkzeug==1.0.1 8 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-GithubActions-Heroku/wsgi.py: -------------------------------------------------------------------------------- 1 | from app.app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-Heroku/.gitignore: -------------------------------------------------------------------------------- 1 | venv/ 2 | .git -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-Heroku/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 5000 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:5000", "wsgi:app"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-Heroku/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn wsgi:app -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-Heroku/README.md: -------------------------------------------------------------------------------- 1 | This is an example of how to deploy a Flask app by uploading the code to Github and use the existing Heroku-Github integration 2 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-Heroku/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def index(): 7 | return (render_template('index.html')) 8 | 9 | if __name__ == '__main__': 10 | app.run(host='0.0.0.0') 11 | 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-Heroku/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gunicorn==20.0.4 4 | itsdangerous==1.1.0 5 | Jinja2==2.11.3 6 | MarkupSafe==1.1.1 7 | Werkzeug==1.0.1 8 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-CICD-Heroku/wsgi.py: -------------------------------------------------------------------------------- 1 | from app.app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 5000 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:5000", "wsgi:app"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-Docker/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def index(): 7 | return (render_template('index.html')) 8 | 9 | if __name__ == '__main__': 10 | app.run(host='0.0.0.0') 11 | 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Docker/app/wsgi.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | services: 4 | web: 5 | build: . 6 | networks: 7 | - default 8 | ports: 9 | - 50000:5000 10 | restart: always -------------------------------------------------------------------------------- /Flask/Flask-Basic-Docker/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gevent==21.1.2 4 | greenlet==1.0.0 5 | gunicorn==20.0.4 6 | itsdangerous==1.1.0 7 | Jinja2==2.11.2 8 | MarkupSafe==1.1.1 9 | Werkzeug==1.0.1 10 | zope.event==4.5.0 11 | zope.interface==5.2.0 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Heroku/.gitignore: -------------------------------------------------------------------------------- 1 | venv/ -------------------------------------------------------------------------------- /Flask/Flask-Basic-Heroku/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 5000 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:5000", "wsgi:app"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-Heroku/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn wsgi:app -------------------------------------------------------------------------------- /Flask/Flask-Basic-Heroku/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def index(): 7 | return (render_template('index.html')) 8 | 9 | if __name__ == '__main__': 10 | app.run(host='0.0.0.0') 11 | 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Heroku/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | gunicorn==20.0.4 4 | itsdangerous==1.1.0 5 | Jinja2==2.11.3 6 | MarkupSafe==1.1.1 7 | Werkzeug==1.0.1 8 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Heroku/wsgi.py: -------------------------------------------------------------------------------- 1 | from app.app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 8081 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:8081", "wsgi", "-k", "gevent"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Docker/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | application = Flask(__name__) 4 | 5 | @application.route('/') 6 | def index(): 7 | return (render_template('index.html')) 8 | 9 | if __name__ == '__main__': 10 | application.run(host='0.0.0.0') 11 | 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Docker/app/wsgi.py: -------------------------------------------------------------------------------- 1 | from app import application 2 | 3 | if __name__ == "__main__": 4 | application.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Docker/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | itsdangerous==1.1.0 4 | Jinja2==2.11.2 5 | MarkupSafe==1.1.1 6 | Werkzeug==1.0.1 7 | gevent 8 | gunicorn 9 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Docker/waypoint.hcl: -------------------------------------------------------------------------------- 1 | project = "Flask Todo application" 2 | 3 | app "flask_todo_app" { 4 | labels = { 5 | "service" = "flask-todo", 6 | "env" = "dev" 7 | } 8 | build { 9 | use "docker" { 10 | } 11 | 12 | } 13 | 14 | deploy { 15 | use "docker" { 16 | service_port = 8081 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-ECR-ECS/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 8082 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:8082", "wsgi", "-k", "gevent"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-ECR-ECS/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn wsgi:app -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-ECR-ECS/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def index(): 7 | return (render_template('index.html')) 8 | 9 | if __name__ == '__main__': 10 | app.run(host='0.0.0.0') 11 | 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-ECR-ECS/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | itsdangerous==1.1.0 4 | Jinja2==2.11.2 5 | MarkupSafe==1.1.1 6 | Werkzeug==1.0.1 7 | gevent 8 | gunicorn 9 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-ECR-ECS/wsgi.py: -------------------------------------------------------------------------------- 1 | from app.app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Gitlab/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV LC_ALL=C.UTF-8 4 | ENV LANG=C.UTF-8 5 | 6 | RUN apt-get update -y && apt-get install -y python3-pip 7 | 8 | # We copy just the requirements.txt first to leverage Docker cache 9 | ADD requirements.txt /app/ 10 | 11 | WORKDIR /app 12 | 13 | RUN /bin/bash -c "pip3 install --no-cache-dir -r requirements.txt" 14 | 15 | ADD /app/ /app/ 16 | 17 | EXPOSE 8082 18 | 19 | CMD ["gunicorn", "-b", "0.0.0.0:8082", "wsgi", "-k", "gevent"] -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Gitlab/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn wsgi:app -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Gitlab/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def index(): 7 | return (render_template('index.html')) 8 | 9 | if __name__ == '__main__': 10 | app.run(host='0.0.0.0') 11 | 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Gitlab/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | itsdangerous==1.1.0 4 | Jinja2==2.11.2 5 | MarkupSafe==1.1.1 6 | Werkzeug==1.0.1 7 | gevent 8 | gunicorn 9 | -------------------------------------------------------------------------------- /Flask/Flask-Basic-Waypoint-Gitlab/wsgi.py: -------------------------------------------------------------------------------- 1 | from app.app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic/app/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def index(): 7 | return (render_template('index.html')) 8 | 9 | if __name__ == '__main__': 10 | app.run(host='0.0.0.0') 11 | 12 | -------------------------------------------------------------------------------- /Flask/Flask-Basic/app/wsgi.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | 3 | if __name__ == "__main__": 4 | app.run() 5 | -------------------------------------------------------------------------------- /Flask/Flask-Basic/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | Flask==1.1.2 3 | itsdangerous==1.1.0 4 | Jinja2==2.11.2 5 | MarkupSafe==1.1.1 6 | Werkzeug==1.0.1 7 | -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/.env.dev: -------------------------------------------------------------------------------- 1 | FLASK_APP=run.py 2 | FLASK_ENV=production 3 | DATABASE_URL=mysql+pymysql://root:12345678a-@mysql_container:3306/flask_todo 4 | SQL_HOST=db 5 | SQL_PORT=3306 6 | DATABASE=mysql 7 | APP_FOLDER=/usr/src/app 8 | -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | venv/* 3 | .DS_Store 4 | __pycache__ -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/app/admin/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | admin = Blueprint('admin', __name__) 4 | 5 | from . import routes -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/app/admin/forms.py: -------------------------------------------------------------------------------- 1 | from flask_wtf import FlaskForm 2 | from wtforms import StringField, SubmitField 3 | from wtforms.validators import DataRequired 4 | from wtforms.ext.sqlalchemy.fields import QuerySelectField 5 | 6 | from ..models import Task 7 | 8 | 9 | class TodoForm(FlaskForm): 10 | """ 11 | Form for admin to add or edit a department 12 | """ 13 | name = StringField('Name', validators=[DataRequired()]) 14 | description = StringField('Description', validators=[DataRequired()]) 15 | submit = SubmitField('Submit') -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/app/auth/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | auth = Blueprint('auth', __name__) 4 | 5 | from . import routes -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/app/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$DATABASE" = "mysql" ] 4 | then 5 | echo "Waiting for mysql..." 6 | 7 | while ! nc -z $SQL_HOST $SQL_PORT; do 8 | sleep 0.1 9 | done 10 | 11 | echo "MySQL started" 12 | fi 13 | 14 | python run.py create_db 15 | 16 | exec "$@" 17 | -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/app/home/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | home = Blueprint('home', __name__) 4 | 5 | from . import routes -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/app/templates/auth/login.html: -------------------------------------------------------------------------------- 1 | 2 | {% import "bootstrap/utils.html" as utils %} 3 | {% import "bootstrap/wtf.html" as wtf %} 4 | {% extends "base.html" %} 5 | {% block title %}Login{% endblock %} 6 | {% block body %} 7 |
8 |
9 | {{ utils.flashed_messages() }} 10 |
11 |
12 |

Login to your account

13 |
14 | {{ wtf.quick_form(form) }} 15 |
16 |
17 | {% endblock %} -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/app/templates/auth/register.html: -------------------------------------------------------------------------------- 1 | {% import "bootstrap/wtf.html" as wtf %} 2 | {% extends "base.html" %} 3 | {% block title %}Register{% endblock %} 4 | {% block body %} 5 |
6 |
7 |

Register for an account

8 |
9 | {{ wtf.quick_form(form) }} 10 |
11 |
12 | {% endblock %} -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/app/todo/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | todo = Blueprint('todo', __name__) 4 | 5 | from . import routes -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$DATABASE" = "mysql" ] 4 | then 5 | echo "Waiting for mysql..." 6 | 7 | while ! nc -z $SQL_HOST $SQL_PORT; do 8 | sleep 0.1 9 | done 10 | 11 | echo "MySQL started" 12 | fi 13 | 14 | python run.py create_db 15 | 16 | exec "$@" 17 | -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/migrations/README: -------------------------------------------------------------------------------- 1 | Generic single-database configuration. -------------------------------------------------------------------------------- /Flask/Flask-Todo-Bootstrap/web/run.py: -------------------------------------------------------------------------------- 1 | import os 2 | from flask.cli import FlaskGroup 3 | 4 | from app import create_app, db 5 | 6 | #config_name = os.getenv('FLASK_CONFIG') 7 | config_name = 'production' 8 | app = create_app(config_name) 9 | 10 | cli = FlaskGroup(app) 11 | 12 | @cli.command("create_db") 13 | def create_db(): 14 | db.drop_all() 15 | db.create_all() 16 | db.session.commit() 17 | 18 | if __name__ == '__main__': 19 | cli() 20 | #app.run() -------------------------------------------------------------------------------- /IOSXE_ModelDrivenTelemetry/netconf/vars/variables.yml: -------------------------------------------------------------------------------- 1 | subscriptions: 2 | 160: 3 | xpath: "/process-cpu-ios-xe-oper:cpu-usage/cpu-utilization/five-seconds" 4 | period: 1000 5 | 180: 6 | xpath: "/memory-ios-xe-oper:memory-statistics/memory-statistic" 7 | period: 1000 8 | -------------------------------------------------------------------------------- /IOSXE_ModelDrivenTelemetry/netmiko/mdt_get_subcriptions_netmiko.py: -------------------------------------------------------------------------------- 1 | from netmiko import Netmiko 2 | 3 | router = { 4 | 'ip': '10.10.20.30', 5 | 'port': '22', 6 | 'username': 'admin', 7 | 'password': 'Cisco123', 8 | 'device_type': 'cisco_xe' 9 | } 10 | 11 | net_connect = Netmiko(**router) 12 | output = net_connect.send_command("show telemetry ietf subscription all") 13 | print(output) 14 | net_connect.disconnect() -------------------------------------------------------------------------------- /IOSXE_ModelDrivenTelemetry/netmiko/templates/netmiko.j2: -------------------------------------------------------------------------------- 1 | {% for id, sub in data["subscriptions"].items() %} 2 | telemetry ietf subscription {{ id }} 3 | encoding encode-kvgpb 4 | filter xpath {{ sub["xpath"] }} 5 | stream yang-push 6 | update-policy periodic {{ sub["period"] }} 7 | receiver ip address 10.10.20.50 57500 protocol grpc-tcp 8 | {% endfor %} 9 | -------------------------------------------------------------------------------- /IOSXE_ModelDrivenTelemetry/netmiko/vars/variables.yml: -------------------------------------------------------------------------------- 1 | subscriptions: 2 | 120: 3 | xpath: "/process-cpu-ios-xe-oper:cpu-usage/cpu-utilization/five-seconds" 4 | period: 1000 5 | 130: 6 | xpath: "/memory-ios-xe-oper:memory-statistics/memory-statistic" 7 | period: 1000 8 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Amazon-CDK/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Amazon-CDK/amazon_cdk/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/InfraAsCode/Webserver/Amazon-CDK/amazon_cdk/__init__.py -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Amazon-CDK/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | pytest -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Amazon-CDK/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/AmazonCDK_existingVPC/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/AmazonCDK_existingVPC/amazon_cdk_existing_vpc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/InfraAsCode/Webserver/AmazonCDK_existingVPC/amazon_cdk_existing_vpc/__init__.py -------------------------------------------------------------------------------- /InfraAsCode/Webserver/AmazonCDK_existingVPC/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/AmazonCDK_existingVPC/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/AmazonCDK_newVPC/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | .venv 7 | *.egg-info 8 | 9 | # CDK asset staging directory 10 | .cdk.staging 11 | cdk.out 12 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/AmazonCDK_newVPC/amazon_cdk_new_vpc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/InfraAsCode/Webserver/AmazonCDK_newVPC/amazon_cdk_new_vpc/__init__.py -------------------------------------------------------------------------------- /InfraAsCode/Webserver/AmazonCDK_newVPC/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/AmazonCDK_newVPC/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_defaultVPC/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | venv/ 3 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_defaultVPC/Pulumi.yaml: -------------------------------------------------------------------------------- 1 | name: aws_ec2 2 | runtime: 3 | name: python 4 | options: 5 | virtualenv: venv 6 | description: A simple AWS EC2 instance 7 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_defaultVPC/requirements.txt: -------------------------------------------------------------------------------- 1 | pulumi>=3.0.0,<4.0.0 2 | pulumi-aws>=5.0.0,<6.0.0 3 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_existingVPC/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | venv/ 3 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_existingVPC/Pulumi.yaml: -------------------------------------------------------------------------------- 1 | name: aws_ec2_wim 2 | runtime: 3 | name: python 4 | options: 5 | virtualenv: venv 6 | description: A minimal AWS Python Pulumi program 7 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_existingVPC/requirements.txt: -------------------------------------------------------------------------------- 1 | pulumi>=3.0.0,<4.0.0 2 | pulumi-aws>=4.0.0,<5.0.0 3 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_newVPC/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | venv/ 3 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_newVPC/Pulumi.dev.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | aws:region: eu-central-1 3 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_newVPC/Pulumi.yaml: -------------------------------------------------------------------------------- 1 | name: aws_ec2_wim 2 | runtime: 3 | name: python 4 | options: 5 | virtualenv: venv 6 | description: A minimal AWS Python Pulumi program 7 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Pulumi_AWS_newVPC/requirements.txt: -------------------------------------------------------------------------------- 1 | pulumi>=3.0.0,<4.0.0 2 | pulumi-aws>=4.0.0,<5.0.0 3 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Terraform/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | version = "3.37.0" 6 | } 7 | } 8 | } 9 | 10 | provider "aws" { 11 | region = "eu-west-1" 12 | } 13 | 14 | module "webserver" { 15 | source = "./modules/ec2" 16 | 17 | servername = "Testserver-Terraform" 18 | instance_type = "t3.micro" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Terraform/modules/ec2/outputs.tf: -------------------------------------------------------------------------------- 1 | output "public_ip" { 2 | value = aws_instance.web.public_ip 3 | } -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Terraform/modules/ec2/variables.tf: -------------------------------------------------------------------------------- 1 | variable "instance_type" { 2 | type = string 3 | } 4 | 5 | variable "servername" { 6 | type = string 7 | } -------------------------------------------------------------------------------- /InfraAsCode/Webserver/Terraform/terraform.tfstate: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "0.14.5", 4 | "serial": 7, 5 | "lineage": "bad4b866-5b3c-c8d7-4bb6-082dba11f8b2", 6 | "outputs": {}, 7 | "resources": [] 8 | } 9 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/TerraformCDK/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | imports/* 3 | !imports/__init__.py 4 | .terraform 5 | cdktf.out 6 | cdktf.log 7 | *terraform.*.tfstate* -------------------------------------------------------------------------------- /InfraAsCode/Webserver/TerraformCDK/Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | name = "pypi" 3 | url = "https://pypi.org/simple" 4 | verify_ssl = true 5 | 6 | [requires] 7 | python_version = "3" 8 | 9 | [packages] 10 | cdktf = "~=0.4.1" 11 | -------------------------------------------------------------------------------- /InfraAsCode/Webserver/TerraformCDK/cdktf.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "python", 3 | "app": "pipenv run python main.py", 4 | "terraformProviders": [ 5 | "hashicorp/aws@~> 3.46" 6 | ], 7 | "terraformModules": [ 8 | "terraform-aws-modules/vpc/aws@3.1.0", 9 | "terraform-aws-modules/security-group/aws@4.2.0", 10 | "terraform-aws-modules/s3-bucket/aws@2.5.0" 11 | ], 12 | "codeMakerOutput": "imports", 13 | "context": { 14 | "excludeStackIdFromLogicalIds": "true", 15 | "allowSepCharsInLogicalIds": "true" 16 | } 17 | } -------------------------------------------------------------------------------- /KVM_Kubernetes_Ansible/Ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | host_key_checking = False 3 | -------------------------------------------------------------------------------- /KVM_Kubernetes_Ansible/Ansible/hosts: -------------------------------------------------------------------------------- 1 | #hosts 2 | [masters] 3 | master ansible_host=192.168.80.159 4 | 5 | [workers] 6 | worker1 ansible_host=192.168.80.160 7 | worker2 ansible_host=192.168.80.161 8 | 9 | [all:vars] 10 | ansible_ssh_private_key_file=/Users/wauterw/.ssh/homelab 11 | ansible_user=wim -------------------------------------------------------------------------------- /Napalm_Introduction/change_config.j2: -------------------------------------------------------------------------------- 1 | interface Loopback100 2 | description ***TEMPLATE LOOPBACK 100**** 3 | ip address {{interfaces.Loopback100.ipv4_addr}} {{interfaces.Loopback100.ipv4_mask}} 4 | ! 5 | interface Loopback200 6 | description ***TEMPLATE LOOPBACK 200**** 7 | ip address {{interfaces.Loopback200.ipv4_addr}} {{interfaces.Loopback200.ipv4_mask}} 8 | end -------------------------------------------------------------------------------- /Napalm_Introduction/change_config.yml: -------------------------------------------------------------------------------- 1 | interfaces: 2 | Loopback100: 3 | ipv4_addr: 4.4.4.101 4 | ipv4_mask: 255.255.255.255 5 | Loopback200: 6 | ipv4_addr: 1.1.1.20 7 | ipv4_mask: 255.255.255.255 -------------------------------------------------------------------------------- /Napalm_Introduction/validation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - get_facts: 3 | os_version: 6.5.3 4 | vendor: Cisco 5 | 6 | - get_interfaces_ip: 7 | Loopback200: 8 | ipv4: 9 | 1.1.1.200: 10 | prefix_length: 32 -------------------------------------------------------------------------------- /Netconf_Python/capabilities.py: -------------------------------------------------------------------------------- 1 | from ncclient import manager 2 | 3 | m = manager.connect(host='ios-xe-mgmt-latest.cisco.com', port='10000', username='developer', 4 | password='C1sco12345', device_params={'name':'iosxe'}, hostkey_verify=False) 5 | 6 | for capability in m.server_capabilities: 7 | print('*'* 50) 8 | print(capability) 9 | 10 | -------------------------------------------------------------------------------- /Netconf_Python/connect.py: -------------------------------------------------------------------------------- 1 | from ncclient import manager 2 | 3 | m = manager.connect(host='ios-xe-mgmt-latest.cisco.com', port='10000', username='developer', 4 | password='C1sco12345', device_params={'name':'iosxe'}, hostkey_verify=False) 5 | 6 | print(m.connected) -------------------------------------------------------------------------------- /Netconf_Python/running_config.py: -------------------------------------------------------------------------------- 1 | from ncclient import manager 2 | from pprint import pprint 3 | import xmltodict 4 | import xml.dom.minidom 5 | 6 | router = { 7 | 'host': 'ios-xe-mgmt-latest.cisco.com', 8 | 'port': '10000', 9 | 'username': 'developer', 10 | 'password': 'C1sco12345' 11 | } 12 | 13 | m = manager.connect(**router, device_params={'name':'iosxe'}, hostkey_verify=False) 14 | 15 | running_config = m.get_config('running').xml 16 | print(xml.dom.minidom.parseString(running_config).toprettyxml()) 17 | 18 | m.close_session() 19 | 20 | 21 | -------------------------------------------------------------------------------- /Netmiko_Introduction/changes.txt: -------------------------------------------------------------------------------- 1 | interface GigabitEthernet3 2 | description This is set via Netmiko and text file -------------------------------------------------------------------------------- /Netmiko_Introduction/loopback/hosts.yml: -------------------------------------------------------------------------------- 1 | # Define list of hosts 2 | --- 3 | hosts: 4 | - name: sbx-iosxr-mgmt.cisco.com 5 | username: admin 6 | password: C1sco12345 7 | port: 8181 8 | cmd: "show running-config" 9 | type: cisco_xr 10 | - name: ios-xe-mgmt-latest.cisco.com 11 | username: developer 12 | password: C1sco12345 13 | port: 8181 14 | cmd: "show running-config" 15 | type: cisco_xe -------------------------------------------------------------------------------- /Netmiko_Introduction/loopback/loopback.j2: -------------------------------------------------------------------------------- 1 | {% for interface in data.interfaces %} 2 | interface {{interface.name}} 3 | description {{interface.description}} 4 | ip address {{interface.ipv4_addr}} {{interface.ipv4_mask}} 5 | {% endfor %} -------------------------------------------------------------------------------- /Netmiko_Introduction/loopback/loopback.yml: -------------------------------------------------------------------------------- 1 | interfaces: 2 | - name: Loopback3001 3 | description: Description for Loopback 3001 4 | ipv4_addr: 200.200.200.230 5 | ipv4_mask: 255.255.255.255 6 | - name: Loopback3002 7 | description: Description for Loopback 3002 8 | ipv4_addr: 200.200.200.231 9 | ipv4_mask: 255.255.255.255 -------------------------------------------------------------------------------- /Netmiko_Introduction/netmiko_logging.py: -------------------------------------------------------------------------------- 1 | from netmiko import Netmiko 2 | import logging 3 | 4 | logging.basicConfig(filename='test.log', level=logging.DEBUG) 5 | logger = logging.getLogger("netmiko") 6 | 7 | cisco_xe = { 8 | "device_type": "cisco_xe", 9 | "ip": "ios-xe-mgmt-latest.cisco.com", 10 | "username": "developer", 11 | "password": "---", 12 | "port": "22", 13 | } 14 | 15 | net_connect = Netmiko(**cisco_xe) 16 | 17 | output = net_connect.send_command("show arp") 18 | net_connect.disconnect() 19 | print(output) -------------------------------------------------------------------------------- /Netmiko_Introduction/textFSM.py: -------------------------------------------------------------------------------- 1 | from netmiko import Netmiko 2 | 3 | cisco_xr = { 4 | "device_type": "cisco_xr", 5 | "ip": "sbx-iosxr-mgmt.cisco.com", 6 | "username": "admin", 7 | "password": "C1sco12345", 8 | "port": "8181", 9 | } 10 | 11 | net_connect = Netmiko(**cisco_xr) 12 | 13 | output = net_connect.send_command("show ip interface brief", use_textfsm=True) 14 | net_connect.disconnect() 15 | print(type(output)) 16 | 17 | for interface in output: 18 | print(interface['intf']) 19 | 20 | -------------------------------------------------------------------------------- /Netpalm_Introduction/get_configuration.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/get_configuration.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/.gitignore: -------------------------------------------------------------------------------- 1 | backend/plugins/ntc-templates/ 2 | *.pyc -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8 2 | WORKDIR /usr/local/lib/python3.8/site-packages 3 | RUN git clone https://github.com/networktocode/ntc-templates.git 4 | RUN mv ntc-templates ntc_templates 5 | ADD . /code 6 | WORKDIR /code 7 | RUN pip3 install --upgrade pip 8 | RUN pip3 install -r requirements.txt 9 | RUN ln -sf /usr/local/lib/python3.8/site-packages/ntc_templates/templates/ backend/plugins/ntc-templates 10 | CMD python3 netpalm.py 11 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/NOTICE: -------------------------------------------------------------------------------- 1 | code-exchange-repo-template 2 | 3 | Copyright (c) 2020, Cisco Systems, Inc. and/or its affiliates 4 | 5 | This project includes software developed at Cisco Systems, Inc. and/or its affiliates. 6 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/core/confload/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/core/confload/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/core/redis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/core/redis/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/core/routes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/core/routes/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/custom_scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/custom_scripts/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/getconfig/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/getconfig/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/jinja2/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/cisco_ios_add_ip_int.j2: -------------------------------------------------------------------------------- 1 | {% for int in interfaces -%} 2 | int {{int}} 3 | ip address {{interfaces[int]}} 4 | {% endfor %} 5 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/cisco_ios_create_vlans.j2: -------------------------------------------------------------------------------- 1 | {% for vlan in vlans -%} 2 | int vlan {{vlan}} 3 | no shut 4 | {% endfor -%} 5 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/cisco_ios_remove_ip_int.j2: -------------------------------------------------------------------------------- 1 | {% for int in interfaces -%} 2 | int {{int}} 3 | no ip address {{interfaces[int]}} 4 | {% endfor %} 5 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/cisco_ios_remove_vlans.j2: -------------------------------------------------------------------------------- 1 | {% for vlan in vlans -%} 2 | no int vlan {{vlan}} 3 | {% endfor -%} 4 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/loopback.j2: -------------------------------------------------------------------------------- 1 | {% for interface in interfaces %} 2 | interface {{interface.name}} 3 | description {{interface.description}} 4 | ip address {{interface.ipv4_addr}} {{interface.ipv4_mask}} 5 | {% endfor %} -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/loopback_create.j2: -------------------------------------------------------------------------------- 1 | {% for interface in interfaces %} 2 | interface {{interface.name}} 3 | description {{interface.description}} 4 | ip address {{interface.ipv4_addr}} {{interface.ipv4_mask}} 5 | {% endfor %} -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/loopback_remove.j2: -------------------------------------------------------------------------------- 1 | {% for interface in interfaces %} 2 | no interface {{interface.name}} 3 | {% endfor %} -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/jinja2_templates/test.j2: -------------------------------------------------------------------------------- 1 | {% for vlan in vlans -%} 2 | int vlan {{vlan}} 3 | no shut 4 | {% endfor -%} 5 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/napalm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/napalm/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/ncclient/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/netmiko/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/netmiko/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/ntc-templates: -------------------------------------------------------------------------------- 1 | /usr/local/lib/python3.8/site-packages/ntc_templates/templates/ -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/ntc-templates (WAUTERW-M-65P7's conflicted copy 2020-04-24): -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/ntc-templates (WAUTERW-M-65P7's conflicted copy 2020-04-24) -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/restconf/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/restconf/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/scriptrunner/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/scriptrunner/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/service/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/service/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/setconfig/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/setconfig/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/backend/plugins/textfsm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/backend/plugins/textfsm/__init__.py -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | netpalm: 4 | build: . 5 | environment: 6 | - NET_TEXTFSM=/usr/local/lib/python3.8/site-packages/ntc_templates/templates/ 7 | ports: 8 | - "9000:9000" 9 | volumes: 10 | - .:/code 11 | depends_on: 12 | - redis 13 | redis: 14 | image: redis 15 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/images/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/images/arch.png -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/images/netpalm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/images/netpalm.png -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/images/netpalm_concept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/images/netpalm_concept.png -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/images/netpalm_eg_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/images/netpalm_eg_1.png -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/images/netpalm_eg_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/images/netpalm_eg_2.png -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/images/netpalm_eg_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/images/netpalm_eg_3.png -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/images/netpalm_eg_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/images/netpalm_eg_4.png -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/images/netpalm_ingest.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/images/netpalm_ingest.gif -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/images/netpalm_postman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/images/netpalm_postman.png -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | netmiko 3 | napalm 4 | ncclient 5 | requests 6 | redis 7 | rq 8 | xmltodict 9 | jinja2 10 | jinja2schema 11 | jsonschema 12 | -------------------------------------------------------------------------------- /Netpalm_Introduction/netpalm/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Netpalm_Introduction/netpalm/tests/__init__.py -------------------------------------------------------------------------------- /Nornir_Introduction/inventory/defaults.yml: -------------------------------------------------------------------------------- 1 | ## Nornir Defaults File 2 | --- 3 | platform: ios 4 | port: 8181 5 | username: "developer" 6 | password: "C1sco12345" -------------------------------------------------------------------------------- /Nornir_Introduction/inventory/groups.yml: -------------------------------------------------------------------------------- 1 | ## Nornir Groups File 2 | --- 3 | Devnet: 4 | data: 5 | ntp: 6 | servers: 7 | - 1.1.1.1 8 | -------------------------------------------------------------------------------- /Nornir_Introduction/inventory/hosts.yml: -------------------------------------------------------------------------------- 1 | # Nornir Hosts File 2 | --- 3 | DEV01: 4 | hostname: ios-xe-mgmt.cisco.com 5 | groups: 6 | - Devnet 7 | 8 | DEV02: 9 | hostname: ios-xe-mgmt-latest.cisco.com 10 | groups: 11 | - Devnet -------------------------------------------------------------------------------- /Nornir_Introduction/nornir_config.yml: -------------------------------------------------------------------------------- 1 | ## Nornir Config File 2 | --- 3 | runners: 4 | plugin: threaded 5 | options: 6 | num_workers: 10 7 | 8 | inventory: 9 | plugin: "SimpleInventory" 10 | options: 11 | host_file: "./inventory/hosts.yml" 12 | group_file: "./inventory/groups.yml" 13 | defaults_file: "./inventory/defaults.yml" -------------------------------------------------------------------------------- /Nornir_Introduction/nornir_part1.py: -------------------------------------------------------------------------------- 1 | from nornir import InitNornir 2 | from nornir_utils.plugins.functions import print_result 3 | 4 | nornir = InitNornir('nornir_config.yml') 5 | print(nornir.inventory.hosts) 6 | 7 | r1 = nornir.inventory.hosts['DEV01'] 8 | 9 | print(f"Group: {r1.groups}") 10 | print(f"Hostname: {r1.hostname}") 11 | print(f"Username: {r1.username}") 12 | print(f"Password: {r1.password}") -------------------------------------------------------------------------------- /Nornir_Introduction/nornir_part3.py: -------------------------------------------------------------------------------- 1 | from nornir import InitNornir 2 | from nornir_napalm.plugins.tasks import napalm_get, napalm_cli 3 | from nornir_utils.plugins.functions import print_result 4 | 5 | nornir = InitNornir('nornir_config.yml') 6 | 7 | #result = nornir.run(task=napalm_get, getters=["interfaces"]) 8 | #print_result(result) 9 | 10 | r2 = nornir.filter(name="DEV02") 11 | 12 | result = r2.run(napalm_cli, commands=['show version', 'show ip int brief']) 13 | print_result(result) -------------------------------------------------------------------------------- /Packer/DigitalOcean-Packer/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | -------------------------------------------------------------------------------- /Packer/DigitalOcean-Packer/scripts/software_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo "Configuring users" 5 | sudo adduser ubuntu --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password 6 | echo "ubuntu:ubuntu" | sudo chpasswd 7 | 8 | echo 'Performing apt updates ...' 9 | sudo apt -y update 10 | sudo apt -y dist-upgrade 11 | sudo apt -y upgrade 12 | echo 'Installing net-tools ...' 13 | sudo apt install -y net-tools 14 | echo 'Installing nginx ...' 15 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Packer/DigitalOcean-Packer/variables.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "api_key" { 2 | description = "API Key DigitalOcean" 3 | default = env("DO_API_KEY") 4 | } -------------------------------------------------------------------------------- /Packer/Docker_Packer_HashicorpTools/scripts/packer_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo 'Performing apt updates ...' 5 | apt -y update 6 | apt -y dist-upgrade 7 | apt -y upgrade 8 | echo 'Installing general tools ...' 9 | apt-get install wget unzip mkisofs -y 10 | echo 'Installing Packer ...' 11 | wget --quiet https://releases.hashicorp.com/packer/1.8.0/packer_1.8.0_linux_amd64.zip && unzip packer_1.8.0_linux_amd64.zip && mv packer /usr/local/bin -------------------------------------------------------------------------------- /Packer/Docker_Packer_HashicorpTools/scripts/terraform_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo 'Performing apt updates ...' 5 | apt -y update 6 | apt -y dist-upgrade 7 | apt -y upgrade 8 | echo 'Installing general tools ...' 9 | apt-get install wget unzip mkisofs -y 10 | echo 'Installing Terraform ...' 11 | wget --quiet https://releases.hashicorp.com/terraform/1.1.8/terraform_1.1.8_linux_arm64.zip && unzip terraform_1.1.8_linux_arm64.zip && mv terraform /usr/local/bin 12 | 13 | -------------------------------------------------------------------------------- /Packer/Docker_Packer_HashicorpTools/variables.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "docker_repo" { 2 | type = string 3 | default = "wiwa1978/hashicorp-tools" 4 | sensitive = true 5 | } 6 | 7 | variable "docker_username" { 8 | type = string 9 | default = "wiwa1978" 10 | sensitive = true 11 | } 12 | 13 | variable "docker_password" { 14 | type = string 15 | default = "***" 16 | sensitive = true 17 | } 18 | -------------------------------------------------------------------------------- /Packer/vSphere-Packer_20.04/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | -------------------------------------------------------------------------------- /Packer/vSphere-Packer_20.04/http/meta-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Packer/vSphere-Packer_20.04/http/meta-data -------------------------------------------------------------------------------- /Packer/vSphere-Packer_20.04/scripts/fix_vm_customization_bug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | # Apply workaround to fix VMware customization bug (https://kb.vmware.com/s/article/59687) 4 | sudo /usr/bin/sed -i 's/\[Unit]/\[Unit\]\nAfter=dbus.service/' /lib/systemd/system/open-vm-tools.service -------------------------------------------------------------------------------- /Packer/vSphere-Packer_20.04/scripts/software_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo 'Performing apt updates ...' 5 | sudo apt -y update 6 | sudo apt -y dist-upgrade 7 | sudo apt -y upgrade 8 | echo 'Installing net-tools ...' 9 | sudo apt install -y net-tools 10 | echo 'Installing nginx ...' 11 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Packer/vSphere-Packer_22.04/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | -------------------------------------------------------------------------------- /Packer/vSphere-Packer_22.04/http/meta-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/Packer/vSphere-Packer_22.04/http/meta-data -------------------------------------------------------------------------------- /Packer/vSphere-Packer_22.04/scripts/fix_vm_customization_bug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | # Apply workaround to fix VMware customization bug (https://kb.vmware.com/s/article/59687) 4 | sudo /usr/bin/sed -i 's/\[Unit]/\[Unit\]\nAfter=dbus.service/' /lib/systemd/system/open-vm-tools.service -------------------------------------------------------------------------------- /Packer/vSphere-Packer_22.04/scripts/software_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo 'Performing apt updates ...' 5 | sudo apt -y update 6 | sudo apt -y dist-upgrade 7 | sudo apt -y upgrade 8 | echo 'Installing net-tools ...' 9 | sudo apt install -y net-tools 10 | echo 'Installing nginx ...' 11 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Packer_Introduction/AWS/WithProvisioner/helloworld.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Hello World" -------------------------------------------------------------------------------- /Packer_Introduction/AWS/WithProvisioner/helloworld.txt: -------------------------------------------------------------------------------- 1 | Hello World -------------------------------------------------------------------------------- /Packer_Introduction/DigitalOcean/scripts/nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | apt-get update -y 3 | apt-get upgrade -y 4 | 5 | apt-get install -y nginx 6 | 7 | systemctl enable nginx 8 | systemctl start nginx -------------------------------------------------------------------------------- /Paramiko_Introduction/connection.py: -------------------------------------------------------------------------------- 1 | import paramiko 2 | 3 | def get_connection(host, username, password, port): 4 | ssh = paramiko.SSHClient() 5 | ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) 6 | ssh.connect(hostname=host,username=username, password=password, port=port, look_for_keys=False, allow_agent=False) 7 | return ssh -------------------------------------------------------------------------------- /Parse_YAML_Python/parseYAML.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | from pprint import pprint 3 | 4 | # Read YAML configuration 5 | yml_file = open("variables.yaml").read() 6 | pprint(yml_file) 7 | yml_dict = yaml.load(yml_file, yaml.SafeLoader) 8 | 9 | tenant_name = yml_dict['tenant'] 10 | vrf_name = yml_dict['vrf'] 11 | bd_name = yml_dict['bridge_domains'][0]['bd'] 12 | 13 | print("The variables are: ") 14 | print(f"Tenant name {tenant_name}") 15 | print(f"VRF name {vrf_name}") 16 | print(f"BD name {bd_name}") -------------------------------------------------------------------------------- /Parse_YAML_Python/variables.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | tenant: "Tenant_Wim" 3 | vrf: "VRF_Wim" 4 | bridge_domains: 5 | - bd: "BD_Wim" 6 | gateway: "10.16.100.1" 7 | mask: "24" 8 | scope: "shared" 9 | l3_out: "labinfra-l3out-ro" -------------------------------------------------------------------------------- /Python_AMQP/receive.py: -------------------------------------------------------------------------------- 1 | import pika 2 | 3 | connection = pika.BlockingConnection( 4 | pika.ConnectionParameters(host='localhost')) 5 | channel = connection.channel() 6 | 7 | channel.queue_declare(queue='hello') 8 | 9 | 10 | def callback(ch, method, properties, body): 11 | print(" [x] Received %r" % body) 12 | 13 | 14 | channel.basic_consume( 15 | queue='hello', on_message_callback=callback, auto_ack=True) 16 | 17 | print(' [*] Waiting for messages. To exit press CTRL+C') 18 | channel.start_consuming() -------------------------------------------------------------------------------- /Python_AMQP/send.py: -------------------------------------------------------------------------------- 1 | import pika 2 | 3 | connection = pika.BlockingConnection( 4 | pika.ConnectionParameters(host='localhost')) 5 | channel = connection.channel() 6 | 7 | channel.queue_declare(queue='hello') 8 | 9 | channel.basic_publish(exchange='', routing_key='hello', body='Hello World!') 10 | print(" [x] Sent 'Hello World123!'") 11 | connection.close() -------------------------------------------------------------------------------- /Python_Coinmarketcap/.gitignore: -------------------------------------------------------------------------------- 1 | cred.txt -------------------------------------------------------------------------------- /SDWAN_PythonRequests/bijhouden.txt: -------------------------------------------------------------------------------- 1 | 2 | for template in templates: 3 | print({template['deviceType']}) 4 | 5 | if isinstance({template['deviceType']}, list): 6 | print("this is a list") 7 | else: 8 | print(f"Template => {template['deviceType']} with id {template['templateId']}") 9 | -------------------------------------------------------------------------------- /Scrapli Introduction/example1.py: -------------------------------------------------------------------------------- 1 | from scrapli.driver.core import IOSXEDriver 2 | 3 | device = { 4 | "host": "ios-xe-mgmt-latest.cisco.com", 5 | "auth_username": "developer", 6 | "auth_password": "C1sco12345", 7 | "port": 8181, 8 | "auth_strict_key": False, 9 | } 10 | 11 | conn = IOSXEDriver(**device) 12 | conn.open() 13 | responses = conn.send_commands(["show version", "show ip int brief"]) 14 | 15 | for response in responses: 16 | print("RESPONSE") 17 | print("*" * 100) 18 | print(response.result) 19 | conn.close() -------------------------------------------------------------------------------- /Terraform/DigitalOcean-K8S/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | default = "2c***5" 3 | } 4 | 5 | variable "region" { 6 | default = "ams3" 7 | } 8 | 9 | variable "k8s_clustername" { 10 | default = "clusterwim" 11 | } 12 | 13 | variable "k8s_version" { 14 | default = "1.19.3-do.3" 15 | } 16 | 17 | variable "k8s_poolname" { 18 | default = "worker-pool" 19 | } 20 | 21 | variable "k8s_count" { 22 | default = "3" 23 | } 24 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-K8S/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | } 6 | } 7 | required_version = ">= 0.13" 8 | } 9 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-SingleDroplet/create_server.tf: -------------------------------------------------------------------------------- 1 | provider "digitalocean"{ 2 | token = var.do_token 3 | } 4 | 5 | resource "digitalocean_droplet" "myserver" { 6 | count = var.number_servers 7 | name = "server-${count.index}" 8 | image = "ubuntu-18-04-x64" 9 | size = "1gb" 10 | region = var.region 11 | ssh_keys = [ 12 | var.ssh_fingerprint 13 | ] 14 | tags = ["${digitalocean_tag.webserver.id}"] 15 | } 16 | 17 | resource "digitalocean_tag" "webserver" { 18 | name = "webserver" 19 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-SingleDroplet/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | default = "82c33***2f56d" 3 | } 4 | 5 | variable "region" { 6 | default = "AMS3" 7 | } 8 | 9 | variable "ssh_fingerprint" { 10 | default = "5a:25:***:c9:8d:03" 11 | } 12 | 13 | 14 | variable "number_servers" { 15 | default = "2" 16 | } 17 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-LoadbalancerSetup/provider.tf: -------------------------------------------------------------------------------- 1 | provider "digitalocean" { 2 | token = var.do_token 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-LoadbalancerSetup/terraform.tfvars: -------------------------------------------------------------------------------- 1 | do_token = "dop_v1_***" 2 | name = "server" 3 | image = "ubuntu-21-10-x64" 4 | domain_name = "wimwauters.com" 5 | region = "ams3" 6 | ssh_key = "key_digitalocean_2020" 7 | project_name = "Project Terraform" 8 | amount = 2 -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-LoadbalancerSetup/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" {} 2 | variable "name" {} 3 | variable "image" {} 4 | variable "domain_name" {} 5 | variable "region" {} 6 | variable "ssh_key" {} 7 | variable "project_name" {} 8 | variable "amount" {} -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-LoadbalancerSetup/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/project/main.tf: -------------------------------------------------------------------------------- 1 | 2 | resource "digitalocean_project" "terraform_project" { 3 | name = var.project_name 4 | resources = var.resources 5 | } 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/project/outputs.tf: -------------------------------------------------------------------------------- 1 | output "project_id" { 2 | value = digitalocean_project.terraform_project.id 3 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/project/variables.tf: -------------------------------------------------------------------------------- 1 | variable "project_name" {} 2 | variable "resources" {} -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/project/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/record/main.tf: -------------------------------------------------------------------------------- 1 | data "digitalocean_domain" "server" { 2 | name = var.domain_name 3 | } 4 | 5 | resource "digitalocean_record" "www" { 6 | domain = data.digitalocean_domain.server.id 7 | type = "A" 8 | name = var.name 9 | value = var.value 10 | } 11 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/record/outputs.tf: -------------------------------------------------------------------------------- 1 | output "record_fqdn" { 2 | value = digitalocean_record.www.fqdn 3 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/record/variables.tf: -------------------------------------------------------------------------------- 1 | variable "domain_name" {} 2 | variable "name" {} 3 | variable "value" {} 4 | 5 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/record/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/server/outputs.tf: -------------------------------------------------------------------------------- 1 | output "droplet_ip_address" { 2 | value = digitalocean_droplet.server.ipv4_address 3 | } 4 | 5 | 6 | output "droplet_id" { 7 | value = digitalocean_droplet.server.id 8 | } 9 | 10 | output "droplet_name" { 11 | value = digitalocean_droplet.server.name 12 | } 13 | 14 | 15 | output "droplet_urn" { 16 | value = digitalocean_droplet.server.urn 17 | } 18 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/server/scripts/software_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo "Configuring users" 5 | sudo adduser ubuntu --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password 6 | echo "ubuntu:ubuntu" | sudo chpasswd 7 | 8 | echo 'Performing apt updates ...' 9 | sudo apt -y update 10 | echo 'Installing net-tools ...' 11 | sudo apt install -y net-tools 12 | echo 'Installing nginx ...' 13 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/server/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" {} 2 | variable "environment" {} 3 | variable "image" {} 4 | variable "tag" {} 5 | variable "domain_name" {} 6 | variable "region" {} 7 | variable "ssh_key" {} 8 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/modules/server/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/outputs.tf: -------------------------------------------------------------------------------- 1 | // output "server_ip_address" { 2 | // value = module.ubuntu-server.droplet_ip_address 3 | // } 4 | 5 | // output "server_record" { 6 | // value = module.server-record.record_fqdn 7 | // } 8 | 9 | 10 | // output "project_id" { 11 | // value = module.terraform-project.project_id 12 | // } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/provider.tf: -------------------------------------------------------------------------------- 1 | provider "digitalocean"{ 2 | token = var.do_token 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" {} 2 | variable "domain_name" {} 3 | variable "ssh_key" {} 4 | variable "project_name" {} 5 | variable "servers" { 6 | type = map 7 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved-Alternative/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/project/main.tf: -------------------------------------------------------------------------------- 1 | 2 | resource "digitalocean_project" "terraform_project" { 3 | name = var.project_name 4 | resources = var.resources 5 | } 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/project/outputs.tf: -------------------------------------------------------------------------------- 1 | output "project_id" { 2 | value = digitalocean_project.terraform_project.id 3 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/project/variables.tf: -------------------------------------------------------------------------------- 1 | variable "project_name" {} 2 | variable "resources" {} -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/project/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/record/main.tf: -------------------------------------------------------------------------------- 1 | data "digitalocean_domain" "server" { 2 | name = var.domain_name 3 | } 4 | 5 | resource "digitalocean_record" "www" { 6 | domain = data.digitalocean_domain.server.id 7 | type = "A" 8 | name = var.name 9 | value = var.value 10 | } 11 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/record/outputs.tf: -------------------------------------------------------------------------------- 1 | output "record_fqdn" { 2 | value = digitalocean_record.www.fqdn 3 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/record/variables.tf: -------------------------------------------------------------------------------- 1 | variable "domain_name" {} 2 | variable "name" {} 3 | variable "value" {} 4 | 5 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/record/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/server/scripts/software_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo "Configuring users" 5 | sudo adduser ubuntu --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password 6 | echo "ubuntu:ubuntu" | sudo chpasswd 7 | 8 | echo 'Performing apt updates ...' 9 | sudo apt -y update 10 | echo 'Installing net-tools ...' 11 | sudo apt install -y net-tools 12 | echo 'Installing nginx ...' 13 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/server/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" {} 2 | variable "environment" {} 3 | variable "image" {} 4 | variable "tag" {} 5 | variable "domain_name" {} 6 | variable "region" {} 7 | variable "ssh_key" {} 8 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/modules/server/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/outputs.tf: -------------------------------------------------------------------------------- 1 | // output "server_ip_address" { 2 | // value = module.ubuntu-server.droplet_ip_address 3 | // } 4 | 5 | // output "server_record" { 6 | // value = module.server-record.record_fqdn 7 | // } 8 | 9 | 10 | // output "project_id" { 11 | // value = module.terraform-project.project_id 12 | // } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/provider.tf: -------------------------------------------------------------------------------- 1 | provider "digitalocean"{ 2 | token = var.do_token 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" {} 2 | variable "domain_name" {} 3 | variable "ssh_key" {} 4 | variable "project_name" {} 5 | variable "servers" { 6 | type = map 7 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers-Modules-Improved/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers/provider.tf: -------------------------------------------------------------------------------- 1 | provider "digitalocean" { 2 | token = var.do_token 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers/scripts/software_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo "Configuring users" 5 | sudo adduser ubuntu --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password 6 | echo "ubuntu:ubuntu" | sudo chpasswd 7 | 8 | echo 'Performing apt updates ...' 9 | sudo apt -y update 10 | echo 'Installing net-tools ...' 11 | sudo apt install -y net-tools 12 | echo 'Installing nginx ...' 13 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers/terraform.tfvars: -------------------------------------------------------------------------------- 1 | do_token = "dop_v1_***" 2 | domain_name = "wimwauters.com" 3 | ssh_key = "key_digitalocean_2020" 4 | project_name = "Project Terraform" 5 | servers = { 6 | server1 = { 7 | size = "s-2vcpu-2gb" 8 | image = "ubuntu-21-10-x64" 9 | region = "ams3", 10 | tags = ["web", "development"] 11 | }, 12 | server2 = { 13 | size = "s-2vcpu-2gb" 14 | image = "ubuntu-20-04-x64" 15 | region = "lon1", 16 | tags = ["web", "staging"] 17 | } 18 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" {} 2 | variable "domain_name" {} 3 | variable "ssh_key" {} 4 | variable "project_name" {} 5 | variable "servers" {} -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-MultipleServers/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/project/main.tf: -------------------------------------------------------------------------------- 1 | 2 | resource "digitalocean_project" "terraform_project" { 3 | name = var.project_name 4 | resources = var.resources 5 | } 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/project/outputs.tf: -------------------------------------------------------------------------------- 1 | output "project_id" { 2 | value = digitalocean_project.terraform_project.id 3 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/project/variables.tf: -------------------------------------------------------------------------------- 1 | variable "project_name" {} 2 | variable "resources" {} -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/project/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/record/main.tf: -------------------------------------------------------------------------------- 1 | data "digitalocean_domain" "server" { 2 | name = var.domain_name 3 | } 4 | 5 | resource "digitalocean_record" "www" { 6 | domain = data.digitalocean_domain.server.id 7 | type = "A" 8 | name = var.name 9 | value = var.value 10 | } 11 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/record/outputs.tf: -------------------------------------------------------------------------------- 1 | output "record_fqdn" { 2 | value = digitalocean_record.www.fqdn 3 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/record/variables.tf: -------------------------------------------------------------------------------- 1 | variable "domain_name" {} 2 | variable "name" {} 3 | variable "value" {} 4 | 5 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/record/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/server/outputs.tf: -------------------------------------------------------------------------------- 1 | output "droplet_ip_address" { 2 | value = digitalocean_droplet.server.ipv4_address 3 | } 4 | 5 | output "droplet_id" { 6 | value = digitalocean_droplet.server.id 7 | } 8 | 9 | output "droplet_name" { 10 | value = digitalocean_droplet.server.name 11 | } 12 | 13 | output "droplet_urn" { 14 | value = digitalocean_droplet.server.urn 15 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/server/scripts/software_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo "Configuring users" 5 | sudo adduser ubuntu --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password 6 | echo "ubuntu:ubuntu" | sudo chpasswd 7 | 8 | echo 'Performing apt updates ...' 9 | sudo apt -y update 10 | echo 'Installing net-tools ...' 11 | sudo apt install -y net-tools 12 | echo 'Installing nginx ...' 13 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/server/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" {} 2 | variable "environment" {} 3 | variable "image" {} 4 | variable "tag" {} 5 | variable "domain_name" {} 6 | variable "region" {} 7 | variable "ssh_key" {} 8 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/modules/server/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/outputs.tf: -------------------------------------------------------------------------------- 1 | output "server_ip_address" { 2 | value = module.ubuntu-server.droplet_ip_address 3 | } 4 | 5 | output "server_record" { 6 | value = module.server-record.record_fqdn 7 | } 8 | 9 | 10 | output "project_id" { 11 | value = module.terraform-project.project_id 12 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/provider.tf: -------------------------------------------------------------------------------- 1 | provider "digitalocean"{ 2 | token = var.do_token 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/terraform.tfvars: -------------------------------------------------------------------------------- 1 | do_token = "dop_v1_***" 2 | name = "server" 3 | environment = "Development" 4 | tag = "Server" 5 | image = "ubuntu-21-10-x64" 6 | domain_name = "wimwauters.com" 7 | region = "ams3" 8 | ssh_key = "key_digitalocean_2020" 9 | project_name = "Project Terraform" -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" {} 2 | variable "name" {} 3 | variable "environment" {} 4 | variable "image" {} 5 | variable "tag" {} 6 | variable "domain_name" {} 7 | variable "region" {} 8 | variable "ssh_key" {} 9 | variable "project_name" {} 10 | 11 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules-Improved/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules/modules/server/outputs.tf: -------------------------------------------------------------------------------- 1 | output "droplet_ip_address" { 2 | value = digitalocean_droplet.server.ipv4_address 3 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules/modules/server/scripts/software_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo "Configuring users" 5 | sudo adduser ubuntu --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password 6 | echo "ubuntu:ubuntu" | sudo chpasswd 7 | 8 | echo 'Performing apt updates ...' 9 | sudo apt -y update 10 | echo 'Installing net-tools ...' 11 | sudo apt install -y net-tools 12 | echo 'Installing nginx ...' 13 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules/modules/server/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" {} 2 | variable "environment" {} 3 | variable "image" {} 4 | variable "tag" {} 5 | variable "domain_name" {} 6 | variable "region" {} 7 | variable "ssh_key" {} 8 | variable "project_name" {} 9 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules/modules/server/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules/provider.tf: -------------------------------------------------------------------------------- 1 | provider "digitalocean"{ 2 | token = var.do_token 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules/terraform.tfvars: -------------------------------------------------------------------------------- 1 | do_token = "dop_v1_***" 2 | name = "server" 3 | environment = "Development" 4 | tag = "Server" 5 | image = "ubuntu-21-10-x64" 6 | domain_name = "wimwauters.com" 7 | region = "ams3" 8 | ssh_key = "key_digitalocean_2020" 9 | project_name = "Project Terraform" -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" {} 2 | variable "name" {} 3 | variable "environment" {} 4 | variable "image" {} 5 | variable "tag" {} 6 | variable "domain_name" {} 7 | variable "region" {} 8 | variable "ssh_key" {} 9 | variable "project_name" {} 10 | 11 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer-Modules/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer/provider.tf: -------------------------------------------------------------------------------- 1 | provider "digitalocean"{ 2 | token = var.do_token 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer/scripts/software_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | #export DEBIAN_FRONTEND=noninteractive 4 | echo "Configuring users" 5 | sudo adduser ubuntu --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password 6 | echo "ubuntu:ubuntu" | sudo chpasswd 7 | 8 | echo 'Performing apt updates ...' 9 | sudo apt -y update 10 | echo 'Installing net-tools ...' 11 | sudo apt install -y net-tools 12 | echo 'Installing nginx ...' 13 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer/terraform.tfvars: -------------------------------------------------------------------------------- 1 | do_token = "dop_v1_***" 2 | name = "server" 3 | environment = "Development" 4 | tag = "Server" 5 | image = "ubuntu-21-10-x64" 6 | domain_name = "wimwauters.com" 7 | region = "ams3" 8 | ssh_key = "key_digitalocean_2020" 9 | project_name = "Project Terraform" -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" {} 2 | variable "name" {} 3 | variable "environment" {} 4 | variable "image" {} 5 | variable "tag" {} 6 | variable "domain_name" {} 7 | variable "region" {} 8 | variable "ssh_key" {} 9 | variable "project_name" {} 10 | -------------------------------------------------------------------------------- /Terraform/DigitalOcean-Terraform-SingleServer/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/Import/ec2.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | access_key = "***" 3 | secret_key = "***" 4 | region = "eu-west-3" 5 | } 6 | 7 | resource "aws_instance" "import_ec2" { 8 | ami = var.aws_ami 9 | instance_type = var.instance_type 10 | key_name = var.key_name 11 | tags = { 12 | name = "imported-instance" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Terraform/Import/variables.tf: -------------------------------------------------------------------------------- 1 | variable "aws_ami" { 2 | default = "ami-00798d7180f25aac2" 3 | } 4 | 5 | variable "instance_type" { 6 | default = "t2.micro" 7 | } 8 | 9 | variable "key_name" { 10 | default = "AWS_Paris" 11 | } -------------------------------------------------------------------------------- /Terraform/MSO/.terraform.tfstate.lock.info: -------------------------------------------------------------------------------- 1 | {"ID":"9405d5ae-fe8b-4363-2091-456213a3466f","Operation":"OperationTypeApply","Info":"","Who":"wauterw@WAUTERW-M-65P7","Version":"0.13.5","Created":"2021-02-02T13:55:51.747478Z","Path":"terraform.tfstate"} -------------------------------------------------------------------------------- /Terraform/MSO/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | mso = { 4 | source = "ciscodevnet/mso" 5 | version = "0.1.5" 6 | } 7 | } 8 | } 9 | 10 | provider "mso" { 11 | username = var.username 12 | password = var.password 13 | url = var.url 14 | insecure = true 15 | } 16 | -------------------------------------------------------------------------------- /Terraform/Terraform_Python_Jinja2/main.py: -------------------------------------------------------------------------------- 1 | from jinja2 import Environment 2 | from jinja2 import FileSystemLoader 3 | import yaml 4 | 5 | my_template = Environment(loader=FileSystemLoader("templates"), trim_blocks=True, lstrip_blocks=True) 6 | 7 | variables = yaml.load(open("variables.yml"), Loader=yaml.SafeLoader) 8 | print(variables) 9 | 10 | template = my_template.get_template("terraform.j2") 11 | result = template.render(data=variables) 12 | print(result) 13 | -------------------------------------------------------------------------------- /Terraform/Terraform_Python_Jinja2/requirements.txt: -------------------------------------------------------------------------------- 1 | Jinja2==3.0.2 2 | MarkupSafe==2.0.1 3 | PyYAML==6.0 4 | -------------------------------------------------------------------------------- /Terraform/Terraform_Python_Jinja2/variables.yml: -------------------------------------------------------------------------------- 1 | --- 2 | vpcs: 3 | - id: VPC1 4 | name: VPC1 5 | cidr: 10.0.0.0/16 6 | - id: VPC2 7 | name: VPC2 8 | cidr: 10.1.0.0/16 9 | subnets: 10 | - id: SUBNET1 11 | vpc_id: VPC1 12 | name: Subnet1 13 | availability_zone: eu-central-1a 14 | - id: SUBNET2 15 | vpc_id: VPC2 16 | name: Subnet2 17 | availability_zone: eu-central-1a 18 | -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10/modules/ubuntu-server/output.tf: -------------------------------------------------------------------------------- 1 | output "vm_name" { 2 | description = "Server VM Name" 3 | value = vsphere_virtual_machine.vm.*.name 4 | } 5 | 6 | output "ip_address" { 7 | description = "Server IP Address" 8 | value = var.network_ip 9 | } -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10/modules/ubuntu-server/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.0.10" 3 | 4 | required_providers { 5 | vsphere = { 6 | source = "hashicorp/vsphere" 7 | version = ">= 2.0.2" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10/output.tf: -------------------------------------------------------------------------------- 1 | output "vm_name" { 2 | value = module.ubuntu-server.vm_name 3 | } 4 | 5 | output "vm_ip_address" { 6 | value = module.ubuntu-server.ip_address 7 | } -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.0.10" 3 | 4 | required_providers { 5 | vsphere = { 6 | source = "hashicorp/vsphere" 7 | version = ">= 2.0.2" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10_install_software/modules/ubuntu-server/output.tf: -------------------------------------------------------------------------------- 1 | output "vm_name" { 2 | description = "Server VM Name" 3 | value = vsphere_virtual_machine.vm.*.name 4 | } 5 | 6 | output "ip_address" { 7 | description = "Server IP Address" 8 | value = var.network_ip 9 | } -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10_install_software/modules/ubuntu-server/scripts/02_install_nginx.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | sudo apt update -y 6 | sudo apt install -y nginx -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10_install_software/modules/ubuntu-server/scripts/03_install_docker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | sudo apt update -y 6 | sudo apt install -y apt-transport-https ca-certificates curl software-properties-common python3-pip virtualenv python3-setuptools 7 | sudo apt install docker.io -y 8 | sudo systemctl enable docker 9 | sudo systemctl start docker -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10_install_software/modules/ubuntu-server/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.0.10" 3 | 4 | required_providers { 5 | vsphere = { 6 | source = "hashicorp/vsphere" 7 | version = ">= 2.0.2" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10_install_software/output.tf: -------------------------------------------------------------------------------- 1 | output "vm_name" { 2 | value = module.ubuntu-server.vm_name 3 | } 4 | 5 | output "vm_ip_address" { 6 | value = module.ubuntu-server.ip_address 7 | } -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10_install_software/ssh_keys/ed25519_git.pub: -------------------------------------------------------------------------------- 1 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN4LN9xV2nRTHD7jN0W5GvGbFVLE3KI9JaWASATOJlle 2 | -------------------------------------------------------------------------------- /Terraform/Terraform_vSphere_21.10_install_software/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.0.10" 3 | 4 | required_providers { 5 | vsphere = { 6 | source = "hashicorp/vsphere" 7 | version = ">= 2.0.2" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase1/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean"{ 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase1/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | type = string 3 | } 4 | variable "domain_name" { 5 | type = string 6 | } 7 | variable "ssh_key" { 8 | type = string 9 | } 10 | 11 | variable "servers" { 12 | type = list(object({ 13 | name = string, 14 | size = string, 15 | image = string, 16 | region = string 17 | tags = list(string) 18 | })) 19 | } 20 | 21 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase1/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase10/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase10/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase11/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase11/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | type = string 3 | } 4 | variable "domain_name" { 5 | type = string 6 | } 7 | variable "ssh_key" { 8 | type = string 9 | } 10 | 11 | variable "projects" { 12 | type = map(object({ 13 | description = string, 14 | purpose = string, 15 | environment = string, 16 | servers = map(object({ 17 | name = string 18 | size = string, 19 | image = string, 20 | region = string 21 | tags = list(string) 22 | })) 23 | })) 24 | } 25 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase11/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase12/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase12/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase13/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase13/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase2/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean"{ 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase2/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | type = string 3 | } 4 | variable "domain_name" { 5 | type = string 6 | } 7 | variable "ssh_key" { 8 | type = string 9 | } 10 | 11 | variable "servers" { 12 | type = list(object({ 13 | name = string, 14 | size = string, 15 | image = string, 16 | region = string 17 | tags = list(string) 18 | })) 19 | } 20 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase2/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase3/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean"{ 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase3/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | type = string 3 | } 4 | variable "domain_name" { 5 | type = string 6 | } 7 | variable "ssh_key" { 8 | type = string 9 | } 10 | 11 | variable "servers" { 12 | type = map(object({ 13 | name = string 14 | size = string, 15 | image = string, 16 | region = string 17 | tags = list(string) 18 | })) 19 | } 20 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase3/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase4/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean"{ 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase4/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | type = string 3 | } 4 | variable "domain_name" { 5 | type = string 6 | } 7 | variable "ssh_key" { 8 | type = string 9 | } 10 | 11 | variable "servers" { 12 | type = map(object({ 13 | size = string, 14 | image = string, 15 | region = string 16 | tags = list(string) 17 | })) 18 | } 19 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase4/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase5/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase5/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | type = string 3 | } 4 | variable "domain_name" { 5 | type = string 6 | } 7 | variable "ssh_key" { 8 | type = string 9 | } 10 | 11 | variable "servers" { 12 | type = map(object({ 13 | size = string, 14 | image = string, 15 | region = string 16 | tags = list(string) 17 | })) 18 | } 19 | 20 | variable "projects" { 21 | type = list(string) 22 | } 23 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase5/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase6-list_of_objects/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase6-list_of_objects/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase6/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase6/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | type = string 3 | } 4 | variable "domain_name" { 5 | type = string 6 | } 7 | variable "ssh_key" { 8 | type = string 9 | } 10 | 11 | variable "servers" { 12 | type = map(object({ 13 | size = string, 14 | image = string, 15 | region = string 16 | environment = string 17 | tags = list(string) 18 | })) 19 | } 20 | 21 | variable "projects" { 22 | type = list(string) 23 | } 24 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase6/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase7/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase7/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | type = string 3 | } 4 | variable "domain_name" { 5 | type = string 6 | } 7 | variable "ssh_key" { 8 | type = string 9 | } 10 | 11 | variable "servers" { 12 | type = map(object({ 13 | size = string, 14 | image = string, 15 | region = string 16 | tags = list(string) 17 | })) 18 | } 19 | 20 | variable "projects" { 21 | type = map(string) 22 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase7/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase8-overlap/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase8-overlap/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase8/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase8/variables.tf: -------------------------------------------------------------------------------- 1 | variable "do_token" { 2 | type = string 3 | } 4 | variable "domain_name" { 5 | type = string 6 | } 7 | variable "ssh_key" { 8 | type = string 9 | } 10 | 11 | variable "servers" { 12 | type = map(object({ 13 | size = string, 14 | image = string, 15 | region = string 16 | tags = list(string) 17 | })) 18 | } 19 | 20 | variable "projects" { 21 | type = map(string) 22 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase8/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase9/provider.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "digitalocean" { 3 | token = var.do_token 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /Terraform/UseCases_Terraform/UseCase9/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | digitalocean = { 4 | source = "digitalocean/digitalocean" 5 | version = "~> 2.0" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /WebexTeams_Chatbots/botkit_deckofcards/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | .eslintrc.js 4 | .env 5 | 6 | -------------------------------------------------------------------------------- /WebexTeams_Chatbots/botkit_deckofcards/assets/images/heroku_config-variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/WebexTeams_Chatbots/botkit_deckofcards/assets/images/heroku_config-variables.png -------------------------------------------------------------------------------- /WebexTeams_Chatbots/botkit_deckofcards/features/z-fallback.js: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // Fallback Command 4 | // 5 | module.exports = function (controller) { 6 | 7 | controller.on( 'message,direct_message', async ( bot, message ) => { 8 | 9 | let markDown = `Sorry, I did not understand. \nTry: ${ controller.checkAddMention( message.roomType, 'help' ) }`; 10 | 11 | await bot.reply( message, { markdown: markDown } ); 12 | }); 13 | } -------------------------------------------------------------------------------- /WebexTeams_Chatbots/botkit_deckofcards/www/monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/WebexTeams_Chatbots/botkit_deckofcards/www/monitor.png -------------------------------------------------------------------------------- /WebexTeams_Chatbots/botkit_deckofcards/www/stats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/WebexTeams_Chatbots/botkit_deckofcards/www/stats.png -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/aci_bot/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn chatbot_aci:app -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/aci_bot/requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.3 2 | certifi==2019.11.28 3 | chardet==3.0.4 4 | Click==7.0 5 | filelock==3.0.12 6 | Flask==1.1.1 7 | idna==2.8 8 | itsdangerous==1.1.0 9 | Jinja2==2.11.1 10 | MarkupSafe==1.1.1 11 | requests==2.22.0 12 | six==1.14.0 13 | urllib3==1.25.8 14 | virtualenv==20.0.0 15 | Werkzeug==1.0.0 16 | gunicorn==19.7.1 17 | -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/aci_bot/templates/login.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "aaaUser": { 3 | "attributes": { 4 | "name": "{{ username }}", 5 | "pwd": "{{ password }}" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/aci_bot/templates/tenant.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvTenant": { 3 | "attributes": { 4 | "dn": "uni/tn-{{name}}", 5 | "name": "{{name}}", 6 | "rn": "tn-{{name}}", 7 | "status": "created" 8 | }, 9 | "children": [] 10 | } 11 | } -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/aci_bot/test.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/WebexTeams_Chatbots/python_deckofcards/aci_bot/test.json -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/deckofcards_bot/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn chatbot:app -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/deckofcards_bot/requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.3 2 | certifi==2019.11.28 3 | chardet==3.0.4 4 | Click==7.0 5 | filelock==3.0.12 6 | Flask==1.1.1 7 | idna==2.8 8 | itsdangerous==1.1.0 9 | Jinja2==2.11.1 10 | MarkupSafe==1.1.1 11 | requests==2.22.0 12 | six==1.14.0 13 | urllib3==1.25.8 14 | virtualenv==20.0.0 15 | Werkzeug==1.0.0 16 | gunicorn==19.7.1 17 | -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/webexteamsbot_aci/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn chatbot_aci:app -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/webexteamsbot_aci/requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.3 2 | certifi==2019.11.28 3 | chardet==3.0.4 4 | Click==7.0 5 | filelock==3.0.12 6 | Flask==1.1.1 7 | idna==2.8 8 | itsdangerous==1.1.0 9 | Jinja2==2.11.1 10 | MarkupSafe==1.1.1 11 | requests==2.22.0 12 | six==1.14.0 13 | urllib3==1.25.8 14 | virtualenv==20.0.0 15 | Werkzeug==1.0.0 16 | gunicorn==19.7.1 17 | -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/webexteamsbot_aci/templates/login.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "aaaUser": { 3 | "attributes": { 4 | "name": "{{ username }}", 5 | "pwd": "{{ password }}" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/webexteamsbot_aci/templates/tenant.j2.json: -------------------------------------------------------------------------------- 1 | { 2 | "fvTenant": { 3 | "attributes": { 4 | "dn": "uni/tn-{{name}}", 5 | "name": "{{name}}", 6 | "rn": "tn-{{name}}", 7 | "status": "created" 8 | }, 9 | "children": [] 10 | } 11 | } -------------------------------------------------------------------------------- /WebexTeams_Chatbots/python_deckofcards/webexteamsbot_aci/test.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwa1978/blog-hugo-netlify-code/b0fee024cd02131d223ea232b3d930479b9fcfb1/WebexTeams_Chatbots/python_deckofcards/webexteamsbot_aci/test.json -------------------------------------------------------------------------------- /Webex_Chatbot_Messages/Part3/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn app:app -------------------------------------------------------------------------------- /Webex_Chatbot_Messages/Part3/requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.3 2 | certifi==2019.11.28 3 | chardet==3.0.4 4 | Click==7.0 5 | filelock==3.0.12 6 | Flask==1.1.1 7 | idna==2.8 8 | itsdangerous==1.1.0 9 | Jinja2==2.11.1 10 | MarkupSafe==1.1.1 11 | requests==2.22.0 12 | six==1.14.0 13 | urllib3==1.25.8 14 | virtualenv==20.0.0 15 | Werkzeug==1.0.0 16 | gunicorn==19.7.1 17 | -------------------------------------------------------------------------------- /vSphere_Kubernetes_Ansible/Ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | host_key_checking = False 3 | -------------------------------------------------------------------------------- /vSphere_Kubernetes_Ansible/Ansible/hosts: -------------------------------------------------------------------------------- 1 | #hosts 2 | [masters] 3 | master ansible_host=10.16.2.236 ansible_user=root 4 | 5 | [workers] 6 | worker1 ansible_host=10.16.2.237 ansible_user=root 7 | worker2 ansible_host=10.16.2.238 ansible_user=root 8 | 9 | [all:vars] 10 | ansible_python_interpreter=/usr/bin/python3 11 | ansible_ssh_private_key_file=~/.ssh/lab_cisco_vsphere --------------------------------------------------------------------------------