Delete ActiveDirectory application

Move that app into a separare repository:
  https://github.com/murano-project/murano-app-incubator

Then we update our packages to include 'meta' dir into them.

Change-Id: I407540fd5bb307fe02ab15b9a7a04e167ff32e7d
This commit is contained in:
Dmitry Teselkin 2014-04-25 13:24:36 +04:00
parent b9ecbbe50d
commit 3a8066b755
21 changed files with 12 additions and 749 deletions

12
meta/README.md Normal file
View File

@ -0,0 +1,12 @@
# Murano Classes Metadata
This folder contains only 'core library' classes for Murano.
Any file located here will be included into Murano package (deb/rpm) and imported automatically during installation.
Any other classes should be imported manually via CLI or UI.
Such classes could be found in one of two external repositories:
* Murano App Incubator repository - https://github.com/murano-project/murano-app-incubator
* Murano Incubated Apps repository - doesn't exist yet

View File

@ -1,38 +0,0 @@
Namespaces:
=: io.murano.windows.activeDirectory
std: io.murano
sys: io.murano.system
Name: ActiveDirectory
Extends: std:Application
Properties:
name:
Contract: $.string().notNull()
primaryController:
Contract: $.class(PrimaryController).notNull()
secondaryControllers:
Contract: [$.class(SecondaryController).notNull()]
adminAccountName:
Contract: $.string().notNull()
Default: Administrator
adminPassword:
Contract: $.string().notNull()
Default: P@ssw0rd
Workflow:
deploy:
Body:
- $.primaryController.deploy()
- $.secondaryControllers.pselect($.deploy())
- $.reportDeployed(title => 'MS Active Directory',
unitCount => len(secondaryControllers) + 1)
destroy:
Body:
- $.reportDestroyed()

View File

@ -1,19 +0,0 @@
Namespaces:
=: io.murano.windows.activeDirectory
std: io.murano
sys: io.murano.system
win: io.murano.windows
Name: Controller
Properties:
host:
Contract: $.class(win:Host).notNull()
recoveryPassword:
Contract: $.string().notNull()
Default: P@ssw0rd
Workflow:
deploy:
Body: $.host.deploy()

View File

@ -1,20 +0,0 @@
Namespaces:
=: io.murano.windows
ad: io.murano.windows.activeDirectory
Name: DomainHost
Extends: Host
Properties:
domain:
Contract: $.class(ad:ActiveDirectory).notNull()
Workflow:
deploy:
Arguments:
Body:
- $.super($.deploy())
#- $.joinDomain($.domain)
# Workaround against broken ResourceManager:
- $.super($.joinDomain($this.domain))

View File

@ -1,49 +0,0 @@
Namespaces:
=: io.murano.windows
ad: io.murano.windows.activeDirectory
res: io.murano.resources
sys: io.murano.system
Name: Host
Extends: res:Instance
Properties:
adminAccountName:
Contract: $.string().notNull()
Default: Administrator
adminPassword:
Contract: $.string().notNull()
Workflow:
initialize:
Body:
- $.super($.initialize())
deploy:
Body:
- $.super($.deploy())
- $resources: new(sys:Resources)
- $template: $resources.json('SetPassword.template').bind(dict(
adminPassword => $.adminPassword
))
- $.agent.send($template, $resources)
joinDomain:
Arguments:
- domain:
Contract: $.class(ad:ActiveDirectory).notNull()
Body:
- $resources: new(sys:Resources)
- $template: $resources.json('JoinDomain.template').bind(dict(
domain => $domain.name,
domainUser => $domain.adminAccountName,
domainPassword => $domain.adminPassword,
ouPath => '',
dnsIp => $domain.primaryController.dnsIp
))
- $.agent.call($template, $resources)

View File

@ -1,34 +0,0 @@
Namespaces:
=: io.murano.windows.activeDirectory
std: io.murano
sys: io.murano.system
Name: PrimaryController
Extends: Controller
Properties:
dnsIp:
Contract: $.string()
Usage: Out
Workflow:
initialize:
Body:
- $.super($.initialize())
- $.domain: $.find(ActiveDirectory).require()
deploy:
Arguments:
Body:
- $.super($.deploy())
- $resources: new(sys:Resources)
- $template: $resources.json('CreatePrimaryDC.template').bind(dict(
domain => $.domain.name,
recoveryPassword => $.recoveryPassword
))
- $.host.agent.call($template, $resources)
- $template: $resources.json('AskDnsIp.template')
- $.dnsIp: $.host.agent.call($template, $resources)[0]

View File

@ -1,28 +0,0 @@
Namespaces:
=: io.murano.windows.activeDirectory
std: io.murano
sys: io.murano.system
Name: SecondaryController
Extends: Controller
Workflow:
initialize:
Body:
- $.super($.initialize())
- $.domain: $.find(ActiveDirectory).require()
deploy:
Body:
- $.super($.deploy())
- $.host.joinDomain($.domain)
- $resources: new(sys:Resources)
- $template: $resources.json('CreateSecondaryDC.template').bind(dict(
domain => $.domain.name,
recoveryPassword => $.recoveryPassword,
domainAccountName => $.domain.adminAccountName,
domainPassword => $.domain.adminPassword
))
- $.host.agent.call($template, $resources)
#

View File

@ -1,12 +0,0 @@
{
"Scripts": [
"Get-DnsListeningIpAddress.ps1"
],
"Commands": [
{
"Name": "Get-DnsListeningIpAddress",
"Arguments": {}
}
],
"RebootOnCompletion": 0
}

View File

@ -1,16 +0,0 @@
{
"Scripts": [
"ImportCoreFunctions.ps1",
"Install-RolePrimaryDomainController.ps1"
],
"Commands": [
{
"Name": "Install-RolePrimaryDomainController",
"Arguments": {
"DomainName": "$domain",
"SafeModePassword": "$recoveryPassword"
}
}
],
"RebootOnCompletion": 1
}

View File

@ -1,18 +0,0 @@
{
"Scripts": [
"ImportCoreFunctions.ps1",
"Install-RoleSecondaryDomainController.ps1"
],
"Commands": [
{
"Name": "Install-RoleSecondaryDomainController",
"Arguments": {
"DomainName": "$domain",
"UserName": "$domainAccountName",
"Password": "$domainPassword",
"SafeModePassword": "$recoveryPassword"
}
}
],
"RebootOnCompletion": 1
}

View File

@ -1,25 +0,0 @@
{
"Scripts": [
"ImportCoreFunctions.ps1",
"Join-Domain.ps1"
],
"Commands": [
{
"Name": "Set-NetworkAdapterConfiguration",
"Arguments": {
"FirstAvailable": true,
"DNSServer": "$dnsIp"
}
},
{
"Name": "Join-Domain",
"Arguments": {
"Username": "$domainUser",
"Password": "$domainPassword",
"DomainName": "$domain",
"OUPath": "$ouPath"
}
}
],
"RebootOnCompletion": 1
}

View File

@ -1,17 +0,0 @@
{
"Scripts": [
"ImportCoreFunctions.ps1",
"Set-LocalUserPassword.ps1"
],
"Commands": [
{
"Name": "Set-LocalUserPassword",
"Arguments": {
"UserName": "Administrator",
"Password": "$adminPassword",
"Force": true
}
}
],
"RebootOnCompletion": 0
}

View File

@ -1,7 +0,0 @@
function Get-DnsListeningIpAddress {
Import-Module DnsServer
(Get-DNSServer -ComputerName localhost).ServerSetting.ListeningIpAddress |
Where-Object { $_ -match "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" }
}

View File

@ -1,68 +0,0 @@
Import-Module CoreFunctions -Force
Initialize-Logger 'MuranoAgent' 'C:\Murano\PowerShell.log'
function Show-InvocationInfo {
param (
$Invocation,
[Switch] $End
)
if ($End) {
Write-LogDebug "</function name='$($Invocation.MyCommand.Name)'>"
}
else {
Write-LogDebug "<function name='$($Invocation.MyCommand.Name)'>"
Write-LogDebug "<param>"
foreach ($Parameter in $Invocation.MyCommand.Parameters) {
foreach ($Key in $Parameter.Keys) {
$Type = $Parameter[$Key].ParameterType.FullName
foreach ($Value in $Invocation.BoundParameters[$Key]) {
Write-LogDebug "[$Type] $Key = '$Value'"
}
}
}
Write-LogDebug "</param>"
}
}
$TrapHandler = {
Write-LogError "<exception>"
Write-LogError $_ -EntireObject
Write-LogError "</exception>"
break
}
trap {
&$TrapHandler
}
$ErrorActionPreference = 'Stop'
<#
# Usage example for Show-InvocationInfo
function MyFunction {
param (
[String] $Value1,
[String] $Value2,
[Int] $Int1
)
begin {
Show-InvocationInfo $MyInvocation
}
end {
Show-InvocationInfo $MyInvocation -End
}
process {
trap {
&$TrapHandler
}
# Main code here
}
}
#>

View File

@ -1,43 +0,0 @@
trap {
&$TrapHandler
}
Function Install-RolePrimaryDomainController {
param (
[String] $DomainName,
[String] $SafeModePassword
)
begin {
Show-InvocationInfo $MyInvocation
}
end {
Show-InvocationInfo $MyInvocation -End
}
process {
trap {
&$TrapHandler
}
Add-WindowsFeatureWrapper `
-Name "DNS","AD-Domain-Services","RSAT-DFS-Mgmt-Con" `
-IncludeManagementTools `
-NotifyRestart
Write-Log "Creating first domain controller ..."
$SMAP = ConvertTo-SecureString -String $SafeModePassword -AsPlainText -Force
$null = Install-ADDSForest `
-DomainName $DomainName `
-SafeModeAdministratorPassword $SMAP `
-DomainMode Default `
-ForestMode Default `
-NoRebootOnCompletion `
-Force
Write-Log "Waiting 60 seconds for reboot ..."
Start-Sleep -Seconds 60
}
}

View File

@ -1,69 +0,0 @@
trap {
&$TrapHandler
}
Function Install-RoleSecondaryDomainController
{
<#
.SYNOPSIS
Install additional (secondary) domain controller.
#>
param
(
[String]
# Domain name to join to.
$DomainName,
[String]
# Domain user who is allowed to join computer to domain.
$UserName,
[String]
# User's password.
$Password,
[String]
# Domain controller recovery mode password.
$SafeModePassword
)
begin {
Show-InvocationInfo $MyInvocation
}
end {
Show-InvocationInfo $MyInvocation -End
}
process {
trap {
&$TrapHandler
}
$Credential = New-Credential -UserName "$DomainName\$UserName" -Password $Password
# Add required windows features
Add-WindowsFeatureWrapper `
-Name "DNS","AD-Domain-Services","RSAT-DFS-Mgmt-Con" `
-IncludeManagementTools `
-NotifyRestart
Write-Log "Adding secondary domain controller ..."
$SMAP = ConvertTo-SecureString -String $SafeModePassword -AsPlainText -Force
Install-ADDSDomainController `
-DomainName $DomainName `
-SafeModeAdministratorPassword $SMAP `
-Credential $Credential `
-NoRebootOnCompletion `
-Force `
-ErrorAction Stop | Out-Null
Write-Log "Waiting for restart ..."
# Stop-Execution -ExitCode 3010 -ExitString "Computer must be restarted to finish domain controller promotion."
# Write-Log "Restarting computer ..."
# Restart-Computer -Force
}
}

View File

@ -1,67 +0,0 @@
trap {
&$TrapHandler
}
Function Join-Domain {
<#
.SYNOPSIS
Executes "Join domain" action.
Requires 'CoreFunctions' module
#>
param (
[String] $DomainName = '',
[String] $UserName = '',
[String] $Password = '',
[String] $OUPath = '',
[Switch] $AllowRestart
)
begin {
Show-InvocationInfo $MyInvocation
}
end {
Show-InvocationInfo $MyInvocation -End
}
process {
trap {
&$TrapHandler
}
if ($UserName -eq '') {
$UserName = 'Administrator'
}
$Credential = New-Credential -UserName "$DomainName\$UserName" -Password $Password
if (Test-ComputerName -DomainName $DomainName -ErrorAction 'SilentlyContinue') {
Write-LogWarning "Computer already joined to domain '$DomainName'"
}
else {
Write-Log "Joining computer to domain '$DomainName' ..."
if ($OUPath -eq '') {
Add-Computer -DomainName $DomainName -Credential $Credential -Force
}
else {
Add-Computer -DomainName $DomainName -Credential $Credential -OUPath $OUPath -Force
}
$null = Exec 'ipconfig' @('/registerdns') -RedirectStreams
Write-Log "Waiting 30 seconds to restart ..."
Start-Sleep -Seconds 30
<#
if ($AllowRestart) {
Write-Log "Restarting computer ..."
Restart-Computer -Force
}
else {
Write-Log "Please restart the computer now."
}
#>
}
}
}

View File

@ -1,37 +0,0 @@
trap {
&$TrapHandler
}
Function Set-LocalUserPassword {
param (
[String] $UserName,
[String] $Password,
[Switch] $Force
)
begin {
Show-InvocationInfo $MyInvocation
}
end {
Show-InvocationInfo $MyInvocation -End
}
process {
trap {
&$TrapHandler
}
if ((Get-WmiObject Win32_UserAccount -Filter "LocalAccount = 'True' AND Name='$UserName'") -eq $null) {
throw "Unable to find local user account '$UserName'"
}
if ($Force) {
Write-Log "Changing password for user '$UserName' to '*****'" # :)
$null = ([ADSI] "WinNT://./$UserName").SetPassword($Password)
}
else {
Write-LogWarning "You are trying to change password for user '$UserName'. To do this please run the command again with -Force parameter."
}
}
}

View File

@ -1,155 +0,0 @@
Version: 2
Templates:
primaryController:
?:
type: io.murano.windows.activeDirectory.PrimaryController
host:
?:
type: io.murano.windows.Host
adminPassword: $.serviceConfiguration.adminPassword
name: generateHostname($.serviceConfiguration.unitNamingPattern, 1)
flavor: $.instanceConfiguration.flavor
image: $.instanceConfiguration.osImage
secondaryController:
?:
type: io.murano.windows.activeDirectory.SecondaryController
host:
?:
type: io.murano.windows.Host
adminPassword: $.serviceConfiguration.adminPassword
name: generateHostname($.serviceConfiguration.unitNamingPattern, $index + 1)
flavor: $.instanceConfiguration.flavor
image: $.instanceConfiguration.osImage
Application:
?:
type: io.murano.windows.activeDirectory.ActiveDirectory
name: $.serviceConfiguration.name
primaryController: $primaryController
secondaryControllers: repeat($secondaryController, $.serviceConfiguration.dcInstances - 1)
Forms:
- serviceConfiguration:
fields:
- name: configuration
type: string
hidden: true
initial: standalone
- name: name
type: string
label: Domain Name
description: >-
Enter a desired name for a new domain. This name should fit to
DNS Domain Name requirements: it should contain
only A-Z, a-z, 0-9, (.) and (-) and should not end with a dash.
DNS server will be automatically set up on each of the Domain
Controller instances. Note: Only first 15 characters or characters
before first period is used as NetBIOS name.
minLength: 2
maxLength: 255
validators:
- expr:
regexpValidator: '^([0-9A-Za-z]|[0-9A-Za-z][0-9A-Za-z-]*[0-9A-Za-z])\.[0-9A-Za-z][0-9A-Za-z-]*[0-9A-Za-z]$'
message: >-
Only letters, numbers and dashes in the middle are
allowed. Period characters are allowed only when they
are used to delimit the components of domain style
names. Single-level domain is not
appropriate. Subdomains are not allowed.
- expr:
regexpValidator: '(^[^.]+$|^[^.]{1,15}\..*$)'
message: >-
NetBIOS name cannot be shorter than 1 symbol and
longer than 15 symbols.
- expr:
regexpValidator: '(^[^.]+$|^[^.]*\.[^.]{2,63}.*$)'
message: >-
DNS host name cannot be shorter than 2 symbols and
longer than 63 symbols.
helpText: >-
Just letters, numbers and dashes are allowed.
A dot can be used to create subdomains
- name: dcInstances
type: integer
label: Instance Count
description: >-
You can create several Active Directory instances by setting
instance number larger than one. One primary Domain Controller
and a few secondary DCs will be created.
minValue: 1
maxValue: 100
initial: 1
helpText: Enter an integer value between 1 and 100
- name: adminAccountName
type: string
label: Account Name
initial: Administrator
regexpValidator: '^[-\w]+$'
errorMessages:
invalid: 'Just letters, numbers, underscores and hyphens are allowed.'
- name: adminPassword
type: password
label: Administrator password
descriptionTitle: Passwords
description: >-
Windows requires strong password for service administration.
Your password should have at least one letter in each
register, a number and a special character. Password length should be
a minimum of 7 characters.
Once you forget your password you won't be able to
operate the service until recovery password would be entered. So it's
better for Recovery and Administrator password to be different.
- name: recoveryPassword
type: password
label: Recovery password
- name: unitNamingPattern
type: string
label: Hostname template
description: >-
For your convenience all instance hostnames can be named
in the same way. Enter a name and use # character for incrementation.
For example, host# turns into host1, host2, etc. Please follow Windows
hostname restrictions.
required: false
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
# FIXME: does not work for # turning into 2-digit numbers
maxLength: 15
helpText: Optional field for a machine hostname template
# temporaryHack
widgetMedia:
js: ['muranodashboard/js/support_placeholder.js']
css: {all: ['muranodashboard/css/support_placeholder.css']}
validators:
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
- expr: $.serviceConfiguration.dcInstances < 2 or not $.serviceConfiguration.unitNamingPattern.bool() or '#' in $.serviceConfiguration.unitNamingPattern
message: Incrementation symbol "#" is required in the Hostname template
- instanceConfiguration:
fields:
- name: title
type: string
required: false
hidden: true
descriptionTitle: Instance Configuration
description: Specify some instance parameters on which service would be created.
- name: flavor
type: flavor
label: Instance flavor
description: >-
Select registered in Openstack flavor. Consider that service performance
depends on this parameter.
required: false
- name: osImage
type: image
imageType: windows
label: Instance image
description: >-
Select valid image for a service. Image should already be prepared and
registered in glance.
- name: availabilityZone
type: azone
label: Availability zone
description: Select availability zone where service would be installed.
required: false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,27 +0,0 @@
Format: 1.0
Type: Application
FullName: io.murano.windows.ActiveDirectory
Name: Active Directory
Description: |
A domain service hosted in Windows environment by using Active Directory Role.
May be clustered by combining a number of secondary domain controllers with one primary
Author: 'murano.io'
Tags: [Windows, Domain, demo, win2012, microsoft]
Classes:
io.murano.windows.Host: Host.yaml
io.murano.windows.DomainHost: DomainHost.yaml
io.murano.windows.activeDirectory.ActiveDirectory: ActiveDirectory.yaml
io.murano.windows.activeDirectory.Controller: Controller.yaml
io.murano.windows.activeDirectory.PrimaryController: PrimaryController.yaml
io.murano.windows.activeDirectory.SecondaryController: SecondaryController.yaml
# UI: ui.yaml # default to ui.yaml, will use default if skipped
Logo: logo2.png # defaults to logo.png, will use default if skipped