Skip to content
Snippets Groups Projects
Commit 9db54188 authored by Martin Čuchran's avatar Martin Čuchran
Browse files

Add new file

parent 3bdaa69f
No related branches found
No related tags found
No related merge requests found
heat_template_version: 2013-05-23
description: >
Deploys a new Active Directory forest domain controller.
parameters:
key_name:
description: Name of an existing EC2 KeyPair to encrypt the Admin password
type: string
instance_type:
description: EC2 instance type
type: string
default: m1.small
constraints:
- allowed_values: [m1.sminy, m1.small, m1.medium, m1.large m1.xlarge]
description: must be a valid EC2 instance type.
image_id:
default: Windows Server 2012 R2 Std Eval VHD
description: Windows image version of choice
type: string
constraints:
- allowed_values: [ Windows Server 2012 Std Eval VHD, Windows Server 2012 R2 Std Eval VHD ]
description: must be a valid Windows image
network_id:
type: string
description: Id of an existing network
domain_name:
default: cloudbase.local
description: The domain name
type: string
constraints:
- length: { min: 3, max: 256 }
- allowed_pattern: "[A-Za-z0-9]+(?=[\\.\\-][a-zA-Z0-9])*\\.[a-zA-z09]+"
description : must be a valid DNS name.
domain_netbios_name:
default: CLOUDBASE
description: The Netbios domain name
type: string
constraints:
- length: { min: 1, max: 15 }
- allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
description: must begin with a letter and contain only alphanumeric characters.
safe_mode_administrator_password:
default: P@ssw0rd
description: The safe mode administration password
type: string
constraints:
- length: { min: 8, max: 64 }
- allowed_pattern: "(?=^.{6,255}$)((?=.*\\d)(?=.*[A-Z])(?=.*[a-z])|(?=.*\\d)(?=.*[^A-Za-z0-9])(?=.*[a-z])|(?=.*[^A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z])|(?=.*\\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9]))^.*"
description: must contain letters numbers and symbols
resources:
dc:
type: OS::Nova::Server
properties:
image: { get_param: image_id }
flavor: { get_param: instance_type }
key_name: { get_param: key_name }
networks:
- uuid: { get_param: network_id }
user_data:
str_replace:
template: |
#ps1_sysnative
$ErrorActionPreference = 'Stop'
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools
$user = [ADSI]'WinNT://./Administrator'
# Disable user
#$user.userflags = 2
#$user.SetInfo()
$user.SetPassword('safe_mode_administrator_password')
Import-Module ADDSDeployment
$safeModePwd = (ConvertTo-SecureString 'safe_mode_administrator_password' -AsPlainText -Force)
Install-ADDSForest -DomainName 'domain_name' -DomainNetbiosName 'domain_netbios_name' -SafeModeAdministratorPassword $safeModePwd -InstallDns -NoRebootOnCompletion -Force
exit 1001
params:
safe_mode_administrator_password: { get_param: safe_mode_administrator_password }
domain_name: { get_param: domain_name }
domain_netbios_name: { get_param: domain_netbios_name }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment