Create reproducible server environments.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
landlord.psm1

README.md

Landlord

End to end automation of your virtual machine environments.

Landlord is a domain specific language to describe a set of virtual machines for a application. Landlord will create and configure all the machines needed for your application. This essentially makes your server environments "disposable" ; meaning you can recreate them from scratch with a single command. This allows you to spin up test envionrments and other experimental setups effortlessly. Landlord provides an abstraction which allows you to test your scripts and setup locally against Hyper-V, then with minimal change create the exact envionrment in Microsoft Azure.

Landlord only supports Windows using Hyper-V or Azure as its vitualization layer.

You must import the module into the current session by running the following command:

	Import-Module .\landlord.psm1

NOTE: You may need to set the execution policy for scripts before importing the module (i.e. "Set-ExecutionPolicy RemoteSigned")

Virtual Machine Hosting Support:

  • HyperV
  • Azure

Commands:

  • Remove-Landlord [filename]
  • New-Landlord [filename]
  • Invoke-LandlordProvision [filename]
  • Invoke-LandlordSync [filename]

Not Implemented

  • Start-Landlord [filename] [Name]
  • Stop-Landlord [filename] [Name]
  • Restart-Landlord
	Provider hyperv {
	       param($provider)
	        $provider.Template = @{
	            Name="win2012r2" 
	            vhd = "c:\temp\rental\drive.vhdx"
	            vm = "C:\temp\rental\vm.xml"
	            username = "landlord"
	            password = "landlord"
	        }
	        $provider.DefaultSyncSource = ".\scripts" , "..\redist"
	        $provider.DefaultSyncDestination = "c:\redist"
	} 

	#create 5 web servers names www0 www1 www2 www3 www4 www5
	for($i=0;$i -lt 5;$i++){
		Machine www$i { 
		    param($m)
		    $m.Provision = [scriptblock]{
		        param($creds)        
		        #install required software
		        . c:\redist\configuremachine.ps1;        
		        Disable-InternetExplorerESC
		        install-iis;
		        remove-defaultwebsite
		        remove-defaultAppPools    
		        install-arr
	
		        #configure your environement
		        new-BlueGreenIISWebsite qsWebsite_Preview 81 82
		        
		        #install and configure continous deployment software
			bootstrap-tentacle $creds.Username $creds.Password @("Development") @("www")
		    }
		}
	}
	#create 4 app servers names app0 app1 app2 app3
	for($i=0;$i -lt 4;$i++){
		Machine app$i { 
		    param($m)
		    $m.Provision = [scriptblock]{
		        param($creds)        
		        #install required software
		        . c:\redist\configuremachine.ps1;        
		        Disable-InternetExplorerESC
		        install-dotnet;
		        #install and configure continous deployment software
			bootstrap-tentacle $creds.Username $creds.Password @("Development") @("jobs")
		    }
		}
	}
	

Debugging - Use the powershell variables to enable verbose and debug output.

$VerbosePreference="Continue"
$DebugPreference="Continue"