Giter VIP home page Giter VIP logo

ori.homework's Introduction

Ori Homework (DevOps)

Overview

  • Fully automated (de-)provisioning via terraform
  • Script injection via Azure's Virtual Machine Extensions
  • Manual validation/interaction with VM via RDP

Scripts

  • PS Script Module - scripts/Ori.LocalServerCmdlets.psm1
  • PS ExampleScript - scripts/ExampleScript.ps1

Prerequisites (Common)

  • Download terraform - https://www.terraform.io/downloads.html
  • Place terraform(.exe) binary somewhere in PATH
  • Get a service principal with appropriate permissions from Azure CLI (create app, sp, assign role Contributor)

For Linux

export TF_VAR_azure_subscription_id="XXX"
export TF_VAR_azure_client_id="XXX"
export TF_VAR_azure_client_secret="XXX"
export TF_VAR_azure_tenant_id="XXX"
export TF_VAR_azure_vm_admin_password="XXX"

terraform init
terraform plan -out my_ori_plan
terraform apply my_ori_plan

# Run RDP client here and enter provided credentials
# e.g., xfreerdp --ignore-certificate --sec nla -u 'ori-hw-vm1' --from-stdin $IP_ADDRESS

For Windows

$env:TF_VAR_azure_subscription_id="XXX"
$env:TF_VAR_azure_client_id="XXX"
$env:TF_VAR_azure_client_secret="XXX"
$env:TF_VAR_azure_tenant_id="XXX"
$env:TF_VAR_azure_vm_admin_password="XXX"

terraform.exe init
terraform.exe plan -out my_ori_plan
terraform.exe apply my_ori_plan

# Run your RDP client here with the given IP address and provided credentials

Inside VM (Common)

# Extension installed scripts here
cd C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.8\Downloads\0

# No "*admin*" users
.\ExampleScript.ps1

# One "*admin*" user
New-LocalUser -Name MyAdmin1 -NoPassword
.\ExampleScript.ps1

# Two "*admin*" users, warning!
New-LocalUser -Name MyAdmin2 -NoPassword
.\ExampleScript.ps1

Clean-up (Common)

terraform destroy

or

terraform.exe destroy

ori.homework's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.