diff --git a/Services/ad-manifest.yaml b/Services/ad-manifest.yaml new file mode 100644 index 0000000..fe3fd15 --- /dev/null +++ b/Services/ad-manifest.yaml @@ -0,0 +1,38 @@ +version: 0.1 +service_display_name: Active Directory + +description: >- + The Active Directory Service + includes one primary and optionally a few secondary + Domain Controllers, with DNS + +full_service_name: activeDirectory +author: Mirantis Inc. +service_version: 1.0 +enabled: True + +ui_forms: + - ActiveDirectory.yaml + +workflows: + - AD.xml + - Common.xml + +heat_templates: + Windows.template + +agent_templates: + - SetPassword.template + - CreatePrimaryDC.template + - AskDnsIp.template + - LeaveDomain.template + - JoinDomain.template + - CreateSecondaryDC.template + +scripts: + - ImportCoreFunctions.ps1 + - Set-LocalUserPassword.ps1 + - Get-DnsListeningIpAddress.ps1 + - Get-DnsListeningIpAddress.ps1 + - Join-Domain.ps1 + - Install-RoleSecondaryDomainController.ps1 diff --git a/Services/asp-net-farm-manifest.yaml b/Services/asp-net-farm-manifest.yaml new file mode 100644 index 0000000..29033a5 --- /dev/null +++ b/Services/asp-net-farm-manifest.yaml @@ -0,0 +1,34 @@ +version: 0.1 +service_display_name: ASP.NET Application Web Farm + +description: >- + The ASP.NET Farm Service installs a custom application + on a load-balanced array of IIS servers + +full_service_name: aspNetAppFarm +author: Mirantis Inc. +service_version: 1.0 +enabled: True + +ui_forms: + - AspNetAppFarm.yaml + +workflows: + - WebApps.xml + - Common.xml + +heat_templates: + - Windows.template + - LoadBalancer.template + +agent_templates: + - SetPassword.template + - InstallIIS.template + - DeployWebApp.template + +scripts: + - ImportCoreFunctions.ps1 + - Set-LocalUserPassword.ps1 + - CopyPrerequisites.ps1 + - InstallIIS.ps1 + - DeployWebApp.ps1 diff --git a/Services/asp-net-manifest.yaml b/Services/asp-net-manifest.yaml new file mode 100644 index 0000000..d534c66 --- /dev/null +++ b/Services/asp-net-manifest.yaml @@ -0,0 +1,34 @@ +version: 0.1 +service_display_name: ASP.NET Application + +description: >- + The ASP.NET Application Service installs + custom application onto one IIS Web Server + +full_service_name: aspNetApp +author: Mirantis Inc. +service_version: 1.0 +enabled: True + +ui_forms: + - AspNetApp.yaml + +workflows: + - WebApps.xml + - Common.xml + +heat_templates: + - Windows.template + +agent_templates: + - SetPassword.template + - InstallIIS.template + - DeployWebApp.template + +scripts: + - ImportCoreFunctions.ps1 + - Set-LocalUserPassword.ps1 + - CopyPrerequisites.ps1 + - InstallIIS.ps1 + - DeployWebApp.ps1 + diff --git a/Services/iis-farm-manifest.yaml b/Services/iis-farm-manifest.yaml new file mode 100644 index 0000000..145584d --- /dev/null +++ b/Services/iis-farm-manifest.yaml @@ -0,0 +1,34 @@ +version: 0.1 +service_display_name: Internet Information Services Web Farm + +description: >- + The IIS Farm Service sets up a load-balanced set of IIS servers + +full_service_name: webServer +author: Mirantis Inc. +service_version: 1.0 +enabled: True + +ui_forms: + - WebServerFarm.yaml + +workflows: + - WebApps.xml + - Common.xml + +heat_templates: + - Windows.template + - LoadBalancer.template + +agent_templates: + - SetPassword.template + - InstallIIS.template + - DeployWebApp.template + +scripts: + - ImportCoreFunctions.ps1 + - Set-LocalUserPassword.ps1 + - CopyPrerequisites.ps1 + - InstallIIS.ps1 + - DeployWebApp.ps1 + diff --git a/Services/iis-manifest.yaml b/Services/iis-manifest.yaml new file mode 100644 index 0000000..942981a --- /dev/null +++ b/Services/iis-manifest.yaml @@ -0,0 +1,35 @@ +version: 0.1 +service_display_name: Internet Information Services + +description: >- + The Internet Information Service + sets up an IIS server and joins it into an existing domain + +full_service_name: webServerFarm +author: Mirantis Inc. +service_version: 1.0 +enabled: True + +ui_forms: + - WebServer.yaml + +workflows: + - WebApps.xml + - Common.xml + +heat_templates: + - Windows.template + +agent_templates: + - SetPassword.template + - InstallIIS.template + - DeployWebApp.template + +scripts: + - ImportCoreFunctions.ps1 + - Set-LocalUserPassword.ps1 + - CopyPrerequisites.ps1 + - InstallIIS.ps1 + - DeployWebApp.ps1 + + diff --git a/Services/mssql-cluster-manifest.yaml b/Services/mssql-cluster-manifest.yaml new file mode 100644 index 0000000..b33df0b --- /dev/null +++ b/Services/mssql-cluster-manifest.yaml @@ -0,0 +1,46 @@ +version: 0.1 +service_display_name: MS SQL Server Cluster + +description: >- + The MS SQL Failover Cluster installs + Microsoft SQL Failover Cluster Server + +full_service_name: msSqlClusterServer +author: Mirantis Inc. +service_version: 1.0 +enabled: True + +ui_forms: + - MsSqlClusterServer.yaml + +workflows: + - MsSqlCluster.xml + - Common.xml + +heat_templates: + - Windows.template + - SQLCluster.template + +agent_templates: + - SetPassword.template + - SqlServerCluster/FailoverClusterPrerequisites.template + - SqlServerCluster/FailoverCluster.template + - SqlServerCluster/ConfigureEnvironmentForAOAG.template + - SqlServerCluster/InstallSqlServerForAOAG.template + - SqlServerCluster/InitializeAlwaysOn.template + - SqlServerCluster/InitializeAOAGPrimaryReplica.template + - SqlServerCluster/InitializeAOAGSecondaryReplica.template + + +scripts: + - ImportCoreFunctions.ps1 + - Set-LocalUserPassword.ps1 + - Update-ServiceConfig.ps1 + - SQLServerForAOAG.ps1 + - Failover-Cluster.ps1 + - Start-PowerShellProcess.ps1 + - Failover-Cluster.ps1 + - OptionParser.ps1 + - SQLServerOptionParsers.ps1 + - SQLServerInstaller.ps1 + - Export-Function.ps1 \ No newline at end of file diff --git a/Services/mssql-manifest.yaml b/Services/mssql-manifest.yaml new file mode 100644 index 0000000..c6be430 --- /dev/null +++ b/Services/mssql-manifest.yaml @@ -0,0 +1,35 @@ +version: 0.1 +service_display_name: MS SQL Server + +description: >- + The MS SQL Service installs an instance of + Microsoft SQL Server + +full_service_name: msSqlServer +author: Mirantis Inc. +service_version: 1.0 +enabled: True + +ui_forms: + - MsSqlServer.yaml + +workflows: + - MsSqlServer.xml + - Common.xml + +heat_templates: + - Windows.template + - SQL-security.template + +agent_templates: + - SetPassword.template + - InstallMsSqlServer.template + +scripts: + - ImportCoreFunctions.ps1 + - Set-LocalUserPassword.ps1 + - OptionParser.ps1 + - SQLServerOptionParsers.ps1 + - SQLServerInstaller.ps1 + - Install-SQLServer.ps1 + - Alter-FirewallRulesForSQL.ps1 diff --git a/Services/workflows/WebApps.xml b/Services/workflows/WebApps.xml new file mode 100644 index 0000000..5d6ae6f --- /dev/null +++ b/Services/workflows/WebApps.xml @@ -0,0 +1,174 @@ + + + + + Creating instance ) + + + + + + network- + + + + + + + ( + Unable to deploy instance ) due to + + + + + + + + + + + + : + Unable to create a Server Farm load balancer on unit ) due to + + + + + + + + + + + + + + + + + + + + ( + Creating IIS Web Server on unit ) + + + + + + + + + ( + Unable to install IIS on ) + + + + + + + + + on unit ) + + + + + + + + + + WebApp ( + Unable to deploy WebApp on ) + + + + + + + diff --git a/parser.py b/parser.py new file mode 100644 index 0000000..f985deb --- /dev/null +++ b/parser.py @@ -0,0 +1,81 @@ +import os +import yaml +import logging as log + + +class ManifestParser(object): + def __init__(self, + manifest_directory, + ui_forms_directory=None, + workflows_directory=None, + heat_templates_directory=None, + agent_templates_directory=None, + scripts_directory=None + ): + + if ui_forms_directory is None: + ui_forms_directory = os.path.join(manifest_directory, "ui_forms") + if workflows_directory is None: + workflows_directory = os.path.join(manifest_directory, "workflows") + if heat_templates_directory is None: + heat_templates_directory = os.path.join(manifest_directory, + "heat_templates") + if agent_templates_directory is None: + agent_templates_directory = os.path.join(manifest_directory, + "agent_templates") + if scripts_directory is None: + scripts_directory = os.path.join(manifest_directory, "scripts") + + self.manifest_directory = manifest_directory + self.directory_mapping = {"ui_forms": ui_forms_directory, + "workflows": workflows_directory, + "heat_templates_directory": + heat_templates_directory, + "agent_templates": agent_templates_directory, + "scripts": scripts_directory + } + + def parse(self): + manifests = [] + for file in os.listdir(self.manifest_directory): + if os.path.isfile(file): + if not file.endswith(".yaml"): + log.warning("Extention of {0} file is not yaml. " + "Only yaml file supported for " + "service manifest files.".format(file)) + continue + + service_file = os.path.join(self.manifest_directory, file) + try: + with open(service_file) as stream: + service_manifest = yaml.load(stream) + except yaml.YAMLError, exc: + log.warn("Failed to load manifest file. {0}. " + "The reason: {1!s}".format(service_file, + exc)) + continue + for key, value in service_manifest.iteritems(): + directory_location = self.directory_mapping.get(key) + if directory_location: + for i, filename in enumerate(value): + absolute_path = os.path.join(directory_location, + filename) + service_manifest[key][i] = absolute_path + if not os.path.exists(absolute_path): + log.warning( + "File {0} specified in manifest {1} " + "doesn't exist at {2}".format(filename, + file, + absolute_path + )) + + manifests.append(service_manifest) + return manifests + + +def main(): + ManifestParser(os.path.join(os.path.dirname(__file__), 'Services')).parse() + + +if __name__ == "__main__": + main() \ No newline at end of file