From 8149d27d80bce475dfaf5d515652ccc9d0629244 Mon Sep 17 00:00:00 2001 From: Ruslan Kamaldinov Date: Wed, 16 Apr 2014 22:10:49 +0400 Subject: [PATCH] Deprecate murano-repository Change-Id: I54050e53da6874cd83260de5c1a4304504c89cdd --- LICENSE | 191 --- MANIFEST.in | 13 - README.rst | 40 +- babel.cfg | 1 - common.inc | 379 ----- etc/init.d/README.rst | 4 - etc/init.d/murano-repository-debian | 105 -- etc/init.d/murano-repository-redhat | 103 -- etc/murano/murano-repository.conf.sample | 55 - .../Services/activeDirectory-manifest.yaml | 48 - .../agent_templates/AskDnsIp.template | 12 - .../ConfigureAccessToPostgreSql.template | 23 - .../ConfigurePostgreSqlDatabase.template | 22 - .../agent_templates/CreatePrimaryDC.template | 16 - .../CreateSecondaryDC.template | 18 - .../Services/agent_templates/Demo.template | 7 - .../agent_templates/DeployApache.template | 21 - .../agent_templates/DeployPostgreSql.template | 21 - .../agent_templates/DeployTelnet.template | 22 - .../agent_templates/DeployTomcat.template | 21 - .../agent_templates/DeployTomcatApp.template | 21 - .../agent_templates/DeployWebApp.template | 15 - .../Services/agent_templates/GetIP.template | 19 - .../agent_templates/InstallIIS.template | 22 - .../InstallMsSqlServer.template | 24 - .../agent_templates/JoinDomain.template | 25 - .../agent_templates/LeaveDomain.template | 5 - .../agent_templates/SetPassword.template | 17 - .../ConfigureEnvironmentForAOAG.template | 18 - .../SqlServerCluster/FailoverCluster.template | 21 - .../FailoverClusterPrerequisites.template | 28 - .../InitializeAOAGPrimaryReplica.template | 28 - .../InitializeAOAGSecondaryReplica.template | 23 - .../InitializeAlwaysOn.template | 23 - .../InstallSqlServerForAOAG.template | 27 - .../Services/aspNetApp-manifest.yaml | 46 - .../Services/aspNetAppFarm-manifest.yaml | 46 - .../Services/demoService-manifest.yaml | 34 - .../heat_templates/DefaultSecurity.template | 18 - .../Services/heat_templates/Demo.template | 15 - .../heat_templates/DemoSecurity.template | 17 - .../heat_templates/DomainSecurity.template | 143 -- .../heat_templates/FloatingIP.template | 24 - .../heat_templates/FloatingIPwithLB.template | 23 - .../heat_templates/InstancePort.template | 29 - .../InstancePortWSubnet.template | 36 - .../Services/heat_templates/Keypair.template | 9 - .../Services/heat_templates/Linux.template | 18 - .../heat_templates/LinuxSecurity.template | 17 - .../heat_templates/LoadBalancer.template | 44 - .../heat_templates/NNSecurity.template | 13 - .../Services/heat_templates/Network.template | 14 - .../Services/heat_templates/Param.template | 8 - .../PostgreSqlSecurity.template | 17 - .../heat_templates/RouterInterface.template | 18 - .../heat_templates/SQL-security.template | 41 - .../heat_templates/SQLCluster.template | 13 - .../Services/heat_templates/Subnet.template | 20 - .../heat_templates/TelnetSecurity.template | 17 - .../heat_templates/TomcatSecurity.template | 17 - .../heat_templates/WSFCSecurity.template | 41 - .../heat_templates/WebServerSecurity.template | 23 - .../Services/heat_templates/Windows.template | 19 - .../heat_templates/WindowsSecurity.template | 17 - .../Services/linuxApacheService-manifest.yaml | 42 - .../Services/linuxTelnetService-manifest.yaml | 41 - .../Services/msSqlClusterServer-manifest.yaml | 58 - .../Services/msSqlServer-manifest.yaml | 48 - .../Services/postgreSql-manifest.yaml | 49 - .../scripts/Alter-FirewallRulesForSQL.ps1 | 61 - .../Services/scripts/CopyPrerequisites.ps1 | 50 - .../Services/scripts/DeployWebApp.ps1 | 152 -- .../Services/scripts/Export-Function.ps1 | 61 - .../scripts/Get-DnsListeningIpAddress.ps1 | 7 - .../Services/scripts/ImportCoreFunctions.ps1 | 68 - .../Install-RolePrimaryDomainController.ps1 | 43 - .../Install-RoleSecondaryDomainController.ps1 | 69 - .../Services/scripts/InstallIIS.ps1 | 72 - .../Services/scripts/Join-Domain.ps1 | 67 - .../Services/scripts/Linux/common.sh | 204 --- .../Linux/configureAccessToPostgreSql.sh | 26 - .../Linux/configurePostgreSqlDatabase.sh | 28 - .../scripts/Linux/deployPostgreSql.sh | 31 - .../Services/scripts/Linux/deployTomcat.sh | 29 - .../Services/scripts/Linux/deployTomcatApp.sh | 30 - .../Services/scripts/Linux/getIp.sh | 2 - .../Services/scripts/Linux/installer.sh | 142 -- .../Services/scripts/Linux/runApacheDeploy.sh | 37 - .../Services/scripts/Linux/runTelnetDeploy.sh | 67 - .../scripts/New-SqlServerSystemAccount.ps1 | 64 - .../Services/scripts/OptionParser.ps1 | 280 ---- .../scripts/SQLServer/Install-SQLServer.ps1 | 84 - .../scripts/SQLServer/SQLServerInstaller.ps1 | 1373 ----------------- .../SQLServer/SQLServerOptionParsers.ps1 | 367 ----- .../scripts/Set-LocalUserPassword.ps1 | 37 - .../SqlServerCluster/Failover-Cluster.ps1 | 239 --- .../SqlServerCluster/SQLServerForAOAG.ps1 | 538 ------- .../scripts/Start-PowerShellProcess.ps1 | 151 -- .../Services/scripts/TelnetDeploy.sh | 74 - .../Services/scripts/Update-ServiceConfig.ps1 | 60 - .../Services/tomcat-manifest.yaml | 44 - .../Services/ui_forms/ActiveDirectory.yaml | 142 -- .../Services/ui_forms/AspNetApp.yaml | 113 -- .../Services/ui_forms/AspNetAppFarm.yaml | 133 -- muranorepository/Services/ui_forms/Demo.yaml | 73 - .../Services/ui_forms/LinuxApache.yaml | 85 - .../Services/ui_forms/LinuxTelnet.yaml | 89 -- .../Services/ui_forms/MsSqlClusterServer.yaml | 250 --- .../Services/ui_forms/MsSqlServer.yaml | 123 -- .../Services/ui_forms/PostgreSql.yaml | 92 -- .../Services/ui_forms/Tomcat.yaml | 100 -- .../Services/ui_forms/WebServer.yaml | 103 -- .../Services/ui_forms/WebServerFarm.yaml | 121 -- .../Services/webServer-manifest.yaml | 47 - .../Services/webServerFarm-manifest.yaml | 46 - muranorepository/Services/workflows/AD.xml | 330 ---- .../Services/workflows/Apache.xml | 162 -- .../Services/workflows/Common.xml | 57 - muranorepository/Services/workflows/Demo.xml | 91 -- .../Services/workflows/LinuxTelnet.xml | 102 -- .../Services/workflows/MsSqlCluster.xml | 449 ------ .../Services/workflows/MsSqlServer.xml | 139 -- .../Services/workflows/Networking.xml | 378 ----- .../Services/workflows/PostgreSql.xml | 269 ---- .../Services/workflows/Tomcat.xml | 246 --- .../Services/workflows/WebApps.xml | 212 --- muranorepository/__init__.py | 13 - muranorepository/api/__init__.py | 13 - muranorepository/api/utils.py | 261 ---- muranorepository/api/v1.py | 259 ---- muranorepository/babel.cfg | 1 - muranorepository/cmd/__init__.py | 13 - muranorepository/cmd/run.py | 92 -- muranorepository/config.py | 67 - muranorepository/consts.py | 35 - muranorepository/locale/README | 1 - muranorepository/locale/muranorepository.pot | 969 ------------ muranorepository/main.py | 30 - muranorepository/manifest.py | 19 - muranorepository/openstack/__init__.py | 0 muranorepository/openstack/common/__init__.py | 0 .../openstack/common/cfgfilter.py | 242 --- muranorepository/openstack/common/context.py | 111 -- .../openstack/common/crypto/__init__.py | 0 .../openstack/common/crypto/utils.py | 179 --- .../openstack/common/eventlet_backdoor.py | 145 -- .../openstack/common/exception.py | 139 -- muranorepository/openstack/common/excutils.py | 101 -- .../openstack/common/fileutils.py | 111 -- .../openstack/common/gettextutils.py | 365 ----- .../openstack/common/importutils.py | 68 - .../openstack/common/jsonutils.py | 180 --- muranorepository/openstack/common/local.py | 47 - .../openstack/common/lockutils.py | 277 ---- muranorepository/openstack/common/log.py | 567 ------- .../openstack/common/loopingcall.py | 147 -- .../openstack/common/middleware/__init__.py | 0 .../openstack/common/middleware/base.py | 55 - .../openstack/common/middleware/debug.py | 58 - .../openstack/common/network_utils.py | 81 - .../openstack/common/notifier/__init__.py | 14 - .../openstack/common/notifier/api.py | 173 --- .../openstack/common/notifier/log_notifier.py | 37 - .../common/notifier/no_op_notifier.py | 19 - .../openstack/common/notifier/rpc_notifier.py | 47 - .../common/notifier/rpc_notifier2.py | 53 - .../common/notifier/test_notifier.py | 22 - .../openstack/common/periodic_task.py | 189 --- .../openstack/common/processutils.py | 251 --- .../openstack/common/rpc/__init__.py | 306 ---- muranorepository/openstack/common/rpc/amqp.py | 636 -------- .../openstack/common/rpc/common.py | 509 ------ .../openstack/common/rpc/dispatcher.py | 178 --- .../openstack/common/rpc/impl_fake.py | 195 --- .../openstack/common/rpc/impl_kombu.py | 856 ---------- .../openstack/common/rpc/impl_qpid.py | 833 ---------- .../openstack/common/rpc/impl_zmq.py | 818 ---------- .../openstack/common/rpc/matchmaker.py | 324 ---- .../openstack/common/rpc/matchmaker_redis.py | 145 -- .../openstack/common/rpc/matchmaker_ring.py | 108 -- .../openstack/common/rpc/proxy.py | 226 --- .../openstack/common/rpc/securemessage.py | 521 ------- .../openstack/common/rpc/serializer.py | 52 - .../openstack/common/rpc/service.py | 78 - .../openstack/common/rpc/zmq_receiver.py | 40 - muranorepository/openstack/common/service.py | 459 ------ muranorepository/openstack/common/sslutils.py | 100 -- muranorepository/openstack/common/test.py | 54 - .../openstack/common/threadgroup.py | 121 -- .../openstack/common/timeutils.py | 197 --- muranorepository/openstack/common/wsgi.py | 258 ---- muranorepository/openstack/common/xmlutils.py | 74 - muranorepository/openstack/commons.py | 67 - muranorepository/tests/__init__.py | 0 muranorepository/tests/_test_client_api.py | 57 - muranorepository/tests/_test_get_files.py | 63 - muranorepository/tests/fixtures.py | 63 - muranorepository/tests/test.conf | 28 - .../tests/test_data_type_listing.py | 109 -- muranorepository/tests/test_dir_operations.py | 115 -- muranorepository/tests/test_upload.py | 188 --- muranorepository/utils/__init__.py | 13 - muranorepository/utils/archiver.py | 321 ---- muranorepository/utils/parser.py | 184 --- muranorepository/utils/utils.py | 40 - requirements.txt | 11 - setup.cfg | 65 - setup.py | 22 - setup.sh | 249 --- test-requirements.txt | 12 - tools/install_venv.py | 77 - tools/install_venv_common.py | 212 --- tools/with_venv.sh | 4 - tox.ini | 38 - 214 files changed, 4 insertions(+), 25455 deletions(-) delete mode 100644 LICENSE delete mode 100644 MANIFEST.in delete mode 100644 babel.cfg delete mode 100644 common.inc delete mode 100644 etc/init.d/README.rst delete mode 100644 etc/init.d/murano-repository-debian delete mode 100644 etc/init.d/murano-repository-redhat delete mode 100644 etc/murano/murano-repository.conf.sample delete mode 100644 muranorepository/Services/activeDirectory-manifest.yaml delete mode 100644 muranorepository/Services/agent_templates/AskDnsIp.template delete mode 100644 muranorepository/Services/agent_templates/ConfigureAccessToPostgreSql.template delete mode 100644 muranorepository/Services/agent_templates/ConfigurePostgreSqlDatabase.template delete mode 100644 muranorepository/Services/agent_templates/CreatePrimaryDC.template delete mode 100644 muranorepository/Services/agent_templates/CreateSecondaryDC.template delete mode 100644 muranorepository/Services/agent_templates/Demo.template delete mode 100644 muranorepository/Services/agent_templates/DeployApache.template delete mode 100644 muranorepository/Services/agent_templates/DeployPostgreSql.template delete mode 100644 muranorepository/Services/agent_templates/DeployTelnet.template delete mode 100644 muranorepository/Services/agent_templates/DeployTomcat.template delete mode 100644 muranorepository/Services/agent_templates/DeployTomcatApp.template delete mode 100644 muranorepository/Services/agent_templates/DeployWebApp.template delete mode 100644 muranorepository/Services/agent_templates/GetIP.template delete mode 100644 muranorepository/Services/agent_templates/InstallIIS.template delete mode 100644 muranorepository/Services/agent_templates/InstallMsSqlServer.template delete mode 100644 muranorepository/Services/agent_templates/JoinDomain.template delete mode 100644 muranorepository/Services/agent_templates/LeaveDomain.template delete mode 100644 muranorepository/Services/agent_templates/SetPassword.template delete mode 100644 muranorepository/Services/agent_templates/SqlServerCluster/ConfigureEnvironmentForAOAG.template delete mode 100644 muranorepository/Services/agent_templates/SqlServerCluster/FailoverCluster.template delete mode 100644 muranorepository/Services/agent_templates/SqlServerCluster/FailoverClusterPrerequisites.template delete mode 100644 muranorepository/Services/agent_templates/SqlServerCluster/InitializeAOAGPrimaryReplica.template delete mode 100644 muranorepository/Services/agent_templates/SqlServerCluster/InitializeAOAGSecondaryReplica.template delete mode 100644 muranorepository/Services/agent_templates/SqlServerCluster/InitializeAlwaysOn.template delete mode 100644 muranorepository/Services/agent_templates/SqlServerCluster/InstallSqlServerForAOAG.template delete mode 100644 muranorepository/Services/aspNetApp-manifest.yaml delete mode 100644 muranorepository/Services/aspNetAppFarm-manifest.yaml delete mode 100644 muranorepository/Services/demoService-manifest.yaml delete mode 100644 muranorepository/Services/heat_templates/DefaultSecurity.template delete mode 100644 muranorepository/Services/heat_templates/Demo.template delete mode 100644 muranorepository/Services/heat_templates/DemoSecurity.template delete mode 100644 muranorepository/Services/heat_templates/DomainSecurity.template delete mode 100644 muranorepository/Services/heat_templates/FloatingIP.template delete mode 100644 muranorepository/Services/heat_templates/FloatingIPwithLB.template delete mode 100644 muranorepository/Services/heat_templates/InstancePort.template delete mode 100644 muranorepository/Services/heat_templates/InstancePortWSubnet.template delete mode 100644 muranorepository/Services/heat_templates/Keypair.template delete mode 100644 muranorepository/Services/heat_templates/Linux.template delete mode 100644 muranorepository/Services/heat_templates/LinuxSecurity.template delete mode 100644 muranorepository/Services/heat_templates/LoadBalancer.template delete mode 100644 muranorepository/Services/heat_templates/NNSecurity.template delete mode 100644 muranorepository/Services/heat_templates/Network.template delete mode 100644 muranorepository/Services/heat_templates/Param.template delete mode 100644 muranorepository/Services/heat_templates/PostgreSqlSecurity.template delete mode 100644 muranorepository/Services/heat_templates/RouterInterface.template delete mode 100644 muranorepository/Services/heat_templates/SQL-security.template delete mode 100644 muranorepository/Services/heat_templates/SQLCluster.template delete mode 100644 muranorepository/Services/heat_templates/Subnet.template delete mode 100644 muranorepository/Services/heat_templates/TelnetSecurity.template delete mode 100644 muranorepository/Services/heat_templates/TomcatSecurity.template delete mode 100644 muranorepository/Services/heat_templates/WSFCSecurity.template delete mode 100644 muranorepository/Services/heat_templates/WebServerSecurity.template delete mode 100644 muranorepository/Services/heat_templates/Windows.template delete mode 100644 muranorepository/Services/heat_templates/WindowsSecurity.template delete mode 100644 muranorepository/Services/linuxApacheService-manifest.yaml delete mode 100644 muranorepository/Services/linuxTelnetService-manifest.yaml delete mode 100644 muranorepository/Services/msSqlClusterServer-manifest.yaml delete mode 100644 muranorepository/Services/msSqlServer-manifest.yaml delete mode 100644 muranorepository/Services/postgreSql-manifest.yaml delete mode 100644 muranorepository/Services/scripts/Alter-FirewallRulesForSQL.ps1 delete mode 100644 muranorepository/Services/scripts/CopyPrerequisites.ps1 delete mode 100644 muranorepository/Services/scripts/DeployWebApp.ps1 delete mode 100644 muranorepository/Services/scripts/Export-Function.ps1 delete mode 100644 muranorepository/Services/scripts/Get-DnsListeningIpAddress.ps1 delete mode 100644 muranorepository/Services/scripts/ImportCoreFunctions.ps1 delete mode 100644 muranorepository/Services/scripts/Install-RolePrimaryDomainController.ps1 delete mode 100644 muranorepository/Services/scripts/Install-RoleSecondaryDomainController.ps1 delete mode 100644 muranorepository/Services/scripts/InstallIIS.ps1 delete mode 100644 muranorepository/Services/scripts/Join-Domain.ps1 delete mode 100644 muranorepository/Services/scripts/Linux/common.sh delete mode 100644 muranorepository/Services/scripts/Linux/configureAccessToPostgreSql.sh delete mode 100644 muranorepository/Services/scripts/Linux/configurePostgreSqlDatabase.sh delete mode 100644 muranorepository/Services/scripts/Linux/deployPostgreSql.sh delete mode 100644 muranorepository/Services/scripts/Linux/deployTomcat.sh delete mode 100644 muranorepository/Services/scripts/Linux/deployTomcatApp.sh delete mode 100644 muranorepository/Services/scripts/Linux/getIp.sh delete mode 100644 muranorepository/Services/scripts/Linux/installer.sh delete mode 100644 muranorepository/Services/scripts/Linux/runApacheDeploy.sh delete mode 100644 muranorepository/Services/scripts/Linux/runTelnetDeploy.sh delete mode 100644 muranorepository/Services/scripts/New-SqlServerSystemAccount.ps1 delete mode 100644 muranorepository/Services/scripts/OptionParser.ps1 delete mode 100644 muranorepository/Services/scripts/SQLServer/Install-SQLServer.ps1 delete mode 100644 muranorepository/Services/scripts/SQLServer/SQLServerInstaller.ps1 delete mode 100644 muranorepository/Services/scripts/SQLServer/SQLServerOptionParsers.ps1 delete mode 100644 muranorepository/Services/scripts/Set-LocalUserPassword.ps1 delete mode 100644 muranorepository/Services/scripts/SqlServerCluster/Failover-Cluster.ps1 delete mode 100644 muranorepository/Services/scripts/SqlServerCluster/SQLServerForAOAG.ps1 delete mode 100644 muranorepository/Services/scripts/Start-PowerShellProcess.ps1 delete mode 100644 muranorepository/Services/scripts/TelnetDeploy.sh delete mode 100644 muranorepository/Services/scripts/Update-ServiceConfig.ps1 delete mode 100644 muranorepository/Services/tomcat-manifest.yaml delete mode 100644 muranorepository/Services/ui_forms/ActiveDirectory.yaml delete mode 100644 muranorepository/Services/ui_forms/AspNetApp.yaml delete mode 100644 muranorepository/Services/ui_forms/AspNetAppFarm.yaml delete mode 100644 muranorepository/Services/ui_forms/Demo.yaml delete mode 100644 muranorepository/Services/ui_forms/LinuxApache.yaml delete mode 100644 muranorepository/Services/ui_forms/LinuxTelnet.yaml delete mode 100644 muranorepository/Services/ui_forms/MsSqlClusterServer.yaml delete mode 100644 muranorepository/Services/ui_forms/MsSqlServer.yaml delete mode 100644 muranorepository/Services/ui_forms/PostgreSql.yaml delete mode 100644 muranorepository/Services/ui_forms/Tomcat.yaml delete mode 100644 muranorepository/Services/ui_forms/WebServer.yaml delete mode 100644 muranorepository/Services/ui_forms/WebServerFarm.yaml delete mode 100644 muranorepository/Services/webServer-manifest.yaml delete mode 100644 muranorepository/Services/webServerFarm-manifest.yaml delete mode 100644 muranorepository/Services/workflows/AD.xml delete mode 100644 muranorepository/Services/workflows/Apache.xml delete mode 100644 muranorepository/Services/workflows/Common.xml delete mode 100644 muranorepository/Services/workflows/Demo.xml delete mode 100644 muranorepository/Services/workflows/LinuxTelnet.xml delete mode 100644 muranorepository/Services/workflows/MsSqlCluster.xml delete mode 100644 muranorepository/Services/workflows/MsSqlServer.xml delete mode 100644 muranorepository/Services/workflows/Networking.xml delete mode 100644 muranorepository/Services/workflows/PostgreSql.xml delete mode 100644 muranorepository/Services/workflows/Tomcat.xml delete mode 100644 muranorepository/Services/workflows/WebApps.xml delete mode 100644 muranorepository/__init__.py delete mode 100644 muranorepository/api/__init__.py delete mode 100644 muranorepository/api/utils.py delete mode 100644 muranorepository/api/v1.py delete mode 100644 muranorepository/babel.cfg delete mode 100644 muranorepository/cmd/__init__.py delete mode 100644 muranorepository/cmd/run.py delete mode 100644 muranorepository/config.py delete mode 100644 muranorepository/consts.py delete mode 100644 muranorepository/locale/README delete mode 100644 muranorepository/locale/muranorepository.pot delete mode 100644 muranorepository/main.py delete mode 100644 muranorepository/manifest.py delete mode 100644 muranorepository/openstack/__init__.py delete mode 100644 muranorepository/openstack/common/__init__.py delete mode 100644 muranorepository/openstack/common/cfgfilter.py delete mode 100644 muranorepository/openstack/common/context.py delete mode 100644 muranorepository/openstack/common/crypto/__init__.py delete mode 100644 muranorepository/openstack/common/crypto/utils.py delete mode 100644 muranorepository/openstack/common/eventlet_backdoor.py delete mode 100644 muranorepository/openstack/common/exception.py delete mode 100644 muranorepository/openstack/common/excutils.py delete mode 100644 muranorepository/openstack/common/fileutils.py delete mode 100644 muranorepository/openstack/common/gettextutils.py delete mode 100644 muranorepository/openstack/common/importutils.py delete mode 100644 muranorepository/openstack/common/jsonutils.py delete mode 100644 muranorepository/openstack/common/local.py delete mode 100644 muranorepository/openstack/common/lockutils.py delete mode 100644 muranorepository/openstack/common/log.py delete mode 100644 muranorepository/openstack/common/loopingcall.py delete mode 100644 muranorepository/openstack/common/middleware/__init__.py delete mode 100644 muranorepository/openstack/common/middleware/base.py delete mode 100644 muranorepository/openstack/common/middleware/debug.py delete mode 100644 muranorepository/openstack/common/network_utils.py delete mode 100644 muranorepository/openstack/common/notifier/__init__.py delete mode 100644 muranorepository/openstack/common/notifier/api.py delete mode 100644 muranorepository/openstack/common/notifier/log_notifier.py delete mode 100644 muranorepository/openstack/common/notifier/no_op_notifier.py delete mode 100644 muranorepository/openstack/common/notifier/rpc_notifier.py delete mode 100644 muranorepository/openstack/common/notifier/rpc_notifier2.py delete mode 100644 muranorepository/openstack/common/notifier/test_notifier.py delete mode 100644 muranorepository/openstack/common/periodic_task.py delete mode 100644 muranorepository/openstack/common/processutils.py delete mode 100644 muranorepository/openstack/common/rpc/__init__.py delete mode 100644 muranorepository/openstack/common/rpc/amqp.py delete mode 100644 muranorepository/openstack/common/rpc/common.py delete mode 100644 muranorepository/openstack/common/rpc/dispatcher.py delete mode 100644 muranorepository/openstack/common/rpc/impl_fake.py delete mode 100644 muranorepository/openstack/common/rpc/impl_kombu.py delete mode 100644 muranorepository/openstack/common/rpc/impl_qpid.py delete mode 100644 muranorepository/openstack/common/rpc/impl_zmq.py delete mode 100644 muranorepository/openstack/common/rpc/matchmaker.py delete mode 100644 muranorepository/openstack/common/rpc/matchmaker_redis.py delete mode 100644 muranorepository/openstack/common/rpc/matchmaker_ring.py delete mode 100644 muranorepository/openstack/common/rpc/proxy.py delete mode 100644 muranorepository/openstack/common/rpc/securemessage.py delete mode 100644 muranorepository/openstack/common/rpc/serializer.py delete mode 100644 muranorepository/openstack/common/rpc/service.py delete mode 100644 muranorepository/openstack/common/rpc/zmq_receiver.py delete mode 100644 muranorepository/openstack/common/service.py delete mode 100644 muranorepository/openstack/common/sslutils.py delete mode 100644 muranorepository/openstack/common/test.py delete mode 100644 muranorepository/openstack/common/threadgroup.py delete mode 100644 muranorepository/openstack/common/timeutils.py delete mode 100644 muranorepository/openstack/common/wsgi.py delete mode 100644 muranorepository/openstack/common/xmlutils.py delete mode 100644 muranorepository/openstack/commons.py delete mode 100644 muranorepository/tests/__init__.py delete mode 100644 muranorepository/tests/_test_client_api.py delete mode 100644 muranorepository/tests/_test_get_files.py delete mode 100644 muranorepository/tests/fixtures.py delete mode 100644 muranorepository/tests/test.conf delete mode 100644 muranorepository/tests/test_data_type_listing.py delete mode 100644 muranorepository/tests/test_dir_operations.py delete mode 100644 muranorepository/tests/test_upload.py delete mode 100644 muranorepository/utils/__init__.py delete mode 100644 muranorepository/utils/archiver.py delete mode 100644 muranorepository/utils/parser.py delete mode 100644 muranorepository/utils/utils.py delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100755 setup.sh delete mode 100644 test-requirements.txt delete mode 100644 tools/install_venv.py delete mode 100644 tools/install_venv_common.py delete mode 100755 tools/with_venv.sh delete mode 100644 tox.ini diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 37ec93a..0000000 --- a/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 48feddb..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,13 +0,0 @@ -include ChangeLog -include README.rst -include MANIFEST.in -include AUTHORS -include LICENSE -include ChangeLog -include babel.cfg -include tox.ini -include muranorepository/tests/test.conf -exclude .gitignore -exclude .gitreview -recursive-include etc * -global-exclude *.pyc diff --git a/README.rst b/README.rst index d5bd588..52b7a82 100644 --- a/README.rst +++ b/README.rst @@ -1,37 +1,5 @@ -Murano -====== -Murano Project introduces an application catalog, which allows application -developers and cloud administrators to publish various cloud-ready -applications in a browsable‎ categorised catalog, which may be used by the -cloud users (including the inexperienced ones) to pick-up the needed -applications and services and composes the reliable environments out of them -in a “push-the-button” manner. +DEPRECATED: murano-repository +============================= -murano-repository ------------------ -murano-repository is a project that serves as service endpoint for -application metadata distribution. - -Project Resources ------------------ -* `Murano at Launchpad `__ -* `Wiki `__ -* `Code Review `__ -* `Sources `__ -* `Developers Guide `__ - -How To Participate ------------------- -If you would like to ask some questions or make proposals, feel free to reach -us on #murano IRC channel at FreeNode. Typically somebody from our team will -be online at IRC from 6:00 to 20:00 UTC. You can also contact Murano community -directly by openstack-dev@lists.openstack.org adding [Murano] to a subject. - -We’re holding public weekly meetings on Tuesdays at 17:00 UTC -on #openstack-meeting-alt IRC channel at FreeNode. - -If you want to contribute either to docs or to code, simply send us change -request via `gerrit `__. -You can `file bugs `__ and -`register blueprints `__ on -Launchpad. +**Warning** - this repository is deprecated. All functionality has been moved +to `murano-api `__ diff --git a/babel.cfg b/babel.cfg deleted file mode 100644 index efceab8..0000000 --- a/babel.cfg +++ /dev/null @@ -1 +0,0 @@ -[python: **.py] diff --git a/common.inc b/common.inc deleted file mode 100644 index ed7b662..0000000 --- a/common.inc +++ /dev/null @@ -1,379 +0,0 @@ -#!/bin/bash -# -# Common functions file -# -DEBUGLVL=2 -RUN_DIR=${RUN_DIR:-$(cd $(dirname "$0") && pwd)} -LOGFILE="$RUN_DIR/install.log" -PIPAPPS="pip python-pip pip-python" -PIPCMD="" -PIPARGS="" -TRBL_FILE="" - -if [ "$DEBUGLVL" -eq 4 ]; then - set -x -fi -function log { - if [ "$DEBUGLVL" -gt 0 ]; then - chars=$(echo "@$" | wc -c) - case $DEBUGLVL in - 1) - echo -e "LOG:>$@" - ;; - 2) - echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" | tee --append $LOGFILE - ;; - 3) - echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" >> $LOGFILE - ;; - 4) - echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" | tee --append $LOGFILE - ;; - esac - fi -} -function lowercase(){ - echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" -} -function get_os(){ - KERNEL=$(uname -r) - MACH=$(uname -m) - OS=$(uname) - if [ "${OS}" = "Linux" ] ; then - if [ -f /etc/redhat-release ] ; then - DISTRO_BASED_ON='RedHat' - PACKAGER='yum' - PKG_MGR='rpm' - DIST=$(cat /etc/redhat-release |sed s/\ release.*//) - PSUEDONAME=$(cat /etc/redhat-release | sed s/.*\(// | sed s/\)//) - REV=$(cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//) - elif [ -f /etc/SuSE-release ] ; then - DISTRO_BASED_ON='SuSe' - PACKAGER='zypper' - PKG_MGR='rpm' - PSUEDONAME=$(cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//) - REV=$(cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //) - elif [ -f /etc/debian_version ] ; then - DISTRO_BASED_ON='Debian' - PACKAGER='apt-get' - PKG_MGR='dpkg' - DIST=$(cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }') - PSUEDONAME=$(cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }') - REV=$(cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }') - fi - if [ -f /etc/UnitedLinux-release ] ; then - DIST="${DIST}[$(cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//)]" - fi - OS=$(lowercase $OS) - DISTRO_BASED_ON=$(lowercase $DISTRO_BASED_ON) - readonly OS - readonly DIST - readonly DISTRO_BASED_ON - readonly PSUEDONAME - readonly REV - readonly KERNEL - readonly MACH - #readonly PACKAGER - else - OS=unknown - readonly OS - log "Unsupported OS:\"$OS\", sorry, exiting!" - exit 1 - fi -} -function find_or_install() -{ - _searching_for=$1 - _pkg_mrg_cmd='' - _pkgr_cmd='' - retval=0 - case $(lowercase $DISTRO_BASED_ON) in - "debian") - _pkg_mrg_cmd="$PKG_MGR -s $_searching_for" - _pkgr_cmd="$PACKAGER install $_searching_for --yes" - ;; - *) - _pkg_mrg_cmd="$PKG_MGR -q $_searching_for" - _pkgr_cmd="$PACKAGER install $_searching_for -y" - ;; - esac - $_pkg_mrg_cmd > /dev/null 2>&1 - if [ $? -eq 0 ]; then - log "Package \"$_searching_for\" already installed" - retval=2 - else - log "Installing \"$_searching_for\"..." - $_pkgr_cmd > /dev/null 2>&1 - if [ $? -ne 0 ];then - log "...installation fails, exiting!" - retval=1 - else - log "...success" - retval=0 - fi - fi - return $retval -} -function is_py_package_installed() -{ - retval=0 - py_pkg=$1 - found_pkg=$($PIPCMD freeze | grep -E "^$py_pkg") - if [ $? -ne 0 ]; then - retval=1 - fi - echo $found_pkg - return $retval -} -function genpass() -{ - echo $(date | md5sum |head -c${5:-13}) -} -function shslash() -{ - echo $1 | sed 's/\//\\\//g' -} -function split() -{ - # Prefix local names with the function name to try to avoid conflicts - # local split_wordlist - split_wordlist="$1" - shift - read "$@" <= v2, false if v1 < v2 -function version_ge() -{ - # Prefix local names with the function name to try to avoid conflicts - # local version_ge_1 version_ge_2 version_ge_a version_ge_b - # local version_ge_save_ifs - version_ge_v1="$1" - version_ge_v2="$2" - version_ge_save_ifs="$IFS" - while test -n "${version_ge_v1}${version_ge_v2}"; do - IFS="." - split "$version_ge_v1" version_ge_a version_ge_v1 - split "$version_ge_v2" version_ge_b version_ge_v2 - IFS="$version_ge_save_ifs" - #echo " compare $version_ge_a $version_ge_b" - test "0$version_ge_a" -gt "0$version_ge_b" && return 0 # v1>v2: true - test "0$version_ge_a" -lt "0$version_ge_b" && return 1 # v1/dev/null) - if [ $? -eq 0 ];then - break - fi - done - if [ -z "$_cmd" ];then - echo "Can't find \"pip\" in system, please install it first, exiting!" - exit 1 - else - _pip_ver=$($_cmd --version | grep -oE "[0-9]\.[0-9]" | head -n1) - if [ -n "$_pip_ver" ]; then - version_ge $_pip_ver $pip_min_ver - if [ $? -ne 0 ]; then - log "Upgrading pip ..." - $_cmd install --upgrade pip==$pip_min_ver - if [ $? -ne 0 ]; then - log "...pip upgrade fails, exiting!" - exit 1 - else - log "...success" - sleep 2 - for cmd in $PIPAPPS - do - _cmd=$(which $cmd 2>/dev/null) - if [ $? -eq 0 ];then - break - fi - done - fi - fi - _pip_ver=$($_cmd --version | grep -oE "[0-9]\.[0-9]" | head -n1) - version_ge $_pip_ver "1.5" - if [ $? -eq 0 ]; then - log "For future use, sorry, use pip v$pip_min_ver, exiting!" - exit 1 - ##_pipargs="--allow-unverified --allow-external" - #_pipargs="--allow-all-external" - #mk_dir "/root/.pip" - #_pipcfg="/root/.pip/pip.conf" - #if [ ! -f "$_pipcfg" ]; then - # touch $_pipcfg - #fi - #iniset 'install' 'allow-all-external' 'true' "$_pipcfg" - #iniset 'install' 'allow-all-unverified' 'true' "$_pipcfg" - #log "Setuptools upgrade required..." - #$cmd install setuptools --no-use-wheel --upgrade >> $LOGFILE 2>&1 - #if [ $? -ne 0 ]; then - # log "...upgrade fails, exiting" - # exit 1 - #else - # log "...success" - #fi - fi - log "Found pip version - $_pip_ver" - fi - PIPARGS=$_pipargs - PIPCMD=$_cmd - fi -} -function add_daemon_credentials() -{ - retval=0 - daemonuser=${1:-murano} - daemongroup=${2:-murano} - daemonhomedir=${3:-/home/$daemonuser} - getent group $daemongroup > /dev/null - if [ $? -ne 0 ]; then - log "Creating group \"$daemongroup\"..." - groupadd -r $daemongroup - if [ $? -eq 0 ]; then - log "...success" - else - log "Can't create \"$daemongroup\", exiting!" - retval=1 - exit 1 - fi - else - log "Group \"$daemongroup\" exists" - fi - getent passwd $daemonuser > /dev/null - if [ $? -ne 0 ]; then - log "Creating user \"$daemonuser\"..." - useradd -r -g $daemongroup -G $daemongroup -d $daemonhomedir -s $(which nologin) -c "Murano Daemons" $daemonuser - if [ $? -eq 0 ]; then - log "...success" - else - log "Can't create \"$daemonuser\", exiting!" - retval=1 - exit 1 - fi - else - log "User \"$daemonuser\" exists" - fi - return $retval -} -function remove_daemon_credentials() -{ - retval=0 - daemonuser=${1:-murano} - daemongroup=${2:-murano} - daemonhomedir=${3:-/home/$daemonuser} - getent passwd $daemonuser > /dev/null - if [ $? -eq 0 ]; then - log "Deleting user \"$daemonuser\"..." - userdel -f $daemonuser - if [ $? -eq 0 ]; then - if [ -d "$daemonhomedir" ]; then - rm -rf $daemonhomedir - fi - log "...success" - else - log "Can't delete \"$daemonuser\", exiting!" - retval=1 - exit 1 - fi - fi - getent group $daemongroup > /dev/null - if [ $? -eq 0 ]; then - log "Deleting group \"$daemongroup\"..." - groupdel $daemongroup - if [ $? -eq 0 ]; then - log "...success" - else - log "Can't delete \"$daemongroup\", exiting!" - retval=1 - exit 1 - fi - fi - return $retval -} -function iniset() -{ - local section=$1 - local option=$2 - local value=$3 - local file=$4 - local line - - if [ -z "$section" ] ; then - # No section name specified - sed -i -e "s/^\($option[ \t]*=[ \t]*\).*$/\1$value/" "$file" - else - # Check if section already exists - if ! grep -q "^\[$section\]" "$file" ; then - # Add section at the end - echo -e "\n[$section]" >>"$file" - fi - - # Check if parameter in the section exists - line=$(sed -ne "/^\[$section\]/,/^\[.*\]/ { /^$option[ \t]*=/ p; }" "$file") - if [ -z "$line" ] ; then - # Add parameter if it is not exists - sed -i -e "/^\[$section\]/ a\\ -$option = $value -" "$file" - else - # Replace existing parameter - sed -i -e "/^\[$section\]/,/^\[.*\]/ s|^\($option[ \t]*=[ \t]*\).*$|\1$value|" "$file" - fi - fi -} -function mk_dir() -{ - retval=0 - path_to_check=$1 - if [ -d "$path_to_check" ]; then - log "Path \"$path_to_check\" already exists." - elif [ -f "$path_to_check" ]; then - log "Path \"path_to_check\" is an existing file, exiting!" - exit 1 - else - mkdir -p "$path_to_check" - if [ $? -ne 0 ]; then - log "Can't create \"$path_to_check\", exiting!" - retval=1 - exit 1 - fi - fi - if [ $# -eq 3 ]; then - owner_user=$2 - owner_group=$3 - chown -R $owner_user:$owner_group $path_to_check - if [ $? -ne 0 ]; then - log "Can't set ownership to \"$owner_user:$owner_group\" for \"$path_to_check\", exiting!" - retval=1 - exit 1 - fi - fi - return $retval -} -function get_service_exec_path() -{ - retval=0 - if [ -z "$SERVICE_EXEC_PATH" ]; then - SERVICE_EXEC_PATH=$(which $DAEMON_NAME) - if [ $? -ne 0 ]; then - log "Can't find \"$DAEMON_NAME\", please install the \"$SERVICE_SRV_NAME\" by running \"$(basename "$0") install\" or set variable SERVICE_EXEC_PATH=/path/to/daemon before running setup script, exiting!" - retval=1 - fi - else - if [ ! -x "$SERVICE_EXEC_PATH" ]; then - log "\"$SERVICE_EXEC_PATH\" in not executable, please install the \"$DAEMON_NAME\" or set variable SERVICE_EXEC_PATH=/path/to/daemon before running setup script, exiting!" - retval=1 - fi - fi - return $retval -} diff --git a/etc/init.d/README.rst b/etc/init.d/README.rst deleted file mode 100644 index 236d5fe..0000000 --- a/etc/init.d/README.rst +++ /dev/null @@ -1,4 +0,0 @@ -SysV init scripts -===================== -murano-repository-redhat - for RedHat based Linux distibution -murano-repository-debian - for Debian based Linux distibution diff --git a/etc/init.d/murano-repository-debian b/etc/init.d/murano-repository-debian deleted file mode 100644 index 7bd7bc1..0000000 --- a/etc/init.d/murano-repository-debian +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh -# Copyright (c) 2014 Mirantis, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# Author: Igor Yozhikov -# -### BEGIN INIT INFO -# Provides: murano-repository -# Required-Start: $network $local_fs $remote_fs $syslog -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: OpenStack Murano Respository Service -# Description: This startup script launches murano-repository service daemon. -### END INIT INFO - - -PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin -DESC="murano-repository" -NAME=murano-repository -DAEMON=$(which murano-repository) -PIDFILE=/var/run/murano/$NAME.pid -SCRIPTNAME=/etc/init.d/openstack-$NAME -SYSTEM_USER=murano -CONFIG_FILE=/etc/murano/murano-repository.conf -# Exit if the package is not installed -[ -x $DAEMON ] || exit 5 - -# source function library -. /lib/lsb/init-functions - - - -do_start() -{ - if [ ! -d "/var/run/murano" ]; then - mkdir -p /var/run/murano - chown -R $SYSTEM_USER /var/run/murano - fi - start-stop-daemon --start --background --quiet --chuid $SYSTEM_USER:$SYSTEM_USER --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test -- --config-file=$CONFIG_FILE > /dev/null || return 1 - start-stop-daemon --start --background --quiet --chuid $SYSTEM_USER:$SYSTEM_USER --make-pidfile --pidfile $PIDFILE --startas $DAEMON -- --config-file=$CONFIG_FILE || return 2 -} - -do_stop() -{ - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE - RETVAL="$?" - rm -f $PIDFILE - return "$RETVAL" -} - -case "$1" in - start) - log_daemon_msg "Starting $DESC" "$NAME" - do_start - case "$?" in - 0|1) log_end_msg 0 ;; - 2) log_end_msg 1 ;; - esac - ;; - stop) - log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) log_end_msg 0 ;; - 2) log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - restart|force-reload) - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - diff --git a/etc/init.d/murano-repository-redhat b/etc/init.d/murano-repository-redhat deleted file mode 100644 index 6f68b5d..0000000 --- a/etc/init.d/murano-repository-redhat +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/sh -# Copyright (c) 2014 Mirantis, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# Author: Igor Yozhikov -# -### BEGIN INIT INFO -# Provides: murano-repository -# Required-Start: $network $local_fs $remote_fs $syslog -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: OpenStack Murano Respository Service -# Description: This startup script launches murano-repository service daemon. -### END INIT INFO -# chkconfig: 3 90 10 -# description: This startup script launches murano-repository service daemon. -# config: /etc/murano/murano-repository.conf -# -PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin -DESC="murano-repository" -NAME=murano-repository -DAEMON=$(which murano-repository) -PIDFILE=/var/run/murano/$NAME.pid -SCRIPTNAME=/etc/init.d/openstack-$NAME -SYSTEM_USER=murano -CONFIG_FILE=/etc/murano/murano-repository.conf -LOCKFILE=/var/lock/subsys/$NAME -# Exit if the package is not installed -[ -x $DAEMON ] || exit 5 - -# source function library -. /etc/init.d/functions - -RETVAL=0 - - -start() { - if [ ! -d "/var/run/murano" ]; then - mkdir -p /var/run/murano - chown -R $SYSTEM_USER /var/run/murano - fi - echo -n "Starting $NAME: " - daemon --user $SYSTEM_USER "$DAEMON --config-file=$CONFIG_FILE &>/dev/null & echo \$! > $PIDFILE" - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch $LOCKFILE - return $RETVAL -} - -stop() { - echo -n "Stopping $NAME: " - #killproc $DAEMON -TERM - killproc -p $PIDFILE $DAEMON - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f $LOCKFILE - return $RETVAL -} - -restart() { - stop - start -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $DAEMON -} - - -case "$1" in - start) - start - ;; - - stop) - stop - ;; - - restart) - restart - ;; - - status) - rh_status - ;; - *) - echo $"Usage: $0 {start|stop|status|restart}" - exit 2 -esac -exit $? - diff --git a/etc/murano/murano-repository.conf.sample b/etc/murano/murano-repository.conf.sample deleted file mode 100644 index b098466..0000000 --- a/etc/murano/murano-repository.conf.sample +++ /dev/null @@ -1,55 +0,0 @@ -[DEFAULT] -# Address to bind the server to -host = 0.0.0.0 -# Port the bind the server to -port = 8084 - -# Directory for cache, OS temp directory is used by default -# data_dir = /tmp/muranorepository-data - -# Show more verbose log output (sets INFO log level output) -verbose = True - -# Show debugging output in logs (sets DEBUG log level output) -debug = True - -# Set up logging. To use syslog just set use_syslog parameter value to 'True'. -log_file = /tmp/murano-repository.log -use_syslog = False -syslog_log_facility = LOG_LOCAL0 - -# Provide information about data types -# absolute or relative path to manifest location(root directory) -# where absolute path starts with / and relative to the repository folder -# while relative hasn't leading '/' and is prepended to the repository folder -manifests = Services - -# Parameter name corresponds to section in manifest file -# Parameter value corresponds to relative path inside folder with manifests -ui = ui_forms -workflows = workflows -heat = heat_templates -agent = agent_templates -scripts = scripts - -# Configure client archive structure -# Format: data_type = desired folder -# ui parameter is not actually used, but is kept to not break things apart -[output] -ui = service_forms -workflows = workflows -heat = templates/cf -agent = templates/agent -scripts = templates/agent/scripts - -#Configure keystone location. -#For more information see Auth-Token Middleware with Username and Password -#http://docs.openstack.org/developer/keystone/configuringservices.html -[keystone] -auth_host = 127.0.0.1 -auth_port = 5000 -auth_protocol = http -admin_user = admin -admin_password = swordfish -admin_tenant_name = admin -signing_dir = /tmp/keystone-signing-muranorepository diff --git a/muranorepository/Services/activeDirectory-manifest.yaml b/muranorepository/Services/activeDirectory-manifest.yaml deleted file mode 100644 index 7d5330c..0000000 --- a/muranorepository/Services/activeDirectory-manifest.yaml +++ /dev/null @@ -1,48 +0,0 @@ -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 -enabled: true - -ui: -- ActiveDirectory.yaml - -workflows: -- AD.xml -- Networking.xml -- Common.xml - -heat: -- RouterInterface.template -- Windows.template -- Network.template -- Param.template -- Subnet.template -- InstancePortWSubnet.template -- InstancePort.template -- NNSecurity.template -- DefaultSecurity.template -- WindowsSecurity.template -- DomainSecurity.template - -agent: -- CreatePrimaryDC.template -- LeaveDomain.template -- SetPassword.template -- CreateSecondaryDC.template -- AskDnsIp.template -- JoinDomain.template - -scripts: -- Install-RoleSecondaryDomainController.ps1 -- Install-RolePrimaryDomainController.ps1 -- Join-Domain.ps1 -- ImportCoreFunctions.ps1 -- Get-DnsListeningIpAddress.ps1 -- Set-LocalUserPassword.ps1 - diff --git a/muranorepository/Services/agent_templates/AskDnsIp.template b/muranorepository/Services/agent_templates/AskDnsIp.template deleted file mode 100644 index 6d6bd40..0000000 --- a/muranorepository/Services/agent_templates/AskDnsIp.template +++ /dev/null @@ -1,12 +0,0 @@ -{ - "Scripts": [ - "Get-DnsListeningIpAddress.ps1" - ], - "Commands": [ - { - "Name": "Get-DnsListeningIpAddress", - "Arguments": {} - } - ], - "RebootOnCompletion": 0 -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/ConfigureAccessToPostgreSql.template b/muranorepository/Services/agent_templates/ConfigureAccessToPostgreSql.template deleted file mode 100644 index 051959f..0000000 --- a/muranorepository/Services/agent_templates/ConfigureAccessToPostgreSql.template +++ /dev/null @@ -1,23 +0,0 @@ -FormatVersion: 2.0.0 -Version: 1.0.0 -Name: Configure database access credentails - -Parameters: - database: $database - username: $username - password: $password - host: $databaseHost - -Body: | - return configure('{0} {1} {2} {3}'.format(args.database, args.username, args.password, args.host)).stdout - -Scripts: - configure: - Type: Application - Version: 1.0.0 - EntryPoint: Linux/configureAccessToPostgreSql.sh - Files: - - - Options: - captureStdout: true - captureStderr: false diff --git a/muranorepository/Services/agent_templates/ConfigurePostgreSqlDatabase.template b/muranorepository/Services/agent_templates/ConfigurePostgreSqlDatabase.template deleted file mode 100644 index 0401116..0000000 --- a/muranorepository/Services/agent_templates/ConfigurePostgreSqlDatabase.template +++ /dev/null @@ -1,22 +0,0 @@ -FormatVersion: 2.0.0 -Version: 1.0.0 -Name: Add database and user to PostgreSql - -Parameters: - database: $database - username: $username - password: $password - -Body: | - return configure('{0} {1} {2}'.format(args.database, args.username, args.password)).stdout - -Scripts: - configure: - Type: Application - Version: 1.0.0 - EntryPoint: Linux/configurePostgreSqlDatabase.sh - Files: - - - Options: - captureStdout: true - captureStderr: false diff --git a/muranorepository/Services/agent_templates/CreatePrimaryDC.template b/muranorepository/Services/agent_templates/CreatePrimaryDC.template deleted file mode 100644 index 6633057..0000000 --- a/muranorepository/Services/agent_templates/CreatePrimaryDC.template +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Scripts": [ - "ImportCoreFunctions.ps1", - "Install-RolePrimaryDomainController.ps1" - ], - "Commands": [ - { - "Name": "Install-RolePrimaryDomainController", - "Arguments": { - "DomainName": "$domain", - "SafeModePassword": "$recoveryPassword" - } - } - ], - "RebootOnCompletion": 1 -} diff --git a/muranorepository/Services/agent_templates/CreateSecondaryDC.template b/muranorepository/Services/agent_templates/CreateSecondaryDC.template deleted file mode 100644 index 6b492f2..0000000 --- a/muranorepository/Services/agent_templates/CreateSecondaryDC.template +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Scripts": [ - "ImportCoreFunctions.ps1", - "Install-RoleSecondaryDomainController.ps1" - ], - "Commands": [ - { - "Name": "Install-RoleSecondaryDomainController", - "Arguments": { - "DomainName": "$domain", - "UserName": "Administrator", - "Password": "$domainPassword", - "SafeModePassword": "$recoveryPassword" - } - } - ], - "RebootOnCompletion": 1 -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/Demo.template b/muranorepository/Services/agent_templates/Demo.template deleted file mode 100644 index 3a41aec..0000000 --- a/muranorepository/Services/agent_templates/Demo.template +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Scripts": [ - ], - "Commands": [ - ], - "RebootOnCompletion": 0 -} diff --git a/muranorepository/Services/agent_templates/DeployApache.template b/muranorepository/Services/agent_templates/DeployApache.template deleted file mode 100644 index cca6b86..0000000 --- a/muranorepository/Services/agent_templates/DeployApache.template +++ /dev/null @@ -1,21 +0,0 @@ -FormatVersion: 2.0.0 -Version: 1.0.0 -Name: Deploy Apache - -Parameters: - enablePHP: $deployApachePHP - -Body: | - return apacheDeploy('{0}'.format(args.enablePHP)).stdout - -Scripts: - apacheDeploy: - Type: Application - Version: 1.0.0 - EntryPoint: Linux/runApacheDeploy.sh - Files: - - - - - Options: - captureStdout: true - captureStderr: false \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/DeployPostgreSql.template b/muranorepository/Services/agent_templates/DeployPostgreSql.template deleted file mode 100644 index e9f499f..0000000 --- a/muranorepository/Services/agent_templates/DeployPostgreSql.template +++ /dev/null @@ -1,21 +0,0 @@ -FormatVersion: 2.0.0 -Version: 1.0.0 -Name: Deploy PostgreSql - -Parameters: - appName: $appName - -Body: | - return deploy(args.appName).stdout - -Scripts: - deploy: - Type: Application - Version: 1.0.0 - EntryPoint: Linux/deployPostgreSql.sh - Files: - - - - - Options: - captureStdout: true - captureStderr: false diff --git a/muranorepository/Services/agent_templates/DeployTelnet.template b/muranorepository/Services/agent_templates/DeployTelnet.template deleted file mode 100644 index f8c2bb7..0000000 --- a/muranorepository/Services/agent_templates/DeployTelnet.template +++ /dev/null @@ -1,22 +0,0 @@ -FormatVersion: 2.0.0 -Version: 1.0.0 -Name: Deploy Telnet - -Parameters: - appName: $appName - - -Body: | - return telnetDeploy(args.appName).stdout - -Scripts: - telnetDeploy: - Type: Application - Version: 1.0.0 - EntryPoint: Linux/runTelnetDeploy.sh - Files: - - - - - Options: - captureStdout: true - captureStderr: false diff --git a/muranorepository/Services/agent_templates/DeployTomcat.template b/muranorepository/Services/agent_templates/DeployTomcat.template deleted file mode 100644 index ae8cadc..0000000 --- a/muranorepository/Services/agent_templates/DeployTomcat.template +++ /dev/null @@ -1,21 +0,0 @@ -FormatVersion: 2.0.0 -Version: 1.0.0 -Name: Deploy Tomcat - -Parameters: - appName: $appName - -Body: | - return deploy(args.appName).stdout - -Scripts: - deploy: - Type: Application - Version: 1.0.0 - EntryPoint: Linux/deployTomcat.sh - Files: - - - - - Options: - captureStdout: true - captureStderr: false diff --git a/muranorepository/Services/agent_templates/DeployTomcatApp.template b/muranorepository/Services/agent_templates/DeployTomcatApp.template deleted file mode 100644 index 1aaf94d..0000000 --- a/muranorepository/Services/agent_templates/DeployTomcatApp.template +++ /dev/null @@ -1,21 +0,0 @@ -FormatVersion: 2.0.0 -Version: 1.0.0 -Name: Deploy Tomcat - -Parameters: - repository: $repository - -Body: | - return installApp(args.repository).stdout - -Scripts: - installApp: - Type: Application - Version: 1.0.0 - EntryPoint: Linux/deployTomcatApp.sh - Files: - - - - - Options: - captureStdout: true - captureStderr: false diff --git a/muranorepository/Services/agent_templates/DeployWebApp.template b/muranorepository/Services/agent_templates/DeployWebApp.template deleted file mode 100644 index 16ead07..0000000 --- a/muranorepository/Services/agent_templates/DeployWebApp.template +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Scripts": [ - "ImportCoreFunctions.ps1", - "DeployWebApp.ps1" - ], - "Commands": [ - { - "Name": "Deploy-WebAppFromGit", - "Arguments": { - "URL": "$repository" - } - } - ], - "RebootOnCompletion": 0 -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/GetIP.template b/muranorepository/Services/agent_templates/GetIP.template deleted file mode 100644 index 3b8b2e0..0000000 --- a/muranorepository/Services/agent_templates/GetIP.template +++ /dev/null @@ -1,19 +0,0 @@ -FormatVersion: 2.0.0 -Version: 1.0.0 -Name: Deploy Tomcat - -Parameters: - appName: $appName - -Body: | - return getIp(args.appName).stdout - -Scripts: - getIp: - Type: Application - Version: 1.0.0 - EntryPoint: Linux/getIp.sh - Files: [] - Options: - captureStdout: true - captureStderr: false diff --git a/muranorepository/Services/agent_templates/InstallIIS.template b/muranorepository/Services/agent_templates/InstallIIS.template deleted file mode 100644 index 6389f3b..0000000 --- a/muranorepository/Services/agent_templates/InstallIIS.template +++ /dev/null @@ -1,22 +0,0 @@ -{ - "Scripts": [ - "ImportCoreFunctions.ps1", - "CopyPrerequisites.ps1", - "InstallIIS.ps1" - ], - "Commands": [ - { - "Name": "Copy-Prerequisites", - "Arguments": { - "Destination": "C:\\Prerequisites" - } - }, - { - "Name": "Install-WebServer", - "Arguments": { - "PrerequisitesPath": "C:\\Prerequisites" - } - } - ], - "RebootOnCompletion": 0 -} diff --git a/muranorepository/Services/agent_templates/InstallMsSqlServer.template b/muranorepository/Services/agent_templates/InstallMsSqlServer.template deleted file mode 100644 index 51fbd40..0000000 --- a/muranorepository/Services/agent_templates/InstallMsSqlServer.template +++ /dev/null @@ -1,24 +0,0 @@ -{ - "Scripts": [ - "ImportCoreFunctions.ps1", - "OptionParser.ps1", - "SQLServer/SQLServerOptionParsers.ps1", - "SQLServer/SQLServerInstaller.ps1", - "SQLServer/Install-SQLServer.ps1", - "Alter-FirewallRulesForSQL.ps1" - ], - "Commands": [ - { - "Name": "Install-SQLServer", - "Arguments": { - "SAPassword": "$saPassword", - "MixedModeAuth": "$mixedModeAuth" - } - }, - { - "Name": "Enable-SQLExternalAccess", - "Arguments": {} - } - ], - "RebootOnCompletion": 0 -} diff --git a/muranorepository/Services/agent_templates/JoinDomain.template b/muranorepository/Services/agent_templates/JoinDomain.template deleted file mode 100644 index 3d8cbef..0000000 --- a/muranorepository/Services/agent_templates/JoinDomain.template +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/LeaveDomain.template b/muranorepository/Services/agent_templates/LeaveDomain.template deleted file mode 100644 index 262ac0b..0000000 --- a/muranorepository/Services/agent_templates/LeaveDomain.template +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Scripts": [], - "Commands": [], - "RebootOnCompletion": 0, -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/SetPassword.template b/muranorepository/Services/agent_templates/SetPassword.template deleted file mode 100644 index 101db0e..0000000 --- a/muranorepository/Services/agent_templates/SetPassword.template +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Scripts": [ - "ImportCoreFunctions.ps1", - "Set-LocalUserPassword.ps1" - ], - "Commands": [ - { - "Name": "Set-LocalUserPassword", - "Arguments": { - "UserName": "Administrator", - "Password": "$adminPassword", - "Force": true - } - } - ], - "RebootOnCompletion": 0 -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/SqlServerCluster/ConfigureEnvironmentForAOAG.template b/muranorepository/Services/agent_templates/SqlServerCluster/ConfigureEnvironmentForAOAG.template deleted file mode 100644 index 28ddc67..0000000 --- a/muranorepository/Services/agent_templates/SqlServerCluster/ConfigureEnvironmentForAOAG.template +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Scripts": [ - "/ImportCoreFunctions.ps1", - "SQLServerForAOAG.ps1" - ], - "Commands": [ - { - "Name": "Enable-TrustedHosts", - "Arguments": {} - }, - { - "Name": "New-SharedFolderForAOAG", - "Arguments": { - "PrimaryNode": "$primaryNode" - } - } - ] -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/SqlServerCluster/FailoverCluster.template b/muranorepository/Services/agent_templates/SqlServerCluster/FailoverCluster.template deleted file mode 100644 index 365bf0f..0000000 --- a/muranorepository/Services/agent_templates/SqlServerCluster/FailoverCluster.template +++ /dev/null @@ -1,21 +0,0 @@ -{ - "Scripts": [ - "/ImportCoreFunctions.ps1", - "/Start-PowerShellProcess.ps1", - "Failover-Cluster.ps1" - ], - "Commands": [ - { - "Name": "New-FailoverCluster", - "Arguments": { - "UserName": "$domainAdminAccountName", - "ClusterNodes": "$clusterNodes", - "DomainName": "$domainName", - "ClusterName": "$clusterName", - "UserPassword": "$domainAdminAccountPassword", - "StaticAddress": "$clusterIp" - } - } - ], - "RebootOnCompletion": 0 -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/SqlServerCluster/FailoverClusterPrerequisites.template b/muranorepository/Services/agent_templates/SqlServerCluster/FailoverClusterPrerequisites.template deleted file mode 100644 index 3c63f11..0000000 --- a/muranorepository/Services/agent_templates/SqlServerCluster/FailoverClusterPrerequisites.template +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Scripts": [ - "/ImportCoreFunctions.ps1", - "/Update-ServiceConfig.ps1", - "SQLServerForAOAG.ps1", - "Failover-Cluster.ps1" - ], - "Commands": [ - { - "Name": "Install-FailoverClusterPrerequisites", - "Arguments": {} - }, - { - "Name": "Enable-TrustedHosts", - "Arguments": {} - }, - { - "Name": "Update-ServiceConfig", - "Arguments": { - "Password": "$domainAdminAccountPassword", - "Name": "Murano Agent", - "RunAsUser": "$domainAdminAccountName", - "DomainName": "$domainName" - } - } - ], - "RebootOnCompletion": 1 -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/SqlServerCluster/InitializeAOAGPrimaryReplica.template b/muranorepository/Services/agent_templates/SqlServerCluster/InitializeAOAGPrimaryReplica.template deleted file mode 100644 index e70d880..0000000 --- a/muranorepository/Services/agent_templates/SqlServerCluster/InitializeAOAGPrimaryReplica.template +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Scripts": [ - "/ImportCoreFunctions.ps1", - "/OptionParser.ps1", - "/SQLServer/SQLServerOptionParsers.ps1", - "/SQLServer/SQLServerInstaller.ps1", - "/Export-Function.ps1", - "/Start-PowerShellProcess.ps1", - "SQLServerForAOAG.ps1" - ], - "Commands": [ - { - "Name": "Initialize-AOAGPrimaryReplica", - "Arguments": { - "UserName": "$domainAdminAccountName", - "NodeList": "$nodeList", - "PrimaryNode": "$primaryNode", - "DomainName": "$domainName", - "UserPassword": "$domainAdminAccountPassword", - "GroupName": "$groupName", - "ListenerName": "$listenerName", - "SyncModeNodeList": "$syncModeNodeList", - "ListenerIP": "$listenerIP", - "DatabaseList": "$databaseList" - } - } - ] -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/SqlServerCluster/InitializeAOAGSecondaryReplica.template b/muranorepository/Services/agent_templates/SqlServerCluster/InitializeAOAGSecondaryReplica.template deleted file mode 100644 index 18bee96..0000000 --- a/muranorepository/Services/agent_templates/SqlServerCluster/InitializeAOAGSecondaryReplica.template +++ /dev/null @@ -1,23 +0,0 @@ -{ - "Scripts": [ - "/ImportCoreFunctions.ps1", - "/OptionParser.ps1", - "/SQLServer/SQLServerOptionParsers.ps1", - "/SQLServer/SQLServerInstaller.ps1", - "/Export-Function.ps1", - "/Start-PowerShellProcess.ps1", - "SQLServerForAOAG.ps1" - ], - "Commands": [ - { - "Name": "Initialize-AOAGSecondaryReplica", - "Arguments": { - "UserName": "$domainAdminAccountName", - "UserPassword": "$domainAdminAccountPassword", - "NodeList": "$nodeList", - "PrimaryNode": "$primaryNode", - "DomainName": "$domainName" - } - } - ] -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/SqlServerCluster/InitializeAlwaysOn.template b/muranorepository/Services/agent_templates/SqlServerCluster/InitializeAlwaysOn.template deleted file mode 100644 index 83317d2..0000000 --- a/muranorepository/Services/agent_templates/SqlServerCluster/InitializeAlwaysOn.template +++ /dev/null @@ -1,23 +0,0 @@ -{ - "Scripts": [ - "/ImportCoreFunctions.ps1", - "/OptionParser.ps1", - "/SQLServer/SQLServerOptionParsers.ps1", - "/SQLServer/SQLServerInstaller.ps1", - "/Export-Function.ps1", - "/Start-PowerShellProcess.ps1", - "SQLServerForAOAG.ps1" - ], - "Commands": [ - { - "Name": "Initialize-AlwaysOnAvailabilityGroup", - "Arguments": { - "DomainAdminAccountName": "$domainAdminAccountName", - "DomainAdminAccountPassword": "$domainAdminAccountPassword", - "NodeList": "$nodeList", - "PrimaryNode": "$primaryNode", - "DomainName": "$domainName" - } - } - ] -} \ No newline at end of file diff --git a/muranorepository/Services/agent_templates/SqlServerCluster/InstallSqlServerForAOAG.template b/muranorepository/Services/agent_templates/SqlServerCluster/InstallSqlServerForAOAG.template deleted file mode 100644 index 72f8b9d..0000000 --- a/muranorepository/Services/agent_templates/SqlServerCluster/InstallSqlServerForAOAG.template +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Scripts": [ - "/ImportCoreFunctions.ps1", - "/OptionParser.ps1", - "/SQLServer/SQLServerOptionParsers.ps1", - "/SQLServer/SQLServerInstaller.ps1", - "SQLServerForAOAG.ps1" - ], - "Commands": [ - { - "Name": "Disable-Firewall", - "Arguments": {} - }, - { - "Name": "Install-SQLServerForAOAG", - "Arguments": { - "SQLServiceUserPassword": "$domainAdminAccountPassword", - "SQLServiceUserDomain": "$domainName", - "SQLServiceUserName": "$domainAdminAccountName" - } - }, - { - "Name": "Install-SqlServerPowerShellModule", - "Arguments": {} - } - ] -} \ No newline at end of file diff --git a/muranorepository/Services/aspNetApp-manifest.yaml b/muranorepository/Services/aspNetApp-manifest.yaml deleted file mode 100644 index 3143f57..0000000 --- a/muranorepository/Services/aspNetApp-manifest.yaml +++ /dev/null @@ -1,46 +0,0 @@ -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 -enabled: True - -ui: - - AspNetApp.yaml - -workflows: - - WebApps.xml - - Common.xml - - Networking.xml - -heat: - - Windows.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - DefaultSecurity.template - - WindowsSecurity.template - - WebServerSecurity.template - - FloatingIP.template - -agent: - - SetPassword.template - - InstallIIS.template - - DeployWebApp.template - -scripts: - - ImportCoreFunctions.ps1 - - Set-LocalUserPassword.ps1 - - CopyPrerequisites.ps1 - - InstallIIS.ps1 - - DeployWebApp.ps1 - diff --git a/muranorepository/Services/aspNetAppFarm-manifest.yaml b/muranorepository/Services/aspNetAppFarm-manifest.yaml deleted file mode 100644 index d121e3e..0000000 --- a/muranorepository/Services/aspNetAppFarm-manifest.yaml +++ /dev/null @@ -1,46 +0,0 @@ -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 -enabled: True - -ui: - - AspNetAppFarm.yaml - -workflows: - - WebApps.xml - - Common.xml - - Networking.xml - -heat: - - Windows.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - LoadBalancer.template - - DefaultSecurity.template - - WindowsSecurity.template - - WebServerSecurity.template - - FloatingIPwithLB.template - -agent: - - SetPassword.template - - InstallIIS.template - - DeployWebApp.template - -scripts: - - ImportCoreFunctions.ps1 - - Set-LocalUserPassword.ps1 - - CopyPrerequisites.ps1 - - InstallIIS.ps1 - - DeployWebApp.ps1 diff --git a/muranorepository/Services/demoService-manifest.yaml b/muranorepository/Services/demoService-manifest.yaml deleted file mode 100644 index 77e4c49..0000000 --- a/muranorepository/Services/demoService-manifest.yaml +++ /dev/null @@ -1,34 +0,0 @@ -version: 0.1 -service_display_name: Demo Service - -description: Demo Service shows how Murano is working. -full_service_name: demoService -author: Mirantis Inc. -service_version: 1 -enabled: true - -agent: -- Demo.template - -ui: -- Demo.yaml - -workflows: -- Networking.xml -- Common.xml -- Demo.xml - -heat: -- Demo.template -- RouterInterface.template -- Network.template -- NNSecurity.template -- Param.template -- Subnet.template -- InstancePortWSubnet.template -- InstancePort.template -- DefaultSecurity.template -- LinuxSecurity.template -- DemoSecurity.template - -scripts: [] diff --git a/muranorepository/Services/heat_templates/DefaultSecurity.template b/muranorepository/Services/heat_templates/DefaultSecurity.template deleted file mode 100644 index 8fb2e26..0000000 --- a/muranorepository/Services/heat_templates/DefaultSecurity.template +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "ToPort": "-1", - "IpProtocol": "icmp", - "FromPort": "-1", - "CidrIp": "$cidr" - } - ], - "GroupDescription": "$Composite security group for Murano Environment {envName}" - } - } - } -} diff --git a/muranorepository/Services/heat_templates/Demo.template b/muranorepository/Services/heat_templates/Demo.template deleted file mode 100644 index d3c3997..0000000 --- a/muranorepository/Services/heat_templates/Demo.template +++ /dev/null @@ -1,15 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - - "Resources": { - "$instanceName": { - "Type": "AWS::EC2::Instance", - "Properties": { - "InstanceType": "$instanceType", - "ImageId": "$imageName", - "AvailabilityZone": "$availabilityZone", - "UserData": "$userData" - } - } - } -} diff --git a/muranorepository/Services/heat_templates/DemoSecurity.template b/muranorepository/Services/heat_templates/DemoSecurity.template deleted file mode 100644 index d5de9fc..0000000 --- a/muranorepository/Services/heat_templates/DemoSecurity.template +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "ToPort": "-1", - "IpProtocol": "icmp", - "FromPort": "-1", - "CidrIp": "0.0.0.0/0" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/DomainSecurity.template b/muranorepository/Services/heat_templates/DomainSecurity.template deleted file mode 100644 index 6e7fb4c..0000000 --- a/muranorepository/Services/heat_templates/DomainSecurity.template +++ /dev/null @@ -1,143 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "IpProtocol": "tcp", - "FromPort": "25", - "ToPort": "25", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "53", - "ToPort": "53", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "53", - "ToPort": "53", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "88", - "ToPort": "88", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "88", - "ToPort": "88", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "123", - "ToPort": "123", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "135", - "ToPort": "135", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "137", - "ToPort": "137", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "138", - "ToPort": "138", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "445", - "ToPort": "445", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "445", - "ToPort": "445", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "464", - "ToPort": "464", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "464", - "ToPort": "464", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "389", - "ToPort": "389", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "389", - "ToPort": "389", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "636", - "ToPort": "636", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "3268", - "ToPort": "3268", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "3269", - "ToPort": "3269", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "5722", - "ToPort": "5722", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "9389", - "ToPort": "9389", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "49152", - "ToPort": "65535", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "49152", - "ToPort": "65535", - "CidrIp": "$cidr" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/FloatingIP.template b/muranorepository/Services/heat_templates/FloatingIP.template deleted file mode 100644 index e428be9..0000000 --- a/muranorepository/Services/heat_templates/FloatingIP.template +++ /dev/null @@ -1,24 +0,0 @@ -{ - "Resources": { - "${instanceName}-FloatingIP": { - "Type": "OS::Neutron::FloatingIP", - "Properties": { - "floating_network_id": "$externalNetworkId" - } - }, - "${instanceName}-FloatingIpAssoc": { - "Type": "OS::Neutron::FloatingIPAssociation", - "Properties": { - "floatingip_id": { "Ref" : "${instanceName}-FloatingIP" }, - "port_id": { "Ref" : "$instancePort" } - } - } - }, - "Outputs": { - "${instanceName}-FloatingIPaddress": { - "Value": {"Fn::GetAtt": ["${instanceName}-FloatingIP", "floating_ip_address"]}, - "Description": "Floating IP assigned" - } - } -} - diff --git a/muranorepository/Services/heat_templates/FloatingIPwithLB.template b/muranorepository/Services/heat_templates/FloatingIPwithLB.template deleted file mode 100644 index 8a43ad6..0000000 --- a/muranorepository/Services/heat_templates/FloatingIPwithLB.template +++ /dev/null @@ -1,23 +0,0 @@ -{ - "Resources": { - "${lbName}-FloatingIP": { - "Type": "OS::Neutron::FloatingIP", - "Properties": { - "floating_network_id": "$externalNetworkId" - } - }, - "${lbName}-FloatingIpAssoc": { - "Type": "OS::Neutron::FloatingIPAssociation", - "Properties": { - "floatingip_id": { "Ref" : "${lbName}-FloatingIP" }, - "port_id": {"Fn::Select": ["port_id", {"Fn::GetAtt": ["${lbName}-Pool", "vip"]}]} - } - } - }, - "Outputs": { - "${lbName}-FloatingIPaddress": { - "Value": {"Fn::GetAtt": ["${lbName}-FloatingIP", "floating_ip_address"]}, - "Description": "Floating IP assigned" - } - } -} diff --git a/muranorepository/Services/heat_templates/InstancePort.template b/muranorepository/Services/heat_templates/InstancePort.template deleted file mode 100644 index 219374a..0000000 --- a/muranorepository/Services/heat_templates/InstancePort.template +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Resources": { - "$instanceName": { - "Properties": { - "NetworkInterfaces": [ - { - "Ref": "$instancePort" - } - ] - } - }, - "$instancePort": { - "Type": "OS::Neutron::Port", - "Properties": { - "security_groups": [ - { - "Ref": "$MuranoSecurityGroup-{envName}" - } - ], - "network_id": { - "Ref": "$network" - } - } - } - }, - - "Outputs": { - } -} diff --git a/muranorepository/Services/heat_templates/InstancePortWSubnet.template b/muranorepository/Services/heat_templates/InstancePortWSubnet.template deleted file mode 100644 index 19d3883..0000000 --- a/muranorepository/Services/heat_templates/InstancePortWSubnet.template +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Resources": { - "$instanceName": { - "Properties": { - "NetworkInterfaces": [ - { - "Ref": "$instancePort" - } - ] - } - }, - "$instancePort": { - "Type": "OS::Neutron::Port", - "Properties": { - "security_groups": [ - { - "Ref": "$MuranoSecurityGroup-{envName}" - } - ], - "network_id": { - "Ref": "$network" - }, - "fixed_ips": [ - { - "subnet_id": { - "Ref": "$subnet" - } - } - ] - } - } - }, - - "Outputs": { - } -} diff --git a/muranorepository/Services/heat_templates/Keypair.template b/muranorepository/Services/heat_templates/Keypair.template deleted file mode 100644 index d4c81f4..0000000 --- a/muranorepository/Services/heat_templates/Keypair.template +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Resources": { - "$instanceName": { - "Properties": { - "KeyName": "$keyName" - } - } - } -} diff --git a/muranorepository/Services/heat_templates/Linux.template b/muranorepository/Services/heat_templates/Linux.template deleted file mode 100644 index b0d446f..0000000 --- a/muranorepository/Services/heat_templates/Linux.template +++ /dev/null @@ -1,18 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - - "Resources": { - "$instanceName": { - "Type": "AWS::EC2::Instance", - "Properties": { - "InstanceType": "$instanceType", - "ImageId": "$imageName", - "AvailabilityZone": "$availabilityZone", - "UserData": "$userData" - } - } - }, - - "Outputs": { - } -} diff --git a/muranorepository/Services/heat_templates/LinuxSecurity.template b/muranorepository/Services/heat_templates/LinuxSecurity.template deleted file mode 100644 index b898056..0000000 --- a/muranorepository/Services/heat_templates/LinuxSecurity.template +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "ToPort": "22", - "IpProtocol": "tcp", - "FromPort": "22", - "CidrIp": "0.0.0.0/0" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/LoadBalancer.template b/muranorepository/Services/heat_templates/LoadBalancer.template deleted file mode 100644 index 7d94caf..0000000 --- a/muranorepository/Services/heat_templates/LoadBalancer.template +++ /dev/null @@ -1,44 +0,0 @@ -{ - "Resources": { - "${lbName}-HealthMonitor": { - "Type": "OS::Neutron::HealthMonitor", - "Properties": { - "type": "HTTP", - "delay": 3, - "max_retries": 3, - "timeout": 10, - "http_method": "GET", - "expected_codes": "200", - "url_path": "/" - } - }, - "${lbName}-Pool": { - "Type": "OS::Neutron::Pool", - "Properties": { - "protocol": "HTTP", - "subnet_id": {"Ref": "subnet"}, - "lb_method": "ROUND_ROBIN", - "name": "${lbName}-Pool", - "vip": { - "name": "${lbName}-Pool-VIP", - "protocol_port": "$lbPort" - }, - "monitors": [{"Ref": "${lbName}-HealthMonitor"}] - } - }, - "${lbName}-LoadBalancer": { - "Type": "OS::Neutron::LoadBalancer", - "Properties": { - "pool_id": {"Ref": "${lbName}-Pool"}, - "protocol_port": "$lbPort", - "members": [{"Ref": "$instanceName"}] - } - } - }, - "Outputs": { - "${lbName}-loadBalancerIp": { - "Value": {"Fn::Select": ["address", {"Fn::GetAtt": ["${lbName}-Pool", "vip"]}]}, - "Description": "IP assigned to VIP" - } - } -} diff --git a/muranorepository/Services/heat_templates/NNSecurity.template b/muranorepository/Services/heat_templates/NNSecurity.template deleted file mode 100644 index cc0051a..0000000 --- a/muranorepository/Services/heat_templates/NNSecurity.template +++ /dev/null @@ -1,13 +0,0 @@ -{ - "Resources": { - "$instanceName": { - "Properties": { - "SecurityGroups": [ - { - "Ref": "$MuranoSecurityGroup-{envName}" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/Network.template b/muranorepository/Services/heat_templates/Network.template deleted file mode 100644 index 36d1769..0000000 --- a/muranorepository/Services/heat_templates/Network.template +++ /dev/null @@ -1,14 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - - "Resources": { - "network": { - "Type": "OS::Neutron::Net", - "Properties": { - "name": "$networkName" - } - } - }, - "Outputs": { - } -} diff --git a/muranorepository/Services/heat_templates/Param.template b/muranorepository/Services/heat_templates/Param.template deleted file mode 100644 index d771075..0000000 --- a/muranorepository/Services/heat_templates/Param.template +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Parameters" : { - "$paramName" : { - "Type" : "String", - "Default" : "$paramValue" - } - } -} \ No newline at end of file diff --git a/muranorepository/Services/heat_templates/PostgreSqlSecurity.template b/muranorepository/Services/heat_templates/PostgreSqlSecurity.template deleted file mode 100644 index 6c87d9e..0000000 --- a/muranorepository/Services/heat_templates/PostgreSqlSecurity.template +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "ToPort": "5432", - "IpProtocol": "tcp", - "FromPort": "5432", - "CidrIp": "0.0.0.0/0" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/RouterInterface.template b/muranorepository/Services/heat_templates/RouterInterface.template deleted file mode 100644 index c5ade70..0000000 --- a/muranorepository/Services/heat_templates/RouterInterface.template +++ /dev/null @@ -1,18 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - - "Resources": { - "$interfaceName": { - "Type": "OS::Neutron::RouterInterface", - "Properties": { - "router_id": "$routerId", - "subnet_id": { - "Ref": "$subnet" - } - } - } - }, - - "Outputs": { - } -} diff --git a/muranorepository/Services/heat_templates/SQL-security.template b/muranorepository/Services/heat_templates/SQL-security.template deleted file mode 100644 index ffcf5d9..0000000 --- a/muranorepository/Services/heat_templates/SQL-security.template +++ /dev/null @@ -1,41 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "IpProtocol": "tcp", - "FromPort": "135", - "ToPort": "135", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "1433", - "ToPort": "1433", - "CidrIp": "0.0.0.0/0" - }, - { - "IpProtocol": "udp", - "FromPort": "1434", - "ToPort": "1434", - "CidrIp": "0.0.0.0/0" - }, - { - "IpProtocol": "tcp", - "FromPort": "4022", - "ToPort": "4022", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "49152", - "ToPort": "65535", - "CidrIp": "$cidr" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/SQLCluster.template b/muranorepository/Services/heat_templates/SQLCluster.template deleted file mode 100644 index a55405f..0000000 --- a/muranorepository/Services/heat_templates/SQLCluster.template +++ /dev/null @@ -1,13 +0,0 @@ -{ - "Resources": { - "$instancePort": { - "Properties": { - "allowed_address_pairs": [ - { - "ip_address": "$clusterIp" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/Subnet.template b/muranorepository/Services/heat_templates/Subnet.template deleted file mode 100644 index 460e01e..0000000 --- a/muranorepository/Services/heat_templates/Subnet.template +++ /dev/null @@ -1,20 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - - "Resources": { - "$subnetName": { - "Type": "OS::Neutron::Subnet", - "Properties": { - "network_id": { - "Ref": "$networkRef" - }, - "ip_version": 4, - "dns_nameservers": ["8.8.8.8"], - "cidr": "$cidr" - } - } - }, - - "Outputs": { - } -} diff --git a/muranorepository/Services/heat_templates/TelnetSecurity.template b/muranorepository/Services/heat_templates/TelnetSecurity.template deleted file mode 100644 index 52b82f1..0000000 --- a/muranorepository/Services/heat_templates/TelnetSecurity.template +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "ToPort": "23", - "IpProtocol": "tcp", - "FromPort": "23", - "CidrIp": "0.0.0.0/0" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/TomcatSecurity.template b/muranorepository/Services/heat_templates/TomcatSecurity.template deleted file mode 100644 index a018d49..0000000 --- a/muranorepository/Services/heat_templates/TomcatSecurity.template +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "ToPort": "8080", - "IpProtocol": "tcp", - "FromPort": "8080", - "CidrIp": "0.0.0.0/0" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/WSFCSecurity.template b/muranorepository/Services/heat_templates/WSFCSecurity.template deleted file mode 100644 index 6e1bf19..0000000 --- a/muranorepository/Services/heat_templates/WSFCSecurity.template +++ /dev/null @@ -1,41 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "IpProtocol": "tcp", - "FromPort": "135", - "ToPort": "135", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "137", - "ToPort": "137", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "tcp", - "FromPort": "3343", - "ToPort": "3343", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "3343", - "ToPort": "3343", - "CidrIp": "$cidr" - }, - { - "IpProtocol": "udp", - "FromPort": "49152", - "ToPort": "65535", - "CidrIp": "$cidr" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/WebServerSecurity.template b/muranorepository/Services/heat_templates/WebServerSecurity.template deleted file mode 100644 index 937a240..0000000 --- a/muranorepository/Services/heat_templates/WebServerSecurity.template +++ /dev/null @@ -1,23 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "ToPort": "80", - "IpProtocol": "tcp", - "FromPort": "80", - "CidrIp": "0.0.0.0/0" - }, - { - "ToPort": "443", - "IpProtocol": "tcp", - "FromPort": "443", - "CidrIp": "0.0.0.0/0" - } - ] - } - } - } -} diff --git a/muranorepository/Services/heat_templates/Windows.template b/muranorepository/Services/heat_templates/Windows.template deleted file mode 100644 index b2b0dcb..0000000 --- a/muranorepository/Services/heat_templates/Windows.template +++ /dev/null @@ -1,19 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - - - "Resources": { - "$instanceName": { - "Type": "AWS::EC2::Instance", - "Properties": { - "InstanceType": "$instanceType", - "ImageId": "$imageName", - "AvailabilityZone": "$availabilityZone", - "UserData": "$userData" - } - } - }, - - "Outputs": { - } -} diff --git a/muranorepository/Services/heat_templates/WindowsSecurity.template b/muranorepository/Services/heat_templates/WindowsSecurity.template deleted file mode 100644 index a8d4c5c..0000000 --- a/muranorepository/Services/heat_templates/WindowsSecurity.template +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Resources": { - "$MuranoSecurityGroup-{envName}": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "SecurityGroupIngress": [ - { - "ToPort": "3389", - "IpProtocol": "tcp", - "FromPort": "3389", - "CidrIp": "0.0.0.0/0" - } - ] - } - } - } -} diff --git a/muranorepository/Services/linuxApacheService-manifest.yaml b/muranorepository/Services/linuxApacheService-manifest.yaml deleted file mode 100644 index cdabe72..0000000 --- a/muranorepository/Services/linuxApacheService-manifest.yaml +++ /dev/null @@ -1,42 +0,0 @@ -version: 0.1 -service_display_name: Linux Apache - -description: >- - Linux Apache Service - Demonstrates a simple linux agent, which installs Apache Server - -full_service_name: linuxApacheService -author: Mirantis Inc. -service_version: 1 -enabled: True - -ui: - - LinuxApache.yaml - -workflows: - - Apache.xml - - Networking.xml - -heat: - - Linux.template - - WebServerSecurity.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - DefaultSecurity.template - - WebServerSecurity.template - - LinuxSecurity.template - - Keypair.template - - FloatingIP.template - -agent: - - DeployApache.template - -scripts: - - Linux/common.sh - - Linux/installer.sh - - Linux/runApacheDeploy.sh diff --git a/muranorepository/Services/linuxTelnetService-manifest.yaml b/muranorepository/Services/linuxTelnetService-manifest.yaml deleted file mode 100644 index 04c3a2e..0000000 --- a/muranorepository/Services/linuxTelnetService-manifest.yaml +++ /dev/null @@ -1,41 +0,0 @@ -version: 0.1 -service_display_name: Linux Telnet - -description: >- - Linux Telnet Service - Demonstrates a simple linux agent, which installs Telnet if required. - -full_service_name: linuxTelnetService -author: Mirantis Inc. -service_version: 1 -enabled: True - -ui: - - LinuxTelnet.yaml - -workflows: - - LinuxTelnet.xml - - Networking.xml - -heat: - - Linux.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - DefaultSecurity.template - - LinuxSecurity.template - - TelnetSecurity.template - - Keypair.template - - FloatingIP.template - -agent: - - DeployTelnet.template - -scripts: - - Linux/common.sh - - Linux/installer.sh - - Linux/runTelnetDeploy.sh diff --git a/muranorepository/Services/msSqlClusterServer-manifest.yaml b/muranorepository/Services/msSqlClusterServer-manifest.yaml deleted file mode 100644 index 593f516..0000000 --- a/muranorepository/Services/msSqlClusterServer-manifest.yaml +++ /dev/null @@ -1,58 +0,0 @@ -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 -enabled: True - -ui: - - MsSqlClusterServer.yaml - -workflows: - - MsSqlCluster.xml - - Common.xml - - Networking.xml - -heat: - - Windows.template - - SQLCluster.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - DefaultSecurity.template - - WindowsSecurity.template - - SQL-security.template - - WSFCSecurity.template - - -agent: - - 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 - - SqlServerCluster/SQLServerForAOAG.ps1 - - SqlServerCluster/Failover-Cluster.ps1 - - Start-PowerShellProcess.ps1 - - OptionParser.ps1 - - SQLServer/SQLServerOptionParsers.ps1 - - SQLServer/SQLServerInstaller.ps1 - - Export-Function.ps1 diff --git a/muranorepository/Services/msSqlServer-manifest.yaml b/muranorepository/Services/msSqlServer-manifest.yaml deleted file mode 100644 index 8c39326..0000000 --- a/muranorepository/Services/msSqlServer-manifest.yaml +++ /dev/null @@ -1,48 +0,0 @@ -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 -enabled: True - -ui: - - MsSqlServer.yaml - -workflows: - - MsSqlServer.xml - - Common.xml - - Networking.xml - -heat: - - Windows.template - - SQL-security.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - DefaultSecurity.template - - WindowsSecurity.template - - SQL-security.template - - FloatingIP.template - - -agent: - - SetPassword.template - - InstallMsSqlServer.template - -scripts: - - ImportCoreFunctions.ps1 - - Set-LocalUserPassword.ps1 - - OptionParser.ps1 - - SQLServer/SQLServerOptionParsers.ps1 - - SQLServer/SQLServerInstaller.ps1 - - SQLServer/Install-SQLServer.ps1 - - Alter-FirewallRulesForSQL.ps1 diff --git a/muranorepository/Services/postgreSql-manifest.yaml b/muranorepository/Services/postgreSql-manifest.yaml deleted file mode 100644 index 5f0250f..0000000 --- a/muranorepository/Services/postgreSql-manifest.yaml +++ /dev/null @@ -1,49 +0,0 @@ -version: 0.1 -service_display_name: PostgreSQL - -description: >- - PostgreSQL database - -full_service_name: postgreSql -author: Mirantis Inc. -service_version: 1 -enabled: True - -ui: - - PostgreSql.yaml - -workflows: - - PostgreSql.xml - - Networking.xml - -heat: - - Linux.template - - LinuxSecurity.template - - PostgreSqlSecurity.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - DefaultSecurity.template - - Keypair.template - - LoadBalancer.template - - FloatingIP.template - - FloatingIPwithLB.template - -agent: - - DeployPostgreSql.template - - ConfigurePostgreSqlDatabase.template - - ConfigureAccessToPostgreSql.template - - GetIP.template - - -scripts: - - Linux/common.sh - - Linux/installer.sh - - Linux/deployPostgreSql.sh - - Linux/configurePostgreSqlDatabase.sh - - Linux/configureAccessToPostgreSql.sh - - Linux/getIp.sh diff --git a/muranorepository/Services/scripts/Alter-FirewallRulesForSQL.ps1 b/muranorepository/Services/scripts/Alter-FirewallRulesForSQL.ps1 deleted file mode 100644 index 2e2594f..0000000 --- a/muranorepository/Services/scripts/Alter-FirewallRulesForSQL.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -trap { - &$TrapHandler -} - - -$FW_Rules = @{ - "SQL Server Data Connection" = "1433"; - "SQL Admin Connection" = "1434"; - "SQL Service Broker" = "4022"; - "SQL Debugger/RPC"="135"; -} - - -$FW_Proto = "TCP" - - -function Add-NetshFirewallRule { - param ( - [HashTable] $hshRules, - [String] $proto - ) - - - foreach ($h in $hshRules.GetEnumerator()) { - try { - $command="advfirewall firewall add rule name=`"$($h.Name)`" dir=in action=allow protocol=$proto localport=$($h.Value)" - Start-Process -FilePath netsh -ArgumentList $command -Wait - } - catch { - $except= $_ | Out-String - Write-LogError "Add rule $($h.Name) FAILS with $except" - } - } -} - -function Remove-NetShFirewallRule { - param ( - [HashTable] $hshRules - ) - - foreach ($h in $hshRules.GetEnumerator()) { - try { - $command="advfirewall firewall delete rule name=`"$($h.Name)`"" - Start-Process -FilePath netsh -ArgumentList $command -Wait - } - catch { - $except= $_ | Out-String - Write-LogError "Delete rule $($h.Name) FAILS with $except" - } - } -} - - -function Enable-SQLExternalAccess { - Add-NetshFirewallRule $FW_Rules $FW_Proto -} - - -function Disable-SQLExternalAccess { - Remove-NetshFirewallRule $FW_Rules $FW_Proto -} diff --git a/muranorepository/Services/scripts/CopyPrerequisites.ps1 b/muranorepository/Services/scripts/CopyPrerequisites.ps1 deleted file mode 100644 index 5e939c4..0000000 --- a/muranorepository/Services/scripts/CopyPrerequisites.ps1 +++ /dev/null @@ -1,50 +0,0 @@ - -trap { - &$TrapHandler -} - - -Function Copy-Prerequisites { - param ( - [String] $Path = '', - [String] $Destination = '' - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - Write-Log "--> Copy-Prerequisites" - - if ($Destination -eq '') { - throw("Copy-Prerequisites: Destination path not specified!") - } - - if ($Path -eq '') { - $Path = [Environment]::GetEnvironmentVariable('MuranoFileShare') - if ($Path -eq $null) { - throw("Copy-Prerequisites: Unable to determine source path for prerequisites.") - } - } - - Write-Log "Creating new PSDrive ..." - New-PSDrive -Name 'P' -PSProvider 'FileSystem' -Root $Path | Out-Null - - Write-Log "Creating destination folder ..." - New-Item -Path $Destination -ItemType Container -Force | Out-Null - - Write-Log "Copying items ..." - Copy-Item -Path 'P:\Prerequisites\IIS' -Destination $Destination -Recurse -Force | Out-Null - - Write-Log "Removing PSDrive ..." - Remove-PSDrive -Name 'P' -PSProvider 'FileSystem' -Force | Out-Null - - Write-Log "<-- Copy-Prerequisites" - } -} diff --git a/muranorepository/Services/scripts/DeployWebApp.ps1 b/muranorepository/Services/scripts/DeployWebApp.ps1 deleted file mode 100644 index 5dd90f4..0000000 --- a/muranorepository/Services/scripts/DeployWebApp.ps1 +++ /dev/null @@ -1,152 +0,0 @@ - -trap { - &$TrapHandler -} - - -Function Register-WebApp { -<# -.LINKS - -http://www.iis.net/learn/manage/powershell/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-application-pools -#> - param ( - [String] $Source, - [String] $Path = "C:\inetpub\wwwroot", - [String] $Name = "", - [String] $Username = "", - [String] $Password = "" - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - Import-Module WebAdministration - - if ($Name -eq "") { - $Name = @([IO.Path]::GetDirectoryName($Source) -split '\\')[-1] - if ($Name -eq "wwwroot") { - throw("Application pool name couldn't be 'wwwroot'.") - } - } - else { - $Path = [IO.Path]::Combine($Path, $Name) - } - - $null = Copy-Item -Path $Source -Destination $Path -Recurse -Force - - # Create new application pool - $AppPool = New-WebAppPool -Name $Name -Force - #$AppPool = Get-Item "IIS:\AppPools\$Name" - $AppPool.managedRuntimeVersion = 'v4.0' - $AppPool.managedPipelineMode = 'Classic' - $AppPool.processModel.loadUserProfile = $true - $AppPool.processModel.logonType = 'LogonBatch' - - #Set Identity type - if ($Username -eq "") { - $AppPool.processModel.identityType = 'ApplicationPoolIdentity' - } - else { - $AppPool.processModel.identityType = 'SpecificUser' - $AppPool.processModel.userName = $Username - $AppPool.processModel.password = $Password - $null = $AppPool | Set-Item - } - - - # Create Website - $WebSite = New-WebSite -Name $Name -Port 80 -HostHeader $Name -PhysicalPath $Path -Force - #$WebSite = Get-Item "IIS:\Sites\$Name" - - # Set the Application Pool - $null = Set-ItemProperty "IIS:\Sites\$Name" 'ApplicationPool' $Name - - #Turn on Directory Browsing - #Set-WebConfigurationProperty -Filter '/system.webServer/directoryBrowse' -Name 'enabled' -Value $true -PSPath "IIS:\Sites\$Name" - - # Update Authentication - #Set-WebConfigurationProperty -Filter '/system.WebServer/security/authentication/AnonymousAuthentication' -Name 'enabled' -Value $true -Location $name - #Set-WebConfigurationProperty -Filter '/system.WebServer/security/authentication/windowsAuthentication' -Name 'enabled' -Value $false -Location $Name - #Set-WebConfigurationProperty -Filter '/system.WebServer/security/authentication/basicAuthentication' -Name 'enabled' -Value $false -Location $Name - - $null = $WebSite.Start() - - $null = Add-Content -Path "C:\Windows\System32\Drivers\etc\hosts" -Value "127.0.0.1 $Name" - - # Remove standard IIS 'Hello World' application from localhost:80 - $null = Get-WebBinding 'Default Web Site' | Remove-WebBinding - # Add new application on http://localhost:80 - $null = New-WebBinding -Name "$Name" -IP "*" -Port 80 -Protocol http - } -} - - - -Function Deploy-WebAppFromGit { - param ( - [String] $URL, - [String] $TempPath = [IO.Path]::Combine([IO.Path]::GetTempPath(), [IO.Path]::GetRandomFileName()), - [String] $OutputPath = [IO.Path]::Combine([IO.Path]::GetTempPath(), [IO.Path]::GetRandomFileName()) - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - Write-Log "TempPath = '$TempPath'" - Write-Log "OutputPath = '$OutputPath'" - - - # Fetch web application - #---------------------- - Write-Log "Fetching sources from Git ..." - - $null = New-Item -Path $TempPath -ItemType Container - $null = Exec -FilePath 'git.exe' -ArgumentList @('clone', $URL) -WorkingDir $TempPath -RedirectStreams - - $Path = @(Get-ChildItem $TempPath)[0].FullName - #---------------------- - - - # Build web application - #---------------------- - Write-Log "Building sources ..." - - $msbuild = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe" - - $null = New-Item -Path $OutputPath -ItemType Container - - $SlnFiles = @(Get-ChildItem -Path $Path -Filter *.sln -Recurse) - - # Start new processs with additional env variables: - #* VisualStudioVersion = "10.0" - #* EnableNuGetPackageRestore = "true" - $null = Exec -FilePath $msbuild ` - -ArgumentList @($SlnFiles[0].FullName, "/p:OutputPath=$OutputPath") ` - -Environment @{'VisualStudioVersion' = '10.0'; 'EnableNuGetPackageRestore' = 'true'} ` - -RedirectStreams - - $AppFolder = @(Get-ChildItem ([IO.Path]::Combine($OutputPath, '_PublishedWebsites')))[0] - #---------------------- - - - # Install web application - #------------------------ - $null = Register-WebApp -Source $AppFolder.FullName -Name $AppFolder.Name - #------------------------ - } -} diff --git a/muranorepository/Services/scripts/Export-Function.ps1 b/muranorepository/Services/scripts/Export-Function.ps1 deleted file mode 100644 index 8cd1b57..0000000 --- a/muranorepository/Services/scripts/Export-Function.ps1 +++ /dev/null @@ -1,61 +0,0 @@ - -trap { - &$TrapHandler -} - -function Export-Function { - param ( - [String[]] $Name, - - [Parameter(ValueFromPipeline=$true)] - [String] $Path = [IO.Path]::GetTempFileName(), - - [Switch] $All - ) - - if ([IO.Path]::GetExtension($Path) -ne 'ps1') { - $null = Rename-Item -Path $Path -NewName "$Path.ps1" -Force - $Path = "$Path.ps1" - } - - $SystemFunctions = @( - 'A:', 'B:', 'C:', 'D:', 'E:', 'F:', 'G:', 'H:', 'I:', 'J:', - 'K:', 'L:', 'M:', 'N:', 'O:', 'P:', 'Q:', 'R:', 'S:', 'T:', - 'U:', 'V:', 'W:', 'X:', 'Y:', 'Z:', - 'cd..', 'cd\', 'help', 'mkdir', 'more', 'oss', 'prompt', - 'Clear-Host', 'Get-Verb', 'Pause', 'TabExpansion2' - ) - - if ($All) { - Get-ChildItem Function: | - Where-Object {$_.ModuleName -eq ''} | - Where-Object {$SystemFunctions -notcontains $_.Name} | - ForEach-Object { - Add-Content -Path $Path -Value @" - - -function $($_.Name) { -$($_.ScriptBlock) -} - -"@ - } - } - else { - foreach ($FunctionName in $Name) { - $FunctionObject = Get-ChildItem "Function:\$FunctionName" - if ($FunctionObject -ne $null) { - Add-Content -Path $Path -Value @" - - -function $FunctionName { -$($FunctionObject.ScriptBlock) -} - -"@ - } - } - } - - return $Path -} diff --git a/muranorepository/Services/scripts/Get-DnsListeningIpAddress.ps1 b/muranorepository/Services/scripts/Get-DnsListeningIpAddress.ps1 deleted file mode 100644 index 1db0b85..0000000 --- a/muranorepository/Services/scripts/Get-DnsListeningIpAddress.ps1 +++ /dev/null @@ -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}" } -} diff --git a/muranorepository/Services/scripts/ImportCoreFunctions.ps1 b/muranorepository/Services/scripts/ImportCoreFunctions.ps1 deleted file mode 100644 index 85e6434..0000000 --- a/muranorepository/Services/scripts/ImportCoreFunctions.ps1 +++ /dev/null @@ -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 "" - } - else { - Write-LogDebug "" - Write-LogDebug "" - 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 "" - } -} - - -$TrapHandler = { - Write-LogError "" - Write-LogError $_ -EntireObject - Write-LogError "" - 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 - } -} -#> diff --git a/muranorepository/Services/scripts/Install-RolePrimaryDomainController.ps1 b/muranorepository/Services/scripts/Install-RolePrimaryDomainController.ps1 deleted file mode 100644 index e8f1e5a..0000000 --- a/muranorepository/Services/scripts/Install-RolePrimaryDomainController.ps1 +++ /dev/null @@ -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 - } -} diff --git a/muranorepository/Services/scripts/Install-RoleSecondaryDomainController.ps1 b/muranorepository/Services/scripts/Install-RoleSecondaryDomainController.ps1 deleted file mode 100644 index be9258e..0000000 --- a/muranorepository/Services/scripts/Install-RoleSecondaryDomainController.ps1 +++ /dev/null @@ -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 - } -} diff --git a/muranorepository/Services/scripts/InstallIIS.ps1 b/muranorepository/Services/scripts/InstallIIS.ps1 deleted file mode 100644 index 57e7dc4..0000000 --- a/muranorepository/Services/scripts/InstallIIS.ps1 +++ /dev/null @@ -1,72 +0,0 @@ - -trap { - &$TrapHandler -} - - -Function Install-WebServer { - param ( - [String] $PrerequisitesPath - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - Write-Log "--> Install-WebServer" - - $FeatureList = @( - 'Web-Server', - 'Web-Net-Ext45', - 'Web-ASP', - 'Web-Asp-Net45', - 'Web-ISAPI-Ext', - 'Web-ISAPI-Filter', - 'Web-Includes' - ) - - $PrerequisitesList = @( - 'AspNetMvc4Setup.exe', - 'WebApplications.exe' - ) - - $PrerequisitesPath = [IO.Path]::Combine($PrerequisitesPath, 'IIS') - - Write-Log "Validating prerequisites based on the list ..." - foreach ($FileName in $PrerequisitesList) { - $FilePath = [IO.Path]::Combine($PrerequisitesPath, $FileName) - if (-not (Test-Path -Path $FilePath -PathType Leaf)) { - throw("Prerequisite file not found: '$FilePath'") - } - } - - Import-Module ServerManager - - Write-Log "Installing Web Server ..." - Install-WindowsFeature $FeatureList -IncludeManagementTools - - Write-Log "Installing AspNetMvp4 ..." - $Exec = Exec -FilePath $([IO.Path]::Combine($PrerequisitesPath, 'AspNetMvc4Setup.exe')) -ArgumentList '/q' -PassThru - if ($Exec.ExitCode -ne 0) { - throw("Installation of 'AspNetMvc4Setup.exe' failed. Process exit code '$($Exec.ExitCode)'") - } - - # Extract WebApplications folder with *.target files to - # C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0 - Write-Log "Installing WebApplication targets ..." - $WebApplicationsTargetsRoot = 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0' - $null = New-Item -Path $WebApplicationsTargetsRoot -ItemType Container - $Exec = Exec -FilePath $([IO.Path]::Combine($PrerequisitesPath, 'WebApplications.exe')) -ArgumentList @("-o`"$WebApplicationsTargetsRoot`"", '-y') -PassThru - if ($Exec.ExitCode -ne 0) { - throw("Installation of 'WebApplications.exe' failed. Process exit code '$($Exec.ExitCode)'") - } - - Write-Log "<-- Install-WebServer" - } -} diff --git a/muranorepository/Services/scripts/Join-Domain.ps1 b/muranorepository/Services/scripts/Join-Domain.ps1 deleted file mode 100644 index 4716709..0000000 --- a/muranorepository/Services/scripts/Join-Domain.ps1 +++ /dev/null @@ -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." - } - #> - } - } -} diff --git a/muranorepository/Services/scripts/Linux/common.sh b/muranorepository/Services/scripts/Linux/common.sh deleted file mode 100644 index 8afef14..0000000 --- a/muranorepository/Services/scripts/Linux/common.sh +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/bash -# -DEBUGLVL=3 -LOGFILE=/tmp/muranodeployment.log -PIPAPPS="pip python-pip pip-python" -PIPCMD="" -if [ "$DEBUGLVL" -eq 4 ]; then - set -x -fi -function log { - if [ "$DEBUGLVL" -gt 0 ]; then - chars=$(echo "@$" | wc -c) - case $DEBUGLVL in - 1 ) - echo -e "LOG:>$@" - ;; - 2) - echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" | tee --append $LOGFILE - ;; - 3) - echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" >> $LOGFILE - ;; - 4) - echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" | tee --append $LOGFILE - ;; - esac - fi -} -function lowercase(){ - echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" -} -function find_pip() -{ - for cmd in $PIPAPPS - do - _cmd=$(which $cmd 2>/dev/null) - if [ $? -eq 0 ];then - break - fi - done - if [ -z $_cmd ];then - echo "Can't find \"pip\" in system, please install it first, exiting!" - exit 1 - else - PIPCMD=$_cmd - fi -} -OPTIND=1 # Reset if getopts used previously -function collect_args(){ - _n=$1 - shift - ARGS='' - while true - do - if [[ "$_n" == -* ]] || [ -z "$_n" ]; then - OPTIND=$((OPTIND - 1)) - break - fi - #echo "_n=$_n ; $OPTIND" - if [ -z "$ARGS" ]; then - ARGS=$OPTARG - else - ARGS="$ARGS $_n" - fi - eval _n=\$$OPTIND - OPTIND=$((OPTIND + 1)) - #sleep 1 - done - echo $ARGS - unset _n - unset ARGS -} -function get_os(){ - KERNEL=$(uname -r) - MACH=$(uname -m) - OS=$(uname) - if [ "${OS}" = "Linux" ] ; then - if [ -f /etc/redhat-release ] ; then - DistroBasedOn='RedHat' - Packager='yum' - DIST=$(cat /etc/redhat-release |sed s/\ release.*//) - PSUEDONAME=$(cat /etc/redhat-release | sed s/.*\(// | sed s/\)//) - REV=$(cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//) - elif [ -f /etc/SuSE-release ] ; then - DistroBasedOn='SuSe' - Packager='zypper' - PSUEDONAME=$(cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//) - REV=$(cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //) - elif [ -f /etc/mandrake-release ] ; then - DistroBasedOn='Mandrake' - Packager='urpmi urpme' - PSUEDONAME=$(cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//) - REV=$(cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//) - elif [ -f /etc/debian_version ] ; then - DistroBasedOn='Debian' - Packager='apt-get' - DIST=$(cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }') - PSUEDONAME=$(cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }') - REV=$(cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }') - fi - if [ -f /etc/UnitedLinux-release ] ; then - DIST="${DIST}[$(cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//)]" - fi - OS=$(lowercase $OS) - DistroBasedOn=$(lowercase $DistroBasedOn) - readonly OS - readonly DIST - readonly DistroBasedOn - readonly PSUEDONAME - readonly REV - readonly KERNEL - readonly MACH - #readonly Packager - else - OS=unknown - readonly OS - log "OS:$OS" - exit 1 - fi -} -function add_fw_rule(){ - _rule_string=$@ - _tmp_fw_port=$(echo $_rule_string | grep -o -e "dport [0-9]*\s") - _tmp_fw_proto=$(echo $_rule_string | grep -o -e "-p \w*\s") - _fw_port=$(echo $_tmp_fw_port | awk '{print $2}') - _fw_proto=$(echo $_tmp_fw_proto |awk '{print $2}') - _fw_reload="" - #find iptables and add rule - case $DIST in - "Fedora") - _fw_cmd=$(which firewall-cmd) - _fw_port=$(echo $_rule_string | grep -o -e "dport [0-9]*\s" | awk '{print $2}') - _fw_proto=$(echo $_rule_string | grep -o -e "-p \w*\s" | awk '{print $2}') - _fw_rule="--permanent --add-port=$_fw_port/$_fw_proto" - _fw_enable_rules="$_fw_cmd --reload" - ;; - *) - _fw_cmd=$(which iptables) - _fw_rule=$_rule_string - _fw_enable_rules="service $(basename $_fw_cmd) save" - ;; - esac - iptcmdsave=$(which iptables-save) - if [[ "$_fw_cmd" != '' ]] && [[ "$iptcmdsave" != '' ]]; then - eval "$iptcmdsave | grep -e \"$_tmp_fw_port\" | grep -e \"$_tmp_fw_proto\"" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - eval $_fw_cmd $_fw_rule - if [ $? -ne 0 ]; then - log "Can't set firewall rules, exiting..." - exit 1 - else - if [ -n "$_fw_enable_rules" ]; then - log "Running \"$_fw_enable_rules\"" - $_fw_enable_rules > /dev/null - fi - log "$_fw_cmd rule with $_fw_rule set." - fi - else - log "$_fw_cmd rule exists." - fi - else - log "There are no fw found..." - fi -} -function enable_init(){ - _initctrl="" - _init_suffix="" - _service=$1 - case $DistroBasedOn in - "debian") - _initctrl="update-rc.d" - _init_suffix="defaults" - ;; - *) - _initctrl="chkconfig" - _init_suffix="on" - ;; - esac - $_initctrl $_service $_init_suffix - if [ $? -ne 0 ]; then - log "$_initctrl $_service $_init_suffix - fails!" - exit 1 - fi -} -function restart_service(){ - _service=$1 - service $_service restart > /dev/null 2>&1 - if [ $? -ne 0 ]; then - log "Can't start $_service service!" - exit 1 - fi -} -function package_renamer(){ - _pkg=$1 - case $DistroBasedOn in - "debian") - _pkg=$(echo $_pkg | sed 's/-devel$/-dev/') - ;; - *) - _pkg=$(echo $_pkg | sed 's/-dev$/-devel/') - ;; - esac - echo $_pkg -} \ No newline at end of file diff --git a/muranorepository/Services/scripts/Linux/configureAccessToPostgreSql.sh b/muranorepository/Services/scripts/Linux/configureAccessToPostgreSql.sh deleted file mode 100644 index 878bdf9..0000000 --- a/muranorepository/Services/scripts/Linux/configureAccessToPostgreSql.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -function include(){ - curr_dir=$(cd $(dirname "$0") && pwd) - inc_file_path=$curr_dir/$1 - if [ -f "$inc_file_path" ]; then - . $inc_file_path - else - echo -e "$inc_file_path not found!" - exit 1 - fi -} -include "common.sh" - -get_os -[[ $? -ne 0 ]] && exit 1 -if [[ "$DistroBasedOn" != "redhat" ]]; then - DEBUGLVL=4 - log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!" - exit 1 -fi - -sed -e "s/YOURUSERNAMEHERE/$2/" -i /usr/share/tomcat/webapps/app/META-INF/context.xml -sed -e "s/YOURPASSWORDHERE/$3/" -i /usr/share/tomcat/webapps/app/META-INF/context.xml -sed -e "s/YOURHOSTHERE/$4/" -i /usr/share/tomcat/webapps/app/META-INF/context.xml -sed -e "s/YOURDATABASEHERE/$1/" -i /usr/share/tomcat/webapps/app/META-INF/context.xml diff --git a/muranorepository/Services/scripts/Linux/configurePostgreSqlDatabase.sh b/muranorepository/Services/scripts/Linux/configurePostgreSqlDatabase.sh deleted file mode 100644 index d6e095b..0000000 --- a/muranorepository/Services/scripts/Linux/configurePostgreSqlDatabase.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -function include(){ - curr_dir=$(cd $(dirname "$0") && pwd) - inc_file_path=$curr_dir/$1 - if [ -f "$inc_file_path" ]; then - . $inc_file_path - else - echo -e "$inc_file_path not found!" - exit 1 - fi -} -include "common.sh" - -get_os -[[ $? -ne 0 ]] && exit 1 -if [[ "$DistroBasedOn" != "redhat" ]]; then - DEBUGLVL=4 - log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!" - exit 1 -fi - -su -c "psql -d postgres -c \"CREATE DATABASE $1\"" -s /bin/sh postgres -su -c "psql -d postgres -c \"CREATE USER $2 WITH PASSWORD '$3'\"" -s /bin/sh postgres -su -c "psql -d postgres -c \"GRANT ALL PRIVILEGES ON DATABASE $1 to $2;\"" -s /bin/sh postgres -echo "host $1 $2 all md5" >> /var/lib/pgsql/data/pg_hba.conf - -systemctl restart postgresql.service diff --git a/muranorepository/Services/scripts/Linux/deployPostgreSql.sh b/muranorepository/Services/scripts/Linux/deployPostgreSql.sh deleted file mode 100644 index 6d8d44c..0000000 --- a/muranorepository/Services/scripts/Linux/deployPostgreSql.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -function include(){ - curr_dir=$(cd $(dirname "$0") && pwd) - inc_file_path=$curr_dir/$1 - if [ -f "$inc_file_path" ]; then - . $inc_file_path - else - echo -e "$inc_file_path not found!" - exit 1 - fi -} -include "common.sh" - -get_os -[[ $? -ne 0 ]] && exit 1 -if [[ "$DistroBasedOn" != "redhat" ]]; then - DEBUGLVL=4 - log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!" - exit 1 -fi - -bash installer.sh -p sys -i "postgresql-server postgresql-contrib" - -postgresql-setup initdb - -sed -e "s/^#listen_addresses =.*$/listen_addresses = \'*\'/" -i /var/lib/pgsql/data/postgresql.conf -add_fw_rule '-I INPUT 1 -p tcp -m tcp --dport 5432 -j ACCEPT -m comment --comment "by murano, PostgreSQL"' - -systemctl enable postgresql.service -systemctl start postgresql.service diff --git a/muranorepository/Services/scripts/Linux/deployTomcat.sh b/muranorepository/Services/scripts/Linux/deployTomcat.sh deleted file mode 100644 index bbcf2ba..0000000 --- a/muranorepository/Services/scripts/Linux/deployTomcat.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -function include(){ - curr_dir=$(cd $(dirname "$0") && pwd) - inc_file_path=$curr_dir/$1 - if [ -f "$inc_file_path" ]; then - . $inc_file_path - else - echo -e "$inc_file_path not found!" - exit 1 - fi -} -include "common.sh" - -get_os -[[ $? -ne 0 ]] && exit 1 -if [[ "$DistroBasedOn" != "redhat" ]]; then - DEBUGLVL=4 - log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!" - exit 1 -fi - -bash installer.sh -p sys -i "tomcat tomcat-webapps tomcat-admin-webapps" - -add_fw_rule '-I INPUT 1 -p tcp -m tcp --dport 8080 -j ACCEPT -m comment --comment "by murano, Tomcat"' - -systemctl enable tomcat.service -systemctl start tomcat.service - diff --git a/muranorepository/Services/scripts/Linux/deployTomcatApp.sh b/muranorepository/Services/scripts/Linux/deployTomcatApp.sh deleted file mode 100644 index 9ce237e..0000000 --- a/muranorepository/Services/scripts/Linux/deployTomcatApp.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -function include(){ - curr_dir=$(cd $(dirname "$0") && pwd) - inc_file_path=$curr_dir/$1 - if [ -f "$inc_file_path" ]; then - . $inc_file_path - else - echo -e "$inc_file_path not found!" - exit 1 - fi -} -include "common.sh" - -get_os -[[ $? -ne 0 ]] && exit 1 -if [[ "$DistroBasedOn" != "redhat" ]]; then - DEBUGLVL=4 - log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!" - exit 1 -fi - -bash installer.sh -p sys -i "java-devel" - -cd /usr/share/tomcat/webapps -git clone $1 app -cd app/WEB-INF/classes -for f in $(find . -name "*.java"); do - javac -cp /usr/share/tomcat/lib/tomcat-servlet-3.0-api.jar "$f" -done diff --git a/muranorepository/Services/scripts/Linux/getIp.sh b/muranorepository/Services/scripts/Linux/getIp.sh deleted file mode 100644 index f7113c6..0000000 --- a/muranorepository/Services/scripts/Linux/getIp.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -curl -s http://169.254.169.254/latest/meta-data/local-ipv4 diff --git a/muranorepository/Services/scripts/Linux/installer.sh b/muranorepository/Services/scripts/Linux/installer.sh deleted file mode 100644 index 9d4baa5..0000000 --- a/muranorepository/Services/scripts/Linux/installer.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/bash -# -INSTALLER_OPTS="" -UNINSTALLER_OPTS="" -PMGR="" -PMGR_LIST_OPTS="" - -function include(){ - curr_dir=$(cd $(dirname "$0") && pwd) - inc_file_path=$curr_dir/$1 - if [ -f "$inc_file_path" ]; then - . $inc_file_path - else - exit 1 - fi -} -function set_install_options(){ - case $1 in - apt-get ) - INSTALLER_OPTS="-y -q install" - UNINSTALLER_OPTS="-y -q remove" - PMGR="dpkg" - PMGR_LIST_OPTS="-s" - ;; - yum ) - INSTALLER_OPTS="--assumeyes install" - UNINSTALLER_OPTS="--assumeyes erase" - PMGR="rpm" - PMGR_LIST_OPTS="-q" - ;; - urpm* ) - INSTALLER_OPTS="-y" - UNINSTALLER_OPTS="" - PMGR="rpm" - PMGR_LIST_OPTS="-q" - ;; - zypper ) - INSTALLER_OPTS="install" - UNINSTALLER_OPTS="remove --quiet" - PMGR="rpm" - PMGR_LIST_OPTS="-q" - ;; - pip ) - INSTALLER_OPTS="install" - UNINSTALLER_OPTS="uninstall --yes" - find_pip - PACKAGER=$PIPCMD - PMGR=$PIPCMD - PMGR_LIST_OPTS="freeze | grep" - ;; - * ) - exit 1 - ;; - esac - PACKAGER=$(which $1) - if [ $? -ne 0 ]; then - log "Can't find \"$1\", exiting!" - exit 1 - fi -} -function package_install(){ - PKG=$1 - eval "$PMGR $PMGR_LIST_OPTS $PKG" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - log "\"$PKG\" already installed" - else - log "Installing \"$PKG\" ..." - $PACKAGER $INSTALLER_OPTS $PKG > /dev/null 2>&1 - if [ $? -ne 0 ]; then - log "\"$PKG\" installation fails, exiting!" - exit 1 - else - log "\t\t...success" - fi - fi -} -function package_uninstall(){ - PKG=$1 - eval "$PMGR $PMGR_LIST_OPTS $PKG" > /dev/null 2>&1 - if [ $? -eq 1 ]; then - log "\"$PKG\" not installed" - else - log "Unnstalling \"$PKG\" ..." - $PACKAGER $UNINSTALLER_OPTS $PKG > /dev/null 2>&1 - if [ $? -ne 0 ]; then - log "\"$PKG\" uninstallation fails, exiting!" - exit 1 - else - log "\t\t...success" - fi - fi -} -function run_install(){ - for PKG in $@ - do - package_install $PKG - done -} -function run_uninstall(){ - for PKG in $@ - do - package_uninstall $PKG - done -} -# Main workflow -include "common.sh" -if [ $# -eq 0 ]; then - script=$(basename $0) - echo -e "Usage:\n\t* install packages -- ./$script -p package_manager -i package0 [packageN]\n\t* remove packages -- ./$script -p package_manager -r package0 [packageN]" - exit 1 -fi -Packager='' -get_os -if [ $? -ne 0 ]; then - log "Unsupported *nix version ($DistroBasedOn - $DIST/$PSUEDONAME/$REV/$MACH)" - exit 1 -fi -while getopts ":p:i:r:" opt ; do - case "$opt" in - p) - if [[ "$OPTARG" != sys ]]; then - Packager=$OPTARG - fi - set_install_options $Packager - ;; - i) - n=$OPTARG - run_install $(collect_args $n $@) - break; - ;; - r) - n=$OPTARG - run_uninstall $(collect_args $n $@) - break; - ;; - \?) - log "Invalid option: -$OPTARG" >&2 - exit 1 - ;; - esac -done -shift $((OPTIND-1)) \ No newline at end of file diff --git a/muranorepository/Services/scripts/Linux/runApacheDeploy.sh b/muranorepository/Services/scripts/Linux/runApacheDeploy.sh deleted file mode 100644 index 0ae1036..0000000 --- a/muranorepository/Services/scripts/Linux/runApacheDeploy.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# -function include(){ - curr_dir=$(cd $(dirname "$0") && pwd) - inc_file_path=$curr_dir/$1 - if [ -f "$inc_file_path" ]; then - . $inc_file_path - else - echo -e "$inc_file_path not found!" - exit 1 - fi -} -include "common.sh" -# FirewallRules -FW_RULE1='-I INPUT 1 -p tcp -m tcp --dport 443 -j ACCEPT -m comment --comment "by murano, Apache server access on HTTPS port 443"' -FW_RULE2='-I INPUT 1 -p tcp -m tcp --dport 80 -j ACCEPT -m comment --comment "by murano, Apache server access on HTTP port 80"' -APP='' -get_os -[[ $? -ne 0 ]] && exit 1 -case $DistroBasedOn in - "debian") - APP="apache2" - ;; - "redhat") - APP="httpd" - ;; -esac -_php="" -if [[ "$1" == "True" ]]; then - _php="php" -fi -APPS_TO_INSTALL="$APP $_php $FW_BOOT_PKG" -bash installer.sh -p sys -i $APPS_TO_INSTALL -enable_init $APP -service $APP start > /dev/null 2>&1 -add_fw_rule $FW_RULE1 -add_fw_rule $FW_RULE2 diff --git a/muranorepository/Services/scripts/Linux/runTelnetDeploy.sh b/muranorepository/Services/scripts/Linux/runTelnetDeploy.sh deleted file mode 100644 index 6013c3c..0000000 --- a/muranorepository/Services/scripts/Linux/runTelnetDeploy.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -function include(){ - curr_dir=$(cd $(dirname "$0") && pwd) - inc_file_path=$curr_dir/$1 - if [ -f "$inc_file_path" ]; then - . $inc_file_path - else - echo -e "$inc_file_path not found!" - exit 1 - fi -} -include "common.sh" -# FirewallRules -FW_RULE1='-I INPUT 1 -p tcp -m tcp --dport 23 -j ACCEPT -m comment --comment "by murano, Telnet server access on port 23"' -APP='' -XINIT_CFG=0 -get_os -[[ $? -ne 0 ]] && exit 1 -case $DistroBasedOn in - "debian") - APP="telnetd" - ;; - "redhat") - APP="telnet-server" - XINIT_CFG=1 - ;; -esac -APPS_TO_INSTALL="$APP" -bash installer.sh -p sys -i $APPS_TO_INSTALL -if [ $XINIT_CFG -gt 0 ]; then - xinetd_tlnt_cfg="/etc/xinetd.d/telnet" - if [ -f "$xinetd_tlnt_cfg" ]; then - sed -i '/disable.*=/ s/yes/no/' $xinetd_tlnt_cfg - if [ $? -ne 0 ]; then - log "can't modify $xinetd_tlnt_cfg" - exit 1 - fi - else - log "$APP startup config not found under $xinetd_tlnt_cfg" - fi -#security tty for telnet - setty=/etc/securetty - lines=$(sed -ne '/^pts\/[0-9]/,/^pts\/[0-9]/ =' $setty) - if [ -z "$lines" ]; then - cat >> $setty << "EOF" -pts/0 -pts/1 -pts/2 -pts/3 -pts/4 -pts/5 -pts/6 -pts/7 -pts/8 -pts/9 -EOF - if [ $? -ne 0 ]; then - log "Error occured during $setty changing..." - exit 1 - fi - else - echo "$setty has pts/0-9 options..." - fi - restart_service xinetd -fi -add_fw_rule $FW_RULE1 diff --git a/muranorepository/Services/scripts/New-SqlServerSystemAccount.ps1 b/muranorepository/Services/scripts/New-SqlServerSystemAccount.ps1 deleted file mode 100644 index a3b306b..0000000 --- a/muranorepository/Services/scripts/New-SqlServerSystemAccount.ps1 +++ /dev/null @@ -1,64 +0,0 @@ - -trap { - &$TrapHandler -} - - - -function New-SqlServerSystemAccount { - param ( - # (REQUIRED) Domain Name - [Parameter(Mandatory=$true)] - [String] $DomainName, - - # (REQUIRED) User name who has permissions to create and modify userPassword - # Usually this is the domain administrator '$domainName\Administrator' account - [Parameter(Mandatory=$true)] - [String] $UserName, - - # (REQUIRED) Password for that user - [Parameter(Mandatory=$true)] - [String] $UserPassword, - - # (REQUIRED) User name for a new account that will be used to run SQL Server - [Parameter(Mandatory=$true)] - [String] $SQLServiceUserName, - - # (REQUIRED) Password for that user - [Parameter(Mandatory=$true)] - [String] $SQLServiceUserPassword, - - [String] $PrimaryNode = ' ' - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - if ($PrimaryNode.ToLower() -ne ($Env:ComputerName).ToLower()) { - Write-Log "THis function runs on AOAG primary node only." - Write-Log "Exiting." - return - } - - Write-Log "Installing 'RSAT-AD-PowerShell' ... " - Add-WindowsFeature RSAT-AD-PowerShell - - Import-Module ActiveDirectory - - $Creds = New-Credential -UserName "$DomainName\$UserName" -Password "$UserPassword" - - Write-Log "Adding new user ..." - $null = New-ADUser ` - -Name $SQLServiceUserName ` - -AccountPassword $(ConvertTo-SecureString -String $SQLServiceUserPassword -AsPlainText -Force) ` - -Credential $Creds ` - -ErrorAction 'Stop' - } -} diff --git a/muranorepository/Services/scripts/OptionParser.ps1 b/muranorepository/Services/scripts/OptionParser.ps1 deleted file mode 100644 index 664c4af..0000000 --- a/muranorepository/Services/scripts/OptionParser.ps1 +++ /dev/null @@ -1,280 +0,0 @@ -function New-Option ([string]$Name, [switch]$Switch, [switch]$Boolean, [switch]$String, [switch]$List, $Constraints=$null) { - <# - .SYNOPSIS - Creates Option object - - .DESCRIPTION - Option object is a virtual object represtnting typed command line option. These objects encapsulate escaping and - validation matters. - - One and only one of the switches 'Switch', 'Boolean', 'String' or 'List' should be provided. - - .PARAMETER Name - Option name as it appears in the command line. - - .PARAMETER Switch - Use this switch to create valueless option (a switch). - - .PARAMETER Boolean - Use this switch to create boolean option. Its value is always converted to "1" or "0" - - .PARAMETER String - Use this switch to create string option. Its value will be properly quoted if necessary. - - .PARAMETER List - Use this switch to create option with list value. Values will be put into command line using valid value delemiter (a comma) - - .PARAMETER Constraints - When this parameter is specified, option values are limited to options from that list. - - #> - - $Option = New-Object -TypeName PSObject - - # Fields - $Option | Add-Member NoteProperty Type -value $null - $Option | Add-Member NoteProperty Name -value $null - $Option | Add-Member NoteProperty AllowedValues -value $null - - # Init - - $Option | Add-Member ScriptMethod __init__ { - param([string]$Name, $Switch, $Boolean, $String, $List) - - $this.Name = $Name - - # With respect for our developers we do not check for double type selected - if ($Switch) { - AugmentOptionSwitch($this) - } elseif ($Boolean) { - AugmentOptionBoolean($this) - } elseif ($String) { - AugmentOptionString($this) - } elseif ($List) { - AugmentOptionList($this) - } else { - throw "Switch, Boolean, String or List option type must be provided for option '$Name'" - } - } - - $Option | Add-Member ScriptMethod __post_init__ { - param($Constraints=$null) - if ($Constraints -ne $null) { - $this.AllowedValues = @() - $this.AllowedValues = $this.AllowedValues + $Constraints - } else { - $Constraints = $null - } - } - - # Methods - - $Option | Add-Member -Force ScriptMethod Validate { - if ($this.AllowedValues -ne $null) { - if (-not($this.AllowedValues -contains $this.Value)) { - $Cts = $this.AllowedValues -join ',' - throw "Option '$($this.Name)' may have values ($Cts) but not '$($this.Value)'" - } - } - } - - $Option | Add-Member -Force ScriptMethod ToString { - return "/$($this.Name)" - } - - # invoke constructor - - $Option.__init__($Name, $Switch, $Boolean, $String, $List) - $Option.__post_init__($Constraints) - - return $Option -} - -function AugmentOptionSwitch($Option) { -} - -function AugmentOptionBoolean($Option) { - # Fields - $Option | Add-Member NoteProperty Value -value $false - - # Methods - - $Option | Add-Member -Force ScriptMethod ToString { - if ($this.Value) { - return "/$($this.Name)=1" - } else { - return "/$($this.Name)=0" - } - } -} - -function AugmentOptionString($Option) { - # Fields - $Option | Add-Member NoteProperty Value -value "" - - # Methods - - $Option | Add-Member -Force ScriptMethod ToString { - $v = "$($this.Value)" - if ($v -match '.* .*') { - # TODO: Escape double quote characters if possible - return "/$($this.Name)=`"$v`"" - } else { - return "/$($this.Name)=$v" - } - } -} - -function AugmentOptionList($Option) { - # Fields - $Option | Add-Member NoteProperty Value -value @() - - # Methods - - $Option | Add-Member -Force ScriptMethod Validate { - if ($this.AllowedValues -ne $null) { - foreach ($V in $this.Value) { - if (-not($this.AllowedValues -contains $V)) { - $Cts = $this.AllowedValues -join ',' - throw "Option '$($this.Name)' may have values ($Cts) but not '$V'" - } - } - } - } - - $Option | Add-Member -Force ScriptMethod ToString { - return "/$($this.Name)=$($this.Value -join ',')" - } -} - -function New-OptionParser() { - <# - .SYNOPSIS - Creates OptionParser object. - - .DESCRIPTION - OptionParser object leverages Option objects capabilities and builds valid command line using specified options. - An application may also be invoked with OptionParser. - - #> - - $OptionParser = New-Object -TypeName PSObject - - # Fields - $OptionParser | Add-Member NoteProperty Options -value @{} - $OptionParser | Add-Member NoteProperty Defaults -value @{} - $OptionParser | Add-Member NoteProperty RequiredOptions -value @() - - # Methods - - $OptionParser | Add-Member ScriptMethod AddOption { - <# - .SYNOPSIS - Adds supported option into OptionParser. - - .DESCRIPTION - OptionParser does not allow using unrecognized options. Use this method to fill OptionParser with recognized options - - .PARAMETER Option - Option object - - .PARAMETER Required - Required option switch - - .PARAMETER Default - Option default value - #> - param($Option, [bool]$Required=$false, $Default=$null) - $this.Options.Add($Option.Name, $Option) - if ($Required) { - $this.RequiredOptions = $this.RequiredOptions + $Option.Name - if ($Option | Get-Member "Value") { - if ($Default) { - $this.Defaults.Add($Option.Name, $Default) - } - } else { - $this.Defaults.Add($Option.Name, $null) - } - } - } - - $OptionParser | Add-Member ScriptMethod Parse { - <# - .SYNOPSIS - Parses supplied options and returns command line parameters array. - - .DESCRIPTION - This method verifies that only supported options are provided, all mandatory options are in place, - all option meet constraints if any. Unspecified options with default values are added to command line. - So, mandatory option with default value never causes exception. - - .PARAMETER Options - A hash map of options to parse. Option names should be mapped to corresponding values. - #> - param([hashtable]$Options) - - $CommandLine = @() - foreach ($RequiredOptionName in $this.RequiredOptions) { - if (-not $Options.ContainsKey($RequiredOptionName)) { - $Default = $this.Defaults.Get_Item($RequiredOptionName) - if ($this.Defaults.ContainsKey($RequiredOptionName)) { - $Options.Add($RequiredOptionName, $this.Defaults.Get_Item($RequiredOptionName)) - } else { - throw "Required option '$RequiredOptionName' is missing" - } - } - } - - foreach ($OptionName in $($Options.keys)) { - $Option = $this.Options.Get_Item($OptionName) - if ($Option -eq $null) { - throw "Option '$OptionName' is not allowed" - } - if ($Option | Get-Member "Value") { - $Option.Value = $Options.Get_Item($OptionName) - } - $Option.Validate() - $CommandLine = $CommandLine + $Option.ToString() - } - return $CommandLine - } - - $OptionParser | Add-Member ScriptMethod ExecuteBinary { - param($Binary, [hashtable]$Options = @{}, $CommandLineSuffix = @()) - <# - .SYNOPSIS - Executes binary with a command line constructed from provided options. An arbitrary suffix may be - appended to the command line. - - .DESCRIPTION - This method uses OptionParser.Parse method to construct command line. If there a command line suffix - was supplied, it is appended to the end of command line. Normally command line suffix should contain - leading space character. - - Method waits for executable process to complete and returns its exit code. - - .PARAMETER Binary - Full or relative path to the executable to run. - - .PARAMETER Options - A hash map of options to pass to the executable. - - .PARAMETER CommandLineSuffix - Arbitrary command line suffix. Normally it shoud have leading space character. - #> - - $Binary = Get-Item $Binary - $CommandLine = $this.Parse($Options) - if ($CommandLineSuffix) { - $CommandLine = $CommandLine + $CommandLineSuffix - } - - Write-Log "Executing: $($Binary.FullName) $($CommandLine -join ' ')" - $process = [System.Diagnostics.Process]::Start($Binary, $CommandLine) - $process.WaitForExit() - $process.Refresh() - return $process.ExitCode - } - - return $OptionParser -} diff --git a/muranorepository/Services/scripts/SQLServer/Install-SQLServer.ps1 b/muranorepository/Services/scripts/SQLServer/Install-SQLServer.ps1 deleted file mode 100644 index 61fb566..0000000 --- a/muranorepository/Services/scripts/SQLServer/Install-SQLServer.ps1 +++ /dev/null @@ -1,84 +0,0 @@ - -trap { - &$TrapHandler -} - - - -Function ConvertTo-Boolean { - param ( - $InputObject, - [Boolean] $Default = $false - ) - try { - [System.Convert]::ToBoolean($InputObject) - } - catch { - $Default - } -} - - - -Function Show-Environment { - foreach ($item in (Get-ChildItem Env:)) { - Write-Log ("'{0}' --> '{1}'" -f $item.Name, $item.Value) - } -} - - - -Function Install-SqlServer { - param ( - [String] $SetupRoot = '', - [String] $SAPassword = '', - [String] $MuranoFileShare = '', - [Switch] $MixedModeAuth = $false, - [Switch] $UpdateEnabled = $false - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - if ($SetupRoot -eq '') { - if ($MuranoFileShare -eq '') { - $MuranoFileShare = [Environment]::GetEnvironmentVariable('MuranoFileShare') - if ($MuranoFileShare -eq '') { - throw("Unable to find MuranoFileShare path.") - } - } - - $SetupRoot = [IO.Path]::Combine($MuranoFileShare, 'Prerequisites\SQL Server\2012') - } - - #$MixedModeAuthSwitch = ConvertTo-Boolean $MixedModeAuth - - $ExtraOptions = @{} - - if ($MixedModeAuth -eq $true) { - $ExtraOptions += @{'SECURITYMODE' = 'SQL'} - if ($SAPassword -eq '') { - throw("SAPassword must be set when MixedModeAuth is requisted!") - } - } - - if ($SAPassword -ne '') { - $ExtraOptions += @{'SAPWD' = $SAPassword} - } - - if (-not $UpdateEnabled) { - $ExtraOptions += @{'UpdateEnabled' = $false} - } - - Show-Environment - - New-SqlServer -SetupRoot $SetupRoot -ExtraOptions $ExtraOptions - } -} diff --git a/muranorepository/Services/scripts/SQLServer/SQLServerInstaller.ps1 b/muranorepository/Services/scripts/SQLServer/SQLServerInstaller.ps1 deleted file mode 100644 index 5a4001f..0000000 --- a/muranorepository/Services/scripts/SQLServer/SQLServerInstaller.ps1 +++ /dev/null @@ -1,1373 +0,0 @@ -Import-Module NetSecurity - -function Test-Key([string]$path, [string]$key) { - if(!(Test-Path $path)) { return $false } - if ((Get-ItemProperty $path).$key -eq $null) { return $false } - return $true -} - -function Resolve-SQLServerPrerequisites { - <# - .SYNOPSIS - Installs MS SQL Server prerequisites (.Net Framework 3.5) - - .DESCRIPTION - Installs MS SQL Server prerequisites (.Net Framework 3.5) - - #> - if (-not (Test-Key "HKLM:\Software\Microsoft\NET Framework Setup\NDP\v3.5" "Install")) { - Import-Module ServerManager - Write-Host ".Net Framework 3.5 not found. Installing it using Server Manager..." - $Feature = Get-WindowsFeature NET-Framework - if ($Feature -eq $null) { - # We are probably on Windows Server 2012 - $Feature = Get-WindowsFeature NET-Framework-Core - } - if (-not $Feature) { - throw ".Net framework 3.5 feature was not found." - } - if (-not $Feature.DisplayName -match "3.5") { - Log-Warning ".Net framework 3.5 is required, but $($Feature.DisplayName) is available as Windows feature. Proceeding with installation" - } - [void](Add-WindowsFeature $Feature) - } -} - -function New-SQLServer { - <# - .SYNOPSIS - Installs new MS SQL Server instance. Returns $true if a reboot is required after the installation, - $false if a reboot is not required and throws an exception in case if installation fails. - - .DESCRIPTION - Installs new MS SQL Server instance in unattended mode. - - .PARAMETER SetupRoot - MS SQL Server installation files root directory. Normally it is just DVD drive name. - - .PARAMETER ExtraFeatures - List of features to be installed in addition to default "SQLEngine", "Conn", "SSMS", "ADV_SSMS". - #> - - param( - [parameter(Mandatory = $true)] - [string]$SetupRoot, - [array]$ExtraFeatures = @(), - [Hashtable]$ExtraOptions = @{} - ) - - $SetupDir = Get-Item $SetupRoot - $SetupExe = $SetupDir.GetFiles("setup.exe")[0] - - Resolve-SQLServerPrerequisites - - $parser = New-OptionParserInstall - $ExitCode = $parser.ExecuteBinary($SetupExe.FullName, @{"Q" = $null; "FEATURES" = @("SQLEngine", "Conn", "SSMS", "ADV_SSMS") + $ExtraFeatures} + $ExtraOptions) - - if ($ExitCode -eq 3010) { - return $true - } - - if ($ExitCode -ne 0) { - throw "Installation executable exited with code $("{0:X8}" -f $ExitCode) (Decimal: $ExitCode)" - } - - return $false -} - -function New-SQLServerForAOAG { - <# - .SYNOPSIS - Installs new MS SQL Server instance with all needed features to set up AlwaysOn Availability Group. - Returns $true if a reboot is required after the installation, $false if a reboot is not required - and throws an exception in case if installation fails. - - .DESCRIPTION - Installs new MS SQL Server instance in unattended mode. All features for AlwaysOn Availability Groups are - installed. - - All availability group members must be installed with the same SQLSvcUsrDoman, SQLSvcUsrName and SQLSvcUsrPassword parameters. - User must be a domain user since it will be used for nodes interconnection. - - .PARAMETER SetupRoot - MS SQL Server installation files root directory. Normally it is just DVD drive name. - - .PARAMETER SQLSvcUsrDomain - MS SQL Server user account domain name. - - .PARAMETER SQLSvcUsrName - MS SQL Server user account name. - - .PARAMETER SQLSvcUsrPassword - MS SQL Server user account password. - - .PARAMETER ExtraFeatures - List of features to be removed besides "SQLEngine", "Conn", "SSMS", "ADV_SSMS", "DREPLAY_CTLR", "DREPLAY_CLT". - #> - - param( - [parameter(Mandatory = $true)] - [string]$SetupRoot, - [parameter(Mandatory = $true)] - [string]$SQLSvcUsrDomain, - [parameter(Mandatory = $true)] - [string]$SQLSvcUsrName, - [parameter(Mandatory = $true)] - [string]$SQLSvcUsrPassword, - [array]$ExtraFeatures = @(), - [Hashtable]$ExtraOptions = @{} - ) - - $SetupDir = Get-Item $SetupRoot - $SetupExe = $SetupDir.GetFiles("setup.exe")[0] - - $SQLUser = "$SQLSvcUsrDomain\$SQLSvcUsrName" - $domain = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$SQLSvcUsrDomain", $SQLSvcUsrName, $SQLSvcUsrPassword) - - if ($domain.name -eq $null) { - throw "Credentials validation failed for user $SQLUser. Check domain, login name and password." - } - - Resolve-SQLServerPrerequisites - - $parser = New-OptionParserInstall - $ExitCode = $parser.ExecuteBinary($SetupExe.FullName, @{"Q" = $null; "FEATURES" = @("SQLEngine", "Conn", "SSMS", "ADV_SSMS", "DREPLAY_CTLR", "DREPLAY_CLT") + $ExtraFeatures; - "AGTSVCACCOUNT" = $SQLUser; "AGTSVCPASSWORD" = $SQLSvcUsrPassword; "ASSVCACCOUNT" = $SQLUser; "ASSVCPASSWORD" = $SQLSvcUsrPassword; "ASSYSADMINACCOUNTS" = $SQLUSer; - "SQLSVCACCOUNT" = $SQLUser; "SQLSVCPASSWORD" = $SQLSvcUsrPassword; "SQLSYSADMINACCOUNTS" = $SQLUser; "ISSVCACCOUNT" = $SQLUser; "ISSVCPASSWORD" = $SQLSvcUsrPassword; - "RSSVCACCOUNT" = $SQLUser; "RSSVCPASSWORD" = $SQLSvcUsrPassword} + $ExtraOptions) - - if ($ExitCode -eq 3010) { - return $true - } - - if ($ExitCode -ne 0) { - throw "Installation executable exited with code $("{0:X8}" -f $ExitCode) (Decimal: $ExitCode)" - } - - return $false -} - -function Remove-SQLServer { - <# - .SYNOPSIS - Uninstalls MS SQL Server instance installed with New-SQLServer cmdlet - - .DESCRIPTION - Uninstalls MS SQL Server instance installed with New-SQLServer cmdlet in unattended mode - - .PARAMETER SetupRoot - MS SQL Server installation files root directory. Normally it is just DVD drive name. - - .PARAMETER ExtraFeatures - List of features to be removed besides "SQLEngine", "Conn", "SSMS", "ADV_SSMS". - #> - - param( - [parameter(Mandatory = $true)] - [string]$SetupRoot, - [array]$ExtraFeatures = @() - ) - - $SetupDir = Get-Item $SetupRoot - $SetupExe = $SetupDir.GetFiles("setup.exe")[0] - - $parser = New-OptionParserUninstall - $ExitCode = $parser.ExecuteBinary($SetupExe.FullName, @{"Q" = $null; "FEATURES" = @("SQLEngine", "Conn", "SSMS", "ADV_SSMS") + $ExtraFeatures}) - - if ($ExitCode -ne 0) { - throw "Installation executable exited with code $("{0:X8}" -f $ExitCode)" - } -} - -function Install-SQLServerForSysPrep { - <# - .SYNOPSIS - Installs new MS SQL Server in sysprep mode. - - .DESCRIPTION - Installs new MS SQL Server in sysprep mode. Returns $true if a reboot is required after the installation, - $false if a reboot is not required and throws an exception in case if installation fails. - - Setup must be completed after booting rearmed machine by using Complete-SQLServer cmdlet - - .PARAMETER SetupRoot - MS SQL Server installation files root directory. Normally it is just DVD drive name. - - .PARAMETER ExtraFeatures - List of features to be installed in addition to default "SQLEngine". Note that prior to - SQL Server version 2012 Service Pack 1 Cumulative Update 2 (January 2013) only "Replication", - "FullText" and "RS" may be installed in addition to "SQLEngine". See the following link for - detials: http://msdn.microsoft.com/en-us/library/ms144259.aspx - - #> -} - -function Install-SQLServerForSysPrep { - <# - .SYNOPSIS - Installs new MS SQL Server in sysprep mode. - - .DESCRIPTION - Installs new MS SQL Server in sysprep mode. Returns $true if a reboot is required after the installation, - $false if a reboot is not required and throws an exception in case if installation fails. - - Setup must be completed after booting rearmed machine by using Complete-SQLServer cmdlet - - .PARAMETER SetupRoot - MS SQL Server installation files root directory. Normally it is just DVD drive name. - - .PARAMETER ExtraFeatures - List of features to be installed in addition to default "SQLEngine". Note that prior to - SQL Server version 2012 Service Pack 1 Cumulative Update 2 (January 2013) only "Replication", - "FullText" and "RS" may be installed in addition to "SQLEngine". See the following link for - detials: http://msdn.microsoft.com/en-us/library/ms144259.aspx - - #> - - param( - [parameter(Mandatory = $true)] - [string]$SetupRoot, - [array]$ExtraFeatures = @() - ) - - $SetupDir = Get-Item $SetupRoot - $SetupExe = $SetupDir.GetFiles("setup.exe")[0] - - Resolve-SQLServerPrerequisites - - $parser = New-OptionParserPrepareImage - $ExitCode = $parser.ExecuteBinary($SetupExe.FullName, @{"QS" = $null; "FEATURES" = @("SQLEngine") + $ExtraFeatures }) - - if ($ExitCode -eq 3010) { - return $true - } - - if ($ExitCode -ne 0) { - throw "Installation executable exited with code $("{0:X8}" -f $ExitCode) (Decimal: $ExitCode)" - } - - return $false -} - -function Complete-SQLServerAfterSysPrep { - <# - .SYNOPSIS - Completes previously prepared with "Install-SQLServerForSysPrep" MS SQL Server after the system was rearmed. - - .DESCRIPTION - Completes previously prepared with "Install-SQLServerForSysPrep" MS SQL Server after the system was rearmed. - Returns $true if a reboot is required after the installation, $false if a reboot is not required and throws - an exception in case if installation fails. - - Setup must be completed after booting rearmed machine by using Complete-SQLServer cmdlet - - .PARAMETER SetupRoot - MS SQL Server installation files root directory. Normally it is just DVD drive name. - #> - - param( - [parameter(Mandatory = $true)] - [string]$SetupRoot - ) - - $SetupDir = Get-Item $SetupRoot - $SetupExe = $SetupDir.GetFiles("setup.exe")[0] - - $parser = New-OptionParserCompleteImage - $ExitCode = $parser.ExecuteBinary($SetupExe.FullName, @{"QS" = $null}) - - if ($ExitCode -eq 3010) { - return $true - } - - if ($ExitCode -ne 0) { - throw "Installation executable exited with code $("{0:X8}" -f $ExitCode) (Decimal: $ExitCode)" - } - - return $false -} - -function ConvertTo-SQLString { - <# - .SYNOPSIS - Converts argument to a valid SQL string in quotes - - .DESCRIPTION - Converts argument to a valid SQL string in quotes. The string may contain any characters. - See http://msdn.microsoft.com/en-us/library/ms179899.aspx - - .PARAMETER S - String to convert - #> - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true)] - [string]$S - ) - - return "'$($S -replace "'", "''")'" -} - -function ConvertTo-SQLName { - <# - .SYNOPSIS - Converts argument to a valid SQL name in brackets - - .DESCRIPTION - Converts argument to a valid SQL name in brackets. The string may contain any characters. - See http://msdn.microsoft.com/en-us/library/ms175874.aspx - - .PARAMETER S - String to convert - #> - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true)] - [string]$S - ) - return "[$($S -replace "]", "]]")]" -} - -function Invoke-SQLText { - <# - .SYNOPSIS - Invokes SQL text - - .DESCRIPTION - Invokes SQL text. Returns raw SQL server output. - - .PARAMETER SQL - SQL Text - - .PARAMETER User - SQL Server user name - - .PARAMETER Password - SQL Server user password - #> - param( - [parameter(Mandatory = $true)] - [string]$SQL, - [string]$User = $null, - [string]$Password = $null - ) - - #Write-Warning "$SQL`n" - #return - - $Binary = Get-Command "sqlcmd.exe" - - $tempFile = [IO.Path]::GetTempFileName() - $tempFile = Get-Item $tempFile - Set-Content -Path $tempFile -Value $SQL - - $CommandLine = @('-h', '-1', '-b', '-i', "`"$($tempFile.FullName)`"") - if (($User -ne $null) -and ($User -ne '')) { - $CommandLine = $CommandLine + '-U' - $CommandLine = $CommandLine + $User - $CommandLine = $CommandLine + '-P' - $CommandLine = $CommandLine + $Password - } - - Write-Debug "Executing: `n$SQL`n" - [string]$output = &$Binary $CommandLine - - $ExitCode = $LastExitCode - if ($ExitCode -ne 0) { - Write-Warning $output - throw "SQLCMD.EXE returned with exit code $ExitCode while running $Binary $CommandLine" - } - - Remove-Item $tempFile - - return $output -} - -function New-SQLUser { - <# - .SYNOPSIS - Invokes SQL text - - .DESCRIPTION - Invokes SQL text - - .PARAMETER SQL - SQL Text - - .PARAMETER User - SQL Server user name - - .PARAMETER Password - SQL Server user password - #> - param( - [parameter(Mandatory = $true)] - [string]$SQL, - [string]$User = $null, - [string]$Password = $null - ) -} - -function New-Password { - <# - .SYNOPSIS - Creates random password of the specified length - - .DESCRIPTION - Password contains random characters a-z, A-Z, numbers and special characters. - There is no guarantee that all the types of symbols will be present in the password. - - .PARAMETER Length - Desired length of the password. - - #> - param( - [parameter(Mandatory = $true)] - [int]$Length=6 - ) - - $Result = "" - $alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()'`"``_+[]\{}|;:,./<>?~" - while ($Length -gt 0) { - $x = Get-Random $alpha.Length - $c = $alpha[$x] - $Result = "$Result$c" - $Length = $Length - 1 - } - return $Result -} - -function Initialize-MirroringEndpoint { - <# - .SYNOPSIS - Creates mirroring endpoint. - - .DESCRIPTION - Master key is created if necessary. Host certificate is created when necessary either (normally on first endpoint creation). - - Endpoint and certificate are recreated in case if master key did not existed (should not normally happen). - - Endpoint is recreated in case if certificate did not existed (should not happen unless the endpoint was created manually). - - Mirroring endpoint is created unless one already exists. The endpoint is created with the specified name. When the endpoint - already exists is is unchanged. - - Endpoint port is selected automatically as 4022 or as first available port after 4022 in case if 4022 is already listening. - If there is no firewall rule with name 'DatabaseMirroring-TCP-{portnumber}', allowing rule is created. - - Certificate is stored in the specified file. - - Returns endpoint listening port. - - .PARAMETER EncryptionPassword - Encryption password used to create certificate. - - .PARAMETER CertificateFileName - Certificate target file name. File MUST NOT exist. - - #> - - param( - [parameter(Mandatory = $true)] - [String]$EncryptionPassword, - [parameter(Mandatory = $true)] - [String]$CertificateFileName - ) - - $EndpointName = 'MirroringEndpoint' - - $Folder = Get-Item $WorkDir - - $H = $Env:COMPUTERNAME -replace '[^A-Za-z0-9_]', '_' - - $Port = Get-NextFreePort 4022 - - $CreateMasterKey = "USE master; - - IF NOT EXISTS(select * from sys.symmetric_keys where name = '##MS_DatabaseMasterKey##') - BEGIN - CREATE MASTER KEY ENCRYPTION BY PASSWORD = $(ConvertTo-SQLString $EncryptionPassword); - IF EXISTS(select * from sys.certificates where name = '${H}_cert') - BEGIN - DROP CERTIFICATE ${H}_cert - END - IF EXISTS(SELECT * FROM sys.endpoints WHERE type_desc='DATABASE_MIRRORING') - BEGIN - DECLARE `@name VARCHAR(255) - SELECT TOP 1 `@name = name FROM sys.endpoints WHERE type_desc='DATABASE_MIRRORING' - EXEC ('DROP ENDPOINT [' + `@name + ']') - END - END - GO - - IF NOT EXISTS(select * from sys.certificates where name = '${H}_cert') - BEGIN - CREATE CERTIFICATE ${H}_cert WITH SUBJECT = '${H} endpoint certificate'; - IF EXISTS(SELECT * FROM sys.endpoints WHERE type_desc='DATABASE_MIRRORING') - BEGIN - DECLARE `@name VARCHAR(255) - SELECT TOP 1 `@name = name FROM sys.endpoints WHERE type_desc='DATABASE_MIRRORING' - EXEC ('DROP ENDPOINT [' + `@name + ']') - END - END - GO - - BACKUP CERTIFICATE ${H}_cert TO FILE = $(ConvertTo-SQLString "$CertificateFileName"); - GO - - DECLARE `@port int - IF EXISTS(SELECT * FROM sys.endpoints WHERE type_desc='DATABASE_MIRRORING') - BEGIN - SELECT `@port = port FROM sys.tcp_endpoints WHERE type_desc='DATABASE_MIRRORING' - END ELSE - BEGIN - CREATE ENDPOINT $(ConvertTo-SQLName $EndpointName) - STATE = STARTED - AS TCP ( - LISTENER_PORT = $Port - , LISTENER_IP = ALL - ) - FOR DATABASE_MIRRORING ( - AUTHENTICATION = CERTIFICATE ${H}_cert - , ENCRYPTION = REQUIRED ALGORITHM AES - , ROLE = ALL - ); - SELECT `@port = $Port - END - - SELECT 'port:(' + CONVERT(VARCHAR, `@port) + ')' as port - GO - - " - - $rawdata = Invoke-SQLText -SQL $CreateMasterKey - [int]$Port = $rawdata -replace '.*port:\(([^)]*)\).*', '$1' - - # Open port in Windows Firewall - - $PortOpen = $false - $RuleName = "DatabaseMirroring-TCP-$Port" - Get-NetFirewallRule | Foreach-Object { - if ($_.Name -eq $RuleName) { - $PortOpen = $true - } - } - if (-not $PortOpen) { - $DisplayName = "MS SQL Database Mirroring Endpoint at TCP port $Port" - New-NetFirewallRule -Name $RuleName -DisplayName $DisplayName -Description $DisplayName -Protocol TCP -LocalPort $Port -Enabled True -Profile Any -Action Allow - } - - return $Port -} - -function Complete-MirroringEndpoint { - <# - .SYNOPSIS - Completes mirroring endpoint - - .DESCRIPTION - Allows inbound connections from remote host - #> - - param( - [parameter(Mandatory = $true)] - [String]$RemoteHostName, - [parameter(Mandatory = $true)] - [String]$RemoteWorkDir, - [String]$RemoteHostLogin, - [String]$RemoteHostUser, - [String]$RemoteHostPassword - ) - - $Folder = Get-Item $RemoteWorkDir - $RemoteWorkDir = $Folder.FullName - - $H = $RemoteHostName -replace '[^A-Za-z0-9_]', '_' - - if (-not $RemoteHostLogin) { - $RemoteHostLogin = "${H}_login" - } - if (-not $RemoteHostUser) { - $RemoteHostUser = "${H}_user" - } - if (-not $RemoteHostPassword) { - $RemoteHostPassword = "$(New-Password 10)aA#3" - } - - $SQL = "USE master; - - IF NOT EXISTS(select * from sys.sql_logins where name=$(ConvertTo-SQLString $RemoteHostLogin)) - BEGIN - CREATE LOGIN $(ConvertTo-SQLName $RemoteHostLogin) WITH PASSWORD = $(ConvertTo-SQLString $RemoteHostPassword); - END - GO - - IF NOT EXISTS(select * from sys.sysusers where name=$(ConvertTo-SQLString $RemoteHostUser)) - BEGIN - CREATE USER $(ConvertTo-SQLName $RemoteHostUser) FOR LOGIN $(ConvertTo-SQLName $RemoteHostLogin); - END - GO - - IF EXISTS(select * from sys.certificates where name='${H}_remote_cert') - BEGIN - DROP CERTIFICATE ${H}_remote_cert - END - GO - - CREATE CERTIFICATE ${H}_remote_cert AUTHORIZATION $(ConvertTo-SQLName $RemoteHostUser) FROM FILE = $(ConvertTo-SQLString "$RemoteWorkDir\certificate.cer"); - GO - - DECLARE `@name VARCHAR(255) - SELECT TOP 1 `@name = name FROM sys.endpoints WHERE type_desc='DATABASE_MIRRORING' - SELECT 'name:(' + `@name + ')' as name - " - - $rawdata = Invoke-SQLText -SQL $SQL - $EndpointName = $rawdata -replace '.*name:\(([^)]*)\).*', '$1' - $SQL = "GRANT CONNECT ON ENDPOINT::$(ConvertTo-SQLName $EndpointName) TO $(ConvertTo-SQLName $RemoteHostLogin)" - [void](Invoke-SQLText -SQL $SQL) -} - -function Complete-SQLMirror { - <# - .SYNOPSIS - Completes creation of mirrored SQL database - - .DESCRIPTION - This cmdlet should be first executed on mirror server and then on principal server. - Otherwise it will fail (however it may be executed again with no harm). - #> - - param( - [parameter(Mandatory = $true)] - [String]$RemoteHostName, - [parameter(Mandatory = $true)] - [Int]$RemotePort, - [parameter(Mandatory = $true)] - [String]$DatabaseName - ) - - $Url = "TCP://${RemoteHostName}:${RemotePort}" - $AlterDb = "ALTER DATABASE $(ConvertTo-SQLName $DataBaseName) SET PARTNER = $(ConvertTo-SQLString $Url); - GO" - [void](Invoke-SQLText -SQL $AlterDb) -} - -function New-SQLDatabase { - <# - .SYNOPSIS - Creates empty SQL database - - .DESCRIPTION - Creates empty SQL database with default settings. Fails in case is the database already exists. - - .PARAMETER DataBaseName - Database name. - - .PARAMETER mdfFile - Name of the MDF (data) file. If not specified, the following value is used: - "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\{DataBasePathName}.mdf" - Where {DataBasePathName} is database name with all but A-Z, a-z, 0-9 characters - replaced by underscore. - - .PARAMETER DataBaseName - Name of the LDF (transaction log) file. If not specified, the following value is used: - "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\{DataBasePathName}_log.mdf" - Where {DataBasePathName} is database name with all but A-Z, a-z, 0-9 characters - replaced by underscore. - #> - - param( - [parameter(Mandatory = $true)] - [String]$DataBaseName, - [String]$mdfFile=$null, - [String]$ldfFile=$null - ) - - $DataBasePathName = $DataBaseName -replace '[^0-9a-zA-Z]', '_' - if (-not $mdfFile) { - $mdfFile = "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\${DataBasePathName}.mdf" - } - if (-not $ldfFile) { - $ldfFile = "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\${DataBasePathName}_log.ldf" - } - - $NewDatabase = " - CREATE DATABASE $(ConvertTo-SQLName $DataBaseName) - CONTAINMENT = NONE - ON PRIMARY - ( NAME = N$(ConvertTo-SQLString $DataBaseName), FILENAME = N$(ConvertTo-SQLString $mdfFile) , SIZE = 4096KB , FILEGROWTH = 1024KB ) - LOG ON - ( NAME = N$(ConvertTo-SQLString "${DataBaseName}_log"), FILENAME = N$(ConvertTo-SQLString $ldfFile) , SIZE = 1024KB , FILEGROWTH = 10%) - GO - USE $(ConvertTo-SQLName $DataBaseName) - GO - IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE $(ConvertTo-SQLName $DataBaseName) MODIFY FILEGROUP [PRIMARY] DEFAULT - GO" - - [void](Invoke-SQLText -SQL $NewDatabase) -} - -function Initialize-SQLMirroringPrincipalStep1 { - <# - .SYNOPSIS - Prepares principal SQL Server for database mirroring (Stage 1) - - .DESCRIPTION - Initializes mirroring endpoint (this is absolutely symmetric step to the mirror init). In addition to that it creates - a database and stores backups of it and its transaction log in the same directory as the endpoint certificate. - - A firewall rule is created for endpoint if necessary. - - .PARAMETER WorkDir - Workind directory. This directory should be tranferred to the mirror server after this - step is executed. - - .PARAMETER DatabaseName - Mirrored database name. This name MUST be use at mirror server either. - - #> - - param( - [parameter(Mandatory = $true)] - [String]$WorkDir, - [parameter(Mandatory = $true)] - [String]$DataBaseName - ) - - [String]$EncryptionPassword = "$(New-Password 10)aA#3" - - if (-not (Test-Path $WorkDir)) { - [void](New-Item -Type Directory $WorkDir) - } - $WorkDir = (Get-Item $WorkDir).FullName - if ((Get-ChildItem -Path $WorkDir).Length -gt 0) { - throw "Working directory $WorkDir is not empty" - } - - $EndpointPort = Initialize-MirroringEndpoint $EncryptionPassword "$WorkDir\certificate.cer" - $EndpointPort | Set-Content "$WorkDir\endpoint-port.txt" - New-SQLDatabase $DataBaseName - - $BackupDb = "BACKUP DATABASE $(ConvertTo-SQLName $DataBaseName) TO DISK = N$(ConvertTo-SQLString "$WorkDir\Source.bak") WITH NOFORMAT, INIT, NAME = N'Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 - GO" - [void](Invoke-SQLText -SQL $BackupDb) - $BackupLog = "BACKUP LOG $(ConvertTo-SQLName $DataBaseName) TO DISK = N$(ConvertTo-SQLString "$WorkDir\Source_log.bak") WITH NOFORMAT, INIT, NAME = N'Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 - GO" - [void](Invoke-SQLText -SQL $BackupLog) -} - -function Initialize-SQLMirroringPrincipalStep2 { - <# - .SYNOPSIS - Prepares principal SQL Server for database mirroring (Stage 2) - - .DESCRIPTION - Imports remote server certificate and grants it with access to the mirroring endpoint. - - .PARAMETER RemoteHostName - Remote (mirror) host name. FQDN is preferred, but NetBIOS names and IP addresses are also accepted. - - .PARAMETER RemoteWorkDir - Path to a copy of workdir obtained from mirror machine created on Stage 1. - #> - - param( - [parameter(Mandatory = $true)] - [String]$RemoteHostName, - [parameter(Mandatory = $true)] - [String]$RemoteWorkDir - ) - - if (-not (Test-Path $RemoteWorkDir)) { - throw "Remote work dir '$RemoteWorkDir' was not found" - } - $RemoteWorkDir = (Get-Item $RemoteWorkDir).FullName - - Complete-MirroringEndpoint $RemoteHostName $RemoteWorkDir -} - -function Initialize-SQLMirroringPrincipalStep3 { - <# - .SYNOPSIS - Prepares principal SQL Server for database mirroring (Stage 3) - - .DESCRIPTION - Completes mirror creation. This step must be globally the last one in mirror creation sequence. - - Note that the remote host certificate is valid from the time it is created there. So - this step will fail if there is noticable different in time local and remote machines. - - .PARAMETER RemoteHostName - Remote (principal) host name. FQDN is preferred, but NetBIOS names and IP addresses are also accepted. - - .PARAMETER RemoteWorkDir - Path to a copy of workdir obtained from principal machine created on Stage 1. - - .PARAMETER DatabaseName - Mirrored database name. This name MUST match principal database name and name provided on step 1. - #> - - param( - [parameter(Mandatory = $true)] - [String]$RemoteHostName, - [parameter(Mandatory = $true)] - [String]$RemoteWorkDir, - [parameter(Mandatory = $true)] - [String]$DatabaseName - ) - - [int]$port = Get-Content "${RemoteWorkDir}\endpoint-port.txt" - Complete-SQLMirror $RemoteHostName $port $DatabaseName -} - -function Initialize-SQLMirroringMirrorStep1 { - <# - .SYNOPSIS - Prepares mirror SQL Server for database mirroring (Stage1) - - .DESCRIPTION - Initializes mirroring endpoint for mirror server. Stores mirroring endpoint certificate in Workdir. - - .PARAMETER WorkDir - Workind directory. This directory should be tranferred to the principal server after this - step is executed. - - .PARAMETER DatabaseName - Mirrored database name. This name MUST match principal database name. - - #> - - param( - [parameter(Mandatory = $true)] - [String]$WorkDir, - [parameter(Mandatory = $true)] - [String]$DatabaseName - ) - - [String]$EncryptionPassword = "$(New-Password 10)aA#3" - - if (-not (Test-Path $WorkDir)) { - [void](New-Item -Type Directory $WorkDir) - } - $WorkDir = (Get-Item $WorkDir).FullName - - $EndpointPort = Initialize-MirroringEndpoint $EncryptionPassword "$WorkDir\certificate.cer" - $EndpointPort | Set-Content "$WorkDir\endpoint-port.txt" -} - -function Initialize-SQLMirroringMirrorStep2 { - <# - .SYNOPSIS - Prepares mirror SQL Server for database mirroring (Stage 2) - - .DESCRIPTION - Imports remote server certificate and grants it with access to the mirroring endpoint. - Restores database obtained from principal and leaves it in 'Restoring' state. - - .PARAMETER RemoteHostName - Remote (principal) host name. FQDN is preferred, but NetBIOS names and IP addresses are also accepted. - - .PARAMETER RemoteWorkDir - Path to a copy of workdir obtained from principal machine created on Stage 1. - - .PARAMETER DatabaseName - Mirrored database name. This name MUST match principal database name. - - #> - - param( - [parameter(Mandatory = $true)] - [String]$RemoteHostName, - [parameter(Mandatory = $true)] - [String]$RemoteWorkDir, - [parameter(Mandatory = $true)] - [String]$DataBaseName - ) - - if (-not (Test-Path $RemoteWorkDir)) { - throw "Remote work dir '$RemoteWorkDir' was not found" - } - $RemoteWorkDir = (Get-Item $RemoteWorkDir).FullName - - Complete-MirroringEndpoint $RemoteHostName $RemoteWorkDir - - $RestoreDb = "RESTORE DATABASE $(ConvertTo-SQLName $DataBaseName) FROM DISK = N$(ConvertTo-SQLString "$RemoteWorkDir\Source.bak") WITH FILE = 1, NORECOVERY, NOUNLOAD, REPLACE, STATS = 5 - GO" - [void](Invoke-SQLText -SQL $RestoreDb) - $RestoreLog = "RESTORE LOG $(ConvertTo-SQLName $DataBaseName) FROM DISK = N$(ConvertTo-SQLString "$RemoteWorkDir\Source_log.bak") WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 10 - GO" - [void](Invoke-SQLText -SQL $RestoreLog) -} - -function Initialize-SQLMirroringMirrorStep3 { - <# - .SYNOPSIS - Prepares mirror SQL Server for database mirroring (Stage 3) - - .DESCRIPTION - Completes mirror creation. This step must be executed strictly before symmetric step on the principal. - - Note that the remote host certificate is valid from the time it is created there. So - this step will fail if there is noticable different in time local and remote machines. - - .PARAMETER RemoteHostName - Remote (principal) host name. FQDN is preferred, but NetBIOS names and IP addresses are also accepted. - - .PARAMETER RemoteWorkDir - Path to a copy of workdir obtained from principal machine created on Stage 1. - - .PARAMETER DatabaseName - Mirrored database name. This name MUST match principal database name. - - #> - - param( - [parameter(Mandatory = $true)] - [String]$RemoteHostName, - [parameter(Mandatory = $true)] - [String]$RemoteWorkDir, - [parameter(Mandatory = $true)] - [String]$DatabaseName - ) - - [int]$port = Get-Content "${RemoteWorkDir}\endpoint-port.txt" - Complete-SQLMirror $RemoteHostName $port $DatabaseName -} - -function Get-NextFreePort { - <# - .SYNOPSIS - Returns specified desired port or closest next one unoccupied. - - .PARAMETER Port - Desired port number. - - #> - - param( - [parameter(Mandatory = $true)] - [int]$Port - ) - $OpenPorts = netstat -aon | select-string 'LISTENING' | Foreach-Object { (($_ -replace '^\s*', '' -split '\s+')[1] -split '.*:')[1] } | Sort-Object | Get-Unique - while ($OpenPorts.Contains(${Port})) { - $Port = $Port + 1 - } - return $Port -} - -function Initialize-AlwaysOn { - <# - .SYNOPSIS - Initializes AlwaysOn clustering on local SQL server and creates AlwaysOn endpoint listener. Returns AlwaysOn endpoint port number. - - .DESCRIPTION - Enables AlwaysOn clustering on local SQL server. Creates AlwaysOn TCP endpoint on port 5022 or greater if the one is occupied. - #> - - if (!(Test-Path SQLSERVER:\)) { - Import-Module sqlps - } - $MachineName = (Get-ChildItem SQLSERVER:\SQL)[0].PSChildName - $InstanceName = (Get-ChildItem SQLSERVER:\SQL\$MachineName).PSChildName - $AlwaysOnEnabled = ((Get-Item SQLSERVER:\SQL\$MachineName\$InstanceName) | select IsHadrEnabled).IsHadrEnabled - if (-not $AlwaysOnEnabled) { - Enable-SqlAlwaysOn -Path "SQLSERVER:\SQL\$MachineName\$InstanceName" -Force - } - $Instance = Get-Item SQLSERVER:\SQL\$MachineName\$InstanceName - $endpoint = $Instance.Endpoints["AlwaysOnEndpoint"] - if (-not $endpoint) { - $Port = Get-NextFreePort 5022 - $endpoint = New-SqlHadrEndpoint AlwaysOnEndpoint -Port $Port -Path SQLSERVER:\SQL\$MachineName\$InstanceName - } else { - $Port = $endpoint.Protocol.Tcp.ListenerPort - } - if ($endpoint.EndpointState -ne "Started") { - $endpoint.Start() - } - return $Port -} - -function New-AlwaysOnAvailabilityGroup { - <# - .SYNOPSIS - Creates new AlwaysOn availability group on primary replica. - - .DESCRIPTION - Creates new AlwaysOn availability group on primary replica. - - .PARAMETER WorkDir - Workind directory. This directory should be tranferred to the replica server(s) after this - step is executed. - - .PARAMETER Name - Availability group name. - - .PARAMETER DatabaseNames - Replica database(s) names. - - .PARAMETER ReplicaDefs - Array of replica definition. Each definition is a hash table with replica-specific values. - - Mandatory replica definition values are: - - * [String] SERVER_INSTANCE - Replica server instance name - * [String] ENDPOINT_URL - Replica server endpoint URL. Normally it is TCP://fully.qualified.domain.name:5022 - Port number should be obtained with Initialize-AlwaysOn at the replica server - * [String] AVAILABILITY_MODE - Replica availability mode. Can be "SYNCHRONOUS_COMMIT" or "ASYNCHRONOUS_COMMIT" only. - * [String] FAILOVER_MODE - Replica availability mode. Can be "MANUAL" or "AUTOMATIC" only. - - Optional replica definition values are: - - * [Integer] BACKUP_PRIORITY - Backup priority - * [Integer] SESSION_TIMEOUT - Session timeout - * [String] P_ALLOW_CONNECTIONS - Allowed connection types for "Primary" replica mode. Can be "READ_WRITE" or "ALL" only. - * [Array] P_READ_ONLY_ROUTING_LIST - List of replicas proviring readonly access when this one is primary. - * [String] S_ALLOW_CONNECTIONS - Allowed connection types for "Secondary" replica mode. Can be one of "NO", "READ_ONLY", "ALL". - * [String] S_READ_ONLY_ROUTING_URL - Replica read-only requests listener URL. Normally default server listener at port 1433 is used. - - .PARAMETER Preferences - Hash table of general availability group preferences. All the keys are optional. Supported entry keys are: - - * [String] AUTOMATED_BACKUP_PREFERENCE - Automated backup preference. Can be "PRIMARY", "SECONDARY_ONLY", "SECONDARY" or "NONE". - * [String] FAILURE_CONDITION_LEVEL - Failure condition level. Can be "1", "2", "3", "4" or "5". - * [Integer] HEALTH_CHECK_TIMEOUT - Replica health check timeout. - - .PARAMETER ListenerDef - Hash table containing availability group listener configuration. - - Mandatory listener configuration values are: - - [String] NAME - Listener name. - - Optional listener configuration values are: - - [String] PORT - Listener port number. Integer value may be suffixed by a "+" symol (such as "5022+") which allows the routine to - select next free port with number greater or equal to the specified value. - [String] DHCP - DHCP listener address configuration flag. When any value specified, DHCP is used to configure listener - (this is also the default behavior). Also, a specific interface for DHCP may be specified as IP_ADDRESS/MASK - (like "192.168.1.0/255.255.255.0") as a value of the parameter. - [Array] STATIC - Static IP addresses to listen. IP addresses may be IPv4 addresses in the "IP_ADDRESS/MASK" form or IPv6 - addresses in standard IPv6 notation. - - See http://msdn.microsoft.com/en-us/library/ff878399.aspx page for more details regarding all the supported options. - #> - - param( - [parameter(Mandatory = $true)] - [String]$WorkDir, - [parameter(Mandatory = $true)] - [String]$Name, - [parameter(Mandatory = $true)] - [Array]$DatabaseNames, - [parameter(Mandatory = $true)] - [Array]$ReplicaDefs, - [parameter] - [Hashtable]$Preferences, - [parameter(Mandatory = $true)] - [Hashtable]$ListenerDef - ) - - if (-not (Test-Path $WorkDir)) { - [void](New-Item -Type Directory $WorkDir) - } - $WorkDir = (Get-Item $WorkDir).FullName - if ((Get-ChildItem -Path $WorkDir).Length -gt 0) { - throw "Working directory $WorkDir is not empty" - } - - $QuotedDBNames = ($DatabaseNames | ForEach-Object { ConvertTo-SQLName $_ }) -join ", " - - if ($Preferences -eq $null) { - $Preferences = @() - } - $Prefs = @() - foreach($Pref in $Preferences) { - if ($Pref.Key -eq $null) { - Continue - } - if ($Pref.Key -eq "AUTOMATED_BACKUP_PREFERENCE") { - $Prefs = $Prefs + (Validate-Option $Pref.Key, $Pref.Value, @("PRIMARY", "SECONDARY_ONLY", "SECONDARY", "NONE") | New-ReplicaOption -Name $Pref.Key) - } elseif ($Pref.Key -eq "FAILURE_CONDITION_LEVEL") { - $Prefs = $Prefs + (Validate-Option $Pref.Key, $Pref.Value, @("1", "2", "3", "4", "5") | New-ReplicaOption -Name $Pref.Key) - } elseif ($Pref.Key -eq "HEALTH_CHECK_TIMEOUT") { - $Prefs = $Prefs + (Validate-IntOption $Pref.Key, $Pref.Value | New-ReplicaOption -Name $Pref.Key) - } else { - throw "Unexpected peferences option: '$($Pref.Key)'" - } - } - - $ReplicaDefinitionsArray = @() - for ($i = 0; $i -lt $ReplicaDefs.Length; $i++) { - $RDef = $ReplicaDefs[$i] - if ($RDef.GetType().Name -ne "Hashtable") { - throw "All elements of ReplicaDefs array should be Hashtables" - } - - $ReplicaOpts = @() - - # Mandatory options - $ReplicaName = Validate-DefinedOption "SERVER_INSTANCE" $RDef["SERVER_INSTANCE"] - $ReplicaOpts = $ReplicaOpts + (Validate-DefinedOption "ENDPOINT_URL" $RDef["ENDPOINT_URL"] | ConvertTo-SQLString | New-ReplicaOption -Name "ENDPOINT_URL") - $ReplicaOpts = $ReplicaOpts + (Validate-Option "AVAILABILITY_MODE" $RDef["AVAILABILITY_MODE"] @("SYNCHRONOUS_COMMIT", "ASYNCHRONOUS_COMMIT") | New-ReplicaOption -Name "AVAILABILITY_MODE") - $ReplicaOpts = $ReplicaOpts + (Validate-Option "FAILOVER_MODE" $RDef["FAILOVER_MODE"] @("AUTOMATIC", "MANUAL") | New-ReplicaOption -Name "FAILOVER_MODE") - - # Optional options - if ($RDef["BACKUP_PRIORITY"] -ne $null) { - $ReplicaOpts = $ReplicaOpts + (Validate-IntOption "BACKUP_PRIORITY" $RDef["BACKUP_PRIORITY"] | New-ReplicaOption -Name "BACKUP_PRIORITY") - } - if ($RDef["SESSION_TIMEOUT"] -ne $null) { - $ReplicaOpts = $ReplicaOpts + (Validate-IntOption "SESSION_TIMEOUT" $RDef["SESSION_TIMEOUT"] | New-ReplicaOption -Name "SESSION_TIMEOUT") - } - - $SecondaryRole = @() - if ($RDef["S_ALLOW_CONNECTIONS"] -ne $null) { - $SecondaryRole = $SecondaryRole + (Validate-Option "S_ALLOW_CONNECTIONS" $RDef["S_ALLOW_CONNECTIONS"] @("NO", "READ_ONLY", "ALL") | New-ReplicaOption -Name "ALLOW_CONNECTIONS") - } - if ($RDef["S_READ_ONLY_ROUTING_URL"] -ne $null) { - $SecondaryRole = $SecondaryRole + ($RDef["S_READ_ONLY_ROUTING_URL"] | ConvertTo-SQLString | New-ReplicaOption -Name "ALLOW_CONNECTIONS") - } - if ($SecondaryRole.Length -gt 0) { - $ReplicaOpts = $ReplicaOpts + ("( $($SecondaryRole -join ', ') )" | New-ReplicaOption -Name "SECONDARY_ROLE") - } - - $PrimaryRole = @() - if ($RDef["P_ALLOW_CONNECTIONS"] -ne $null) { - $PrimaryRole = $PrimaryRole + (Validate-Option "P_ALLOW_CONNECTIONS" $RDef["P_ALLOW_CONNECTIONS"] @("READ_WRITE", "ALL") | New-ReplicaOption -Name "ALLOW_CONNECTIONS") - } - if ($RDef["P_READ_ONLY_ROUTING_LIST"] -ne $null) { - $PrimaryRole = $PrimaryRole + ((($RDef["P_READ_ONLY_ROUTING_LIST"] | ForEach-Object { ConvertTo-SQLString $_ }) -join ', ') | New-ReplicaOption -Name "ALLOW_CONNECTIONS") - } - if ($PrimaryRole.Length -gt 0) { - $ReplicaOpts = $ReplicaOpts + ("( $($PrimaryRole -join ', ') )" | New-ReplicaOption -Name "PRIMARY_ROLE") - } - - $ReplicaDefinitionsArray = $ReplicaDefinitionsArray + - # TCP://bravo.murano.local:5022 - "N$(ConvertTo-SQLString $ReplicaName) WITH ($($ReplicaOpts -join ', '))" - } - $ReplicaDefinitions = $ReplicaDefinitionsArray -join ",`r`n "; - - if ($ListenerDef["DHCP"] -ne $null) { - if ($ListenerDef["DHCP"].matches("\d+\.\d+\.\d+\.\d+/\d+\.\d+\.\d+\.\d+")) { - ($IpAddr, $Mask) = $ListenerDef["DHCP"] -split "/" - $ListenerAddr = "DHCP ON ( $IpAddr, $Mask )" - } else { - $ListenerAddr = "DHCP" - } - } else { - [array]$IPAddresses = $ListenerDef["STATIC"] - if (($IPAddresses -eq $null) -or ($IPAddresses.Count -eq 0)) { - $ListenerAddr = "DHCP" - } else { - $ConvertedOpts = @() - foreach ($IpOption in $IPAddresses) { - # IPv4 - if ($IpOption -match "\d+\.\d+\.\d+\.\d+/\d+\.\d+\.\d+\.\d+") { - ($IpAddr, $Mask) = $IpOption -split "/" - $ConvertedOpts = $ConvertedOpts + "( $(ConvertTo-SQLString $IpAddr), $(ConvertTo-SQLString $Mask) )" - continue - } - # IPv6 - if ($IpOption -match "^(((?=(?>.*?::)(?!.*::)))(::)?([0-9A-F]{1,4}::?){0,5}|([0-9A-F]{1,4}:){6})(\2([0-9A-F]{1,4}(::?|$)){0,2}|((25[0-5]|(2[0-4]|1\d|[1-9])?\d)(\.|$)){4}|[0-9A-F]{1,4}:[0-9A-F]{1,4})(? - param( - [parameter(Mandatory = $true)] - [String]$WorkDir - ) - if (-not (Test-Path $WorkDir)) { - throw "Work dir '$WorkDir' not found" - } - $WorkDirObj = Get-Item -Path $WorkDir - $WorkDir = $WorkDirObj.FullName - $GroupName = Get-Content $WorkDirObj.GetFiles("avgroup.name").FullName - - $JoinGroup = "ALTER AVAILABILITY GROUP $(ConvertTo-SQLName $GroupName) JOIN - GO" - [void](Invoke-SQLText -SQL $JoinGroup) - - for ($i = 0; ; $i++) { - $File = $WorkDirObj.GetFiles("db$i.name") - if (-not $File) { - break; - } - $DataBaseName = Get-Content $WorkDirObj.GetFiles("db$i.name").FullName - $RestoreDb = "RESTORE DATABASE $(ConvertTo-SQLName $DataBaseName) FROM DISK = N$(ConvertTo-SQLString "$WorkDir\db$i.bak") WITH FILE = 1, NORECOVERY, NOUNLOAD, REPLACE, STATS = 5 - GO" - [void](Invoke-SQLText -SQL $RestoreDb) - $RestoreLog = "RESTORE LOG $(ConvertTo-SQLName $DataBaseName) FROM DISK = N$(ConvertTo-SQLString "$WorkDir\db$i.log.bak") WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 10 - GO" - [void](Invoke-SQLText -SQL $RestoreLog) - $AlterDB = "ALTER DATABASE $(ConvertTo-SQLName $DataBaseName) SET HADR AVAILABILITY GROUP = $(ConvertTo-SQLName $GroupName) - GO" - [void](Invoke-SQLText -SQL $AlterDB) - } -} - -function New-ReplicaOption { - param( - [parameter(Mandatory = $true)] - [String]$Name, - [parameter(Mandatory = $true, ValueFromPipeline = $true)] - [String]$Value - ) - return "$Name = $Value" -} - -function Validate-Option { - <# - .SYNOPSIS - Checks that the value is one of allowed values - - .DESCRIPTION - Checks that the value is one of allowed values or throws exception otherwise. Returns provided value. - - .PARAMETER Name - Option name. Used only for error message. - - .PARAMETER Value - Option value. - - .PARAMETER Allowed - List of allowed option valus. - #> - param( - [parameter(Mandatory = $true)] - [String]$Name, - [String]$Value, - [Array]$Allowed - ) - if (($Value -eq $null) -or ($Value -eq "")) { - throw "No value was provided for $Name" - } - foreach ($V in $Allowed) { - if ($V -eq $Value) { - return $Value - } - } - throw "Provided value '$Value' for $Name is not one of $($Allowed -join ', ')" -} - -function Validate-IntOption { - <# - .SYNOPSIS - Checks that the value is integer - - .DESCRIPTION - Checks that the value is integer. Returns provided value. - - .PARAMETER Name - Option name. Used only for error message. - - .PARAMETER Value - Option value. - #> - param( - [parameter(Mandatory = $true)] - [String]$Name, - [parameter] - [String]$Value - ) - if (($Value -eq $null) -or ($Value -eq "")) { - throw "No value was provided for $Name" - } - if (-not ("$Value" -match "^[+-]?\d+$")) { - throw "Provided value '$Value' for $Name is not a number" - } - return $Value -} - -function Validate-DefinedOption { - <# - .SYNOPSIS - Checks that the value is not null - - .DESCRIPTION - Checks that the value is not null. Returns provided value. - - .PARAMETER Name - Option name. Used only for error message. - - .PARAMETER Value - Option value. - #> - param( - [parameter(Mandatory = $true)] - [String]$Name, - [parameter(Mandatory = $false)] - [String]$Value - ) - if (($Value -eq $null) -or ($Value -eq "")) { - throw "No value was provided for $Name" - } - return $Value -} - - - diff --git a/muranorepository/Services/scripts/SQLServer/SQLServerOptionParsers.ps1 b/muranorepository/Services/scripts/SQLServer/SQLServerOptionParsers.ps1 deleted file mode 100644 index 1624853..0000000 --- a/muranorepository/Services/scripts/SQLServer/SQLServerOptionParsers.ps1 +++ /dev/null @@ -1,367 +0,0 @@ -function New-OptionParserInstall { - <# - .SYNOPSIS - Creates an option parser for MS SQL Server 2012 setup "INSTALL" action. - - .DESCRIPTION - Use this cmdlet to create an option parser for MS SQL Server 2012 setup "INSTALL" action. - All documented option are supported. See the following link for details: - http://msdn.microsoft.com/en-us/library/ms144259.aspx - #> - $OptionParser = New-OptionParser - - $IsPartOfDomain = (Get-WmiObject Win32_ComputerSystem).PartOfDomain - - $OptionParser.AddOption((New-Option "ACTION" -String -Constraints "INSTALL"), $true, "INSTALL") - $OptionParser.AddOption((New-Option "IACCEPTSQLSERVERLICENSETERMS" -Switch), $true) - $OptionParser.AddOption((New-Option "ENU" -Switch)) - #$OptionParser.AddOption((New-Option "UpdateEnabled" -Switch)) - $OptionParser.AddOption((New-Option "UpdateEnabled" -Boolean)) - $OptionParser.AddOption((New-Option "UpdateSource" -String)) - $OptionParser.AddOption((New-Option "CONFIGURATIONFILE" -String)) - $OptionParser.AddOption((New-Option "ERRORREPORTING" -Boolean)) - $OptionParser.AddOption((New-Option "FEATURES" -List -Constraints ("SQL","SQLEngine","Replication","FullText","DQ","AS","RS","DQC","IS","MDS","Tools","BC","BOL","BIDS","Conn","SSMS","ADV_SSMS","DREPLAY_CTLR","DREPLAY_CLT","SNAC_SDK","SDK","LocalDB"))) - $OptionParser.AddOption((New-Option "ROLE" -String -Constraints ("SPI_AS_ExistingFarm", "SPI_AS_NewFarm", "AllFeatures_WithDefaults"))) - $OptionParser.AddOption((New-Option "INDICATEPROGRESS" -Switch)) - $OptionParser.AddOption((New-Option "INSTALLSHAREDDIR" -String)) - $OptionParser.AddOption((New-Option "INSTALLSHAREDWOWDIR" -String)) - $OptionParser.AddOption((New-Option "INSTANCEDIR" -String)) - $OptionParser.AddOption((New-Option "INSTANCEID" -String)) - $OptionParser.AddOption((New-Option "INSTANCENAME" -String), $true, "MSSQLSERVER") - $OptionParser.AddOption((New-Option "PID" -String)) - $OptionParser.AddOption((New-Option "Q" -Switch)) - $OptionParser.AddOption((New-Option "QS" -Switch)) - $OptionParser.AddOption((New-Option "UIMODE" -String -Constraints ("Normal", "AutoAdvance"))) - $OptionParser.AddOption((New-Option "SQMREPORTING" -Boolean)) - $OptionParser.AddOption((New-Option "HIDECONSOLE" -Switch)) - $OptionParser.AddOption((New-Option "AGTSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "AGTSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "AGTSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - $OptionParser.AddOption((New-Option "ASBACKUPDIR" -String)) - $OptionParser.AddOption((New-Option "ASCOLLATION" -String)) - $OptionParser.AddOption((New-Option "ASCONFIGDIR" -String)) - $OptionParser.AddOption((New-Option "ASDATADIR" -String)) - $OptionParser.AddOption((New-Option "ASLOGDIR" -String)) - $OptionParser.AddOption((New-Option "ASSERVERMODE" -String -Constraints ("MULTIDIMENSIONAL", "POWERPIVOT", "TABULAR"))) - $OptionParser.AddOption((New-Option "ASSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "ASSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "ASSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - - #$OptionParser.AddOption((New-Option "ASSYSADMINACCOUNTS" -String), $true, "$ENV:USERDOMAIN\$ENV:USERNAME") - if ($IsPartOfDomain) { - $OptionParser.AddOption((New-Option "ASSYSADMINACCOUNTS" -String), $true, "$Env:USERDOMAIN\Administrator") - } - else { - $OptionParser.AddOption((New-Option "ASSYSADMINACCOUNTS" -String), $true, "$Env:COMPUTERNAME\Administrator") - } - - $OptionParser.AddOption((New-Option "ASTEMPDIR" -String)) - $OptionParser.AddOption((New-Option "ASPROVIDERMSOLAP" -Boolean)) - $OptionParser.AddOption((New-Option "FARMACCOUNT" -String)) - $OptionParser.AddOption((New-Option "FARMPASSWORD" -String)) - $OptionParser.AddOption((New-Option "PASSPHRASE" -String)) - $OptionParser.AddOption((New-Option "FARMADMINIPORT" -String)) - $OptionParser.AddOption((New-Option "BROWSERSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - $OptionParser.AddOption((New-Option "ENABLERANU" -Switch)) - $OptionParser.AddOption((New-Option "INSTALLSQLDATADIR" -String)) - $OptionParser.AddOption((New-Option "SAPWD" -String)) - $OptionParser.AddOption((New-Option "SECURITYMODE" -String -Constrainrs ("SQL"))) - $OptionParser.AddOption((New-Option "SQLBACKUPDIR" -String)) - $OptionParser.AddOption((New-Option "SQLCOLLATION" -String)) - $OptionParser.AddOption((New-Option "ADDCURRENTUSERASSQLADMIN" -Switch)) - $OptionParser.AddOption((New-Option "SQLSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "SQLSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "SQLSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - - #$OptionParser.AddOption((New-Option "SQLSYSADMINACCOUNTS" -String), $true, "$ENV:USERDOMAIN\$ENV:USERNAME") - if ($IsPartOfDomain) { - $OptionParser.AddOption((New-Option "SQLSYSADMINACCOUNTS" -String), $true, "$ENV:USERDOMAIN\Administrator") - } - else { - $OptionParser.AddOption((New-Option "SQLSYSADMINACCOUNTS" -String), $true, "$ENV:COMPUTERNAME\Administrator") - } - - $OptionParser.AddOption((New-Option "SQLTEMPDBDIR" -String)) - $OptionParser.AddOption((New-Option "SQLTEMPDBLOGDIR" -String)) - $OptionParser.AddOption((New-Option "SQLUSERDBDIR" -String)) - $OptionParser.AddOption((New-Option "SQLUSERDBLOGDIR" -String)) - $OptionParser.AddOption((New-Option "FILESTREAMLEVEL" -String -Constraints ("0", "1", "2", "3"))) - $OptionParser.AddOption((New-Option "FILESTREAMSHARENAME" -String)) - $OptionParser.AddOption((New-Option "FTSVCACCOUNT" -String)) - $OptionParser.AddOption((New-Option "FTSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "ISSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "ISSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "ISSVCStartupType" -String -Constraints ("Manual", "Automatic", "Disabled"))) - $OptionParser.AddOption((New-Option "NPENABLED" -Boolean)) - $OptionParser.AddOption((New-Option "TCPENABLED" -Boolean)) - $OptionParser.AddOption((New-Option "RSINSTALLMODE" -String -Constraints ("SharePointFilesOnlyMode", "DefaultNativeMode", "FilesOnlyMode"))) - $OptionParser.AddOption((New-Option "RSSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "RSSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "RSSVCStartupType" -String -Constraints ("Manual", "Automatic", "Disabled"))) - - return $OptionParser -} - -function New-OptionParserPrepareImage { - <# - .SYNOPSIS - Creates an option parser for MS SQL Server 2012 setup "PrepareImage" action. - - .DESCRIPTION - Use this cmdlet to create an option parser for MS SQL Server 2012 setup "PrepareImage" action. - - Note that for installer version of MS SQL Server prior to 2012 SP1 Cumulative Update 2 only the - following features are supported: SQLEngine, Replication, FullText, RS - - All documented option are supported. See the following link for details: - http://msdn.microsoft.com/en-us/library/ms144259.aspx - #> - $OptionParser = New-OptionParser - - $OptionParser.AddOption((New-Option "ACTION" -String -Constraints "PrepareImage"), $true, "PrepareImage") - $OptionParser.AddOption((New-Option "IACCEPTSQLSERVERLICENSETERMS" -Switch), $true) - $OptionParser.AddOption((New-Option "ENU" -Switch)) - $OptionParser.AddOption((New-Option "UpdateEnabled" -Switch)) - $OptionParser.AddOption((New-Option "UpdateSource" -String)) - $OptionParser.AddOption((New-Option "CONFIGURATIONFILE" -String)) -# $OptionParser.AddOption((New-Option "FEATURES" -List -Constraints ("SQLEngine","Replication","FullText","RS"))) - $OptionParser.AddOption((New-Option "FEATURES" -List -Constraints ("SQL","SQLEngine","Replication","FullText","DQ","AS","RS","DQC","IS","MDS","Tools","BC","BOL","BIDS","Conn","SSMS","ADV_SSMS","DREPLAY_CTLR","DREPLAY_CLT","SNAC_SDK","SDK","LocalDB"))) - $OptionParser.AddOption((New-Option "HIDECONSOLE" -Switch)) - $OptionParser.AddOption((New-Option "INDICATEPROGRESS" -Switch)) - $OptionParser.AddOption((New-Option "INSTALLSHAREDDIR" -String)) - $OptionParser.AddOption((New-Option "INSTANCEDIR" -String)) - $OptionParser.AddOption((New-Option "INSTANCEID" -String), $true, "MSSQLSERVER") - $OptionParser.AddOption((New-Option "Q" -Switch)) - $OptionParser.AddOption((New-Option "QS" -Switch)) - - return $OptionParser -} - -function New-OptionParserPrepareImageSP1U2 { - <# - .SYNOPSIS - Creates an option parser for MS SQL Server 2012 setup "PrepareImage" action. - - .DESCRIPTION - Use this cmdlet to create an option parser for MS SQL Server 2012 setup "PrepareImage" action. - - This cmdlet should be used only for MS SQL Server 2012 SP1 Cimilative Update 2 or later. - - Note that for installer version of MS SQL Server prior to 2012 SP1 Cimilative Update 2 only the - following features are supported: SQLEngine, Replication, FullText, RS - - All documented option are supported. See the following link for details: - http://msdn.microsoft.com/en-us/library/ms144259.aspx - #> - $OptionParser = New-OptionParser - - $OptionParser.AddOption((New-Option "ACTION" -String -Constraints "PrepareImage"), $true, "PrepareImage") - $OptionParser.AddOption((New-Option "IACCEPTSQLSERVERLICENSETERMS" -Switch), $true) - $OptionParser.AddOption((New-Option "ENU" -Switch)) - $OptionParser.AddOption((New-Option "UpdateEnabled" -Switch)) - $OptionParser.AddOption((New-Option "UpdateSource" -String)) - $OptionParser.AddOption((New-Option "CONFIGURATIONFILE" -String)) - $OptionParser.AddOption((New-Option "FEATURES" -List -Constraints ("SQL","SQLEngine","Replication","FullText","DQ","AS","RS","DQC","IS","MDS","Tools","BC","BOL","BIDS","Conn","SSMS","ADV_SSMS","SNAC_SDK","SDK","LocalDB"))) - $OptionParser.AddOption((New-Option "HIDECONSOLE" -Switch)) - $OptionParser.AddOption((New-Option "INDICATEPROGRESS" -Switch)) - $OptionParser.AddOption((New-Option "INSTALLSHAREDDIR" -String)) - $OptionParser.AddOption((New-Option "INSTANCEDIR" -String)) - $OptionParser.AddOption((New-Option "INSTANCEID" -String), $true, "MSSQLSERVER") - $OptionParser.AddOption((New-Option "Q" -Switch)) - $OptionParser.AddOption((New-Option "QS" -Switch)) - - return $OptionParser -} - -function New-OptionParserCompleteImage { - <# - .SYNOPSIS - Creates an option parser for MS SQL Server 2012 setup "CompleteImage" action. - - .DESCRIPTION - Use this cmdlet to create an option parser for MS SQL Server 2012 setup "CompleteImage" action. - - Note that INSTANCEID parameter value MUST be the same as specified on "PrepareImage" phase. - - All documented option are supported. See the following link for details: - http://msdn.microsoft.com/en-us/library/ms144259.aspx - #> - $OptionParser = New-OptionParser - - $OptionParser.AddOption((New-Option "ACTION" -String -Constraints "CompleteImage"), $true, "CompleteImage") - $OptionParser.AddOption((New-Option "IACCEPTSQLSERVERLICENSETERMS" -Switch), $true) - $OptionParser.AddOption((New-Option "ENU" -Switch)) - $OptionParser.AddOption((New-Option "CONFIGURATIONFILE" -String)) - $OptionParser.AddOption((New-Option "ERRORREPORTING" -Boolean)) - $OptionParser.AddOption((New-Option "INDICATEPROGRESS" -Switch)) - $OptionParser.AddOption((New-Option "INSTANCEID" -String), $true, "MSSQLSERVER") - $OptionParser.AddOption((New-Option "INSTANCENAME" -String), $true, "MSSQLSERVER") - $OptionParser.AddOption((New-Option "PID" -String)) - $OptionParser.AddOption((New-Option "Q" -Switch)) - $OptionParser.AddOption((New-Option "QS" -Switch)) - $OptionParser.AddOption((New-Option "SQMREPORTING" -Boolean)) - $OptionParser.AddOption((New-Option "HIDECONSOLE" -Switch)) - $OptionParser.AddOption((New-Option "AGTSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "AGTSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "AGTSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - $OptionParser.AddOption((New-Option "BROWSERSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - $OptionParser.AddOption((New-Option "ENABLERANU" -Switch)) - $OptionParser.AddOption((New-Option "INSTALLSQLDATADIR" -String)) - $OptionParser.AddOption((New-Option "SAPWD" -String)) - $OptionParser.AddOption((New-Option "SECURITYMODE" -String -Constrainrs ("SQL"))) - $OptionParser.AddOption((New-Option "SQLBACKUPDIR" -String)) - $OptionParser.AddOption((New-Option "SQLCOLLATION" -String)) - $OptionParser.AddOption((New-Option "SQLSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "SQLSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "SQLSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - $OptionParser.AddOption((New-Option "SQLSYSADMINACCOUNTS" -String), $true, "$ENV:USERDOMAIN\$ENV:USERNAME") - $OptionParser.AddOption((New-Option "SQLTEMPDBDIR" -String)) - $OptionParser.AddOption((New-Option "SQLTEMPDBLOGDIR" -String)) - $OptionParser.AddOption((New-Option "SQLUSERDBDIR" -String)) - $OptionParser.AddOption((New-Option "SQLUSERDBLOGDIR" -String)) - $OptionParser.AddOption((New-Option "FILESTREAMLEVEL" -String -Constraints ("0", "1", "2", "3"))) - $OptionParser.AddOption((New-Option "FILESTREAMSHARENAME" -String)) - $OptionParser.AddOption((New-Option "FTSVCACCOUNT" -String)) - $OptionParser.AddOption((New-Option "FTSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "NPENABLED" -Boolean)) - $OptionParser.AddOption((New-Option "TCPENABLED" -Boolean)) - $OptionParser.AddOption((New-Option "RSINSTALLMODE" -String -Constraints ("SharePointFilesOnlyMode", "DefaultNativeMode", "FilesOnlyMode"))) - $OptionParser.AddOption((New-Option "RSSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "RSSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "RSSVCStartupType" -String -Constraints ("Manual", "Automatic", "Disabled"))) - - return $OptionParser -} - -function New-OptionParserCompleteImageSP1U2 { - <# - .SYNOPSIS - Creates an option parser for MS SQL Server 2012 setup "CompleteImage" action. - - .DESCRIPTION - Use this cmdlet to create an option parser for MS SQL Server 2012 setup "CompleteImage" action. - - This cmdlet should be used only for MS SQL Server 2012 SP1 Cimilative Update 2 or later. - - All documented option are supported. See the following link for details: - http://msdn.microsoft.com/en-us/library/ms144259.aspx - #> - $OptionParser = New-OptionParser - - $OptionParser.AddOption((New-Option "ACTION" -String -Constraints "CompleteImage"), $true, "CompleteImage") - $OptionParser.AddOption((New-Option "IACCEPTSQLSERVERLICENSETERMS" -Switch), $true) - $OptionParser.AddOption((New-Option "ENU" -Switch)) - $OptionParser.AddOption((New-Option "CONFIGURATIONFILE" -String)) - $OptionParser.AddOption((New-Option "ERRORREPORTING" -Boolean)) - $OptionParser.AddOption((New-Option "INDICATEPROGRESS" -Switch)) - $OptionParser.AddOption((New-Option "INSTANCEID" -String)) - $OptionParser.AddOption((New-Option "INSTANCENAME" -String)) - $OptionParser.AddOption((New-Option "PID" -String)) - $OptionParser.AddOption((New-Option "Q" -Switch)) - $OptionParser.AddOption((New-Option "QS" -Switch)) - $OptionParser.AddOption((New-Option "SQMREPORTING" -Boolean)) - $OptionParser.AddOption((New-Option "HIDECONSOLE" -Switch)) - $OptionParser.AddOption((New-Option "AGTSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "AGTSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "AGTSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - $OptionParser.AddOption((New-Option "BROWSERSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - $OptionParser.AddOption((New-Option "ENABLERANU" -Switch)) - $OptionParser.AddOption((New-Option "INSTALLSQLDATADIR" -String)) - $OptionParser.AddOption((New-Option "SAPWD" -String)) - $OptionParser.AddOption((New-Option "SECURITYMODE" -String -Constrainrs ("SQL"))) - $OptionParser.AddOption((New-Option "SQLBACKUPDIR" -String)) - $OptionParser.AddOption((New-Option "SQLCOLLATION" -String)) - $OptionParser.AddOption((New-Option "SQLSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "SQLSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "SQLSVCSTARTUPTYPE" -String -Constraints ("Manual", "Automatic", "Disabled"))) - $OptionParser.AddOption((New-Option "SQLSYSADMINACCOUNTS" -String), $true, "$ENV:USERDOMAIN\$ENV:USERNAME") - $OptionParser.AddOption((New-Option "SQLTEMPDBDIR" -String)) - $OptionParser.AddOption((New-Option "SQLTEMPDBLOGDIR" -String)) - $OptionParser.AddOption((New-Option "SQLUSERDBDIR" -String)) - $OptionParser.AddOption((New-Option "SQLUSERDBLOGDIR" -String)) - $OptionParser.AddOption((New-Option "FILESTREAMLEVEL" -String -Constraints ("0", "1", "2", "3"))) - $OptionParser.AddOption((New-Option "FILESTREAMSHARENAME" -String)) - $OptionParser.AddOption((New-Option "FTSVCACCOUNT" -String)) - $OptionParser.AddOption((New-Option "FTSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "NPENABLED" -Boolean)) - $OptionParser.AddOption((New-Option "TCPENABLED" -Boolean)) - $OptionParser.AddOption((New-Option "RSINSTALLMODE" -String -Constraints ("SharePointFilesOnlyMode", "DefaultNativeMode", "FilesOnlyMode"))) - $OptionParser.AddOption((New-Option "RSSVCACCOUNT" -String), $true, "NT AUTHORITY\Network Service") - $OptionParser.AddOption((New-Option "RSSVCPASSWORD" -String)) - $OptionParser.AddOption((New-Option "RSSVCStartupType" -String -Constraints ("Manual", "Automatic", "Disabled"))) - - return $OptionParser -} - -function New-OptionParserUpgrade { - # ToDo: Implement - throw "Not yet implemented" -} - -function New-OptionParserEditionUpgrade { - # ToDo: Implement - throw "Not yet implemented" -} - -function New-OptionParserRepair { - # ToDo: Implement - throw "Not yet implemented" -} - -function New-OptionParserRebuilddatabase { - # ToDo: Implement - throw "Not yet implemented" -} - -function New-OptionParserUninstall { - <# - .SYNOPSIS - Creates an option parser for MS SQL Server 2012 setup "INSTALL" action. - - .DESCRIPTION - Use this cmdlet to create an option parser for MS SQL Server 2012 setup "INSTALL" action. - All documented option are supported. See the following link for details: - http://msdn.microsoft.com/en-us/library/ms144259.aspx - #> - $OptionParser = New-OptionParser - - $OptionParser.AddOption((New-Option "ACTION" -String -Constraints "UNINSTALL"), $true, "UNINSTALL") - $OptionParser.AddOption((New-Option "CONFIGURATIONFILE" -String)) - $OptionParser.AddOption((New-Option "FEATURES" -List -Constraints ("SQL","SQLEngine","Replication","FullText","DQ","AS","RS","DQC","IS","MDS","Tools","BC","BOL","BIDS","Conn","SSMS","ADV_SSMS","DREPLAY_CTLR","DREPLAY_CLT","SNAC_SDK","SDK","LocalDB")), $true) - $OptionParser.AddOption((New-Option "INDICATEPROGRESS" -Switch)) - $OptionParser.AddOption((New-Option "INSTANCENAME" -String), $true, "MSSQLSERVER") - $OptionParser.AddOption((New-Option "Q" -Switch)) - $OptionParser.AddOption((New-Option "HIDECONSOLE" -Switch)) - - return $OptionParser -} - -function New-OptionParserInstallFailoverCluster { - # ToDo: Implement - throw "Not yet implemented" -} - -function New-OptionParserPrepareFailoverCluster { - # ToDo: Implement - throw "Not yet implemented" -} - -function New-OptionParserCompleteFailoverCluster { - # ToDo: Implement - throw "Not yet implemented" -} - -function New-OptionParserUpgrade { - # ToDo: Implement - throw "Not yet implemented" -} - -function New-OptionParserAddNode { - # ToDo: Implement - throw "Not yet implemented" -} - -function New-OptionParserRemoveNode { - # ToDo: Implement - throw "Not yet implemented" -} diff --git a/muranorepository/Services/scripts/Set-LocalUserPassword.ps1 b/muranorepository/Services/scripts/Set-LocalUserPassword.ps1 deleted file mode 100644 index 8708a0f..0000000 --- a/muranorepository/Services/scripts/Set-LocalUserPassword.ps1 +++ /dev/null @@ -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." - } - } -} - diff --git a/muranorepository/Services/scripts/SqlServerCluster/Failover-Cluster.ps1 b/muranorepository/Services/scripts/SqlServerCluster/Failover-Cluster.ps1 deleted file mode 100644 index e082994..0000000 --- a/muranorepository/Services/scripts/SqlServerCluster/Failover-Cluster.ps1 +++ /dev/null @@ -1,239 +0,0 @@ -<# -.DESCRIPTION - -## Failover Cluster Input Data (from the UI) - -* Domain Membership - - [String] / [Select box] $DomainName - Domain name -* Domain User Credentials - - [String] $UserName - Username - - [Password string] $UserPassword - User password -* Shared Folder Information - - [String] $ShareServer - Server which will host the folder - - [String] $ShareName - Share name - - [String] $SharePath - Shared folder internal path -* Failover Cluster Members - - [String] $ClusterName - Cluster name - - [String] $ClusterIP - Static IP address that will be assigned to the cluster - - [String[]] $ClusterNodes - List of node names - - - -## Failover Cluster creation workflow - -* Create AD domain -* Join all the VMs to that domain -* Prepare nodes - - Install Failover Cluster prerequisites on all FC nodes -* Create failover cluster - - Create new cluster - - Add members -* Confugure FC quorum - - Create new folder that will be shared - - Share that folder with appropriate permissions - - Configure quorum mode - - - -## Helpful SmbShare* Functions - -* New-SmbShare -* Grant-SmbShareAccess - -#> - -trap { - &$TrapHandler -} - - - -function Install-FailoverClusterPrerequisites { - #Import-Module FailoverClusters - - #Add-WindowsFeature Failover-Clustering, RSAT-Clustering-PowerShell -} - - - -function New-FailoverClusterSharedFolder { - param ( - [String] $ClusterName, - [String] $DomainName, - [String] $ShareServer, - [String] $SharePath = $($Env:SystemDrive + '\FCShare'), - [String] $ShareName = 'FCShare', - [String] $UserName, - [String] $UserPassword, - $Credential = $null - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - Write-Log "--> New-FailoverClusterSharedFolder" - - Write-Log "Creating shared folder for Failover Cluster ..." - - if ($Credential -eq $null) { - $Credential = New-Credential -UserName "$DomainName\$UserName" -Password "$UserPassword" - } - - if ((Test-Connection -ComputerName $ShareServer -Count 1 -Quiet) -eq $false) { - throw("Server '$ShareServer' is unreachable via ICMP.") - } - - $Session = New-PSSession -ComputerName $ShareServer -Credential $Credential - - Write-Log "Creating folder on '$ShareServer' ..." - Invoke-Command -Session $Session -ScriptBlock { - param ( - [String] $SharePath, - [String] $ShareName, - [String] $ClusterAccount - ) - - Remove-SmbShare -Name $ShareName -Force -ErrorAction 'SilentlyContinue' - Remove-Item -Path $SharePath -Force -ErrorAction 'SilentlyContinue' - - New-Item -Path $SharePath -ItemType Container -Force - - New-SmbShare -Path $SharePath ` - -Name $ShareName ` - -FullAccess "$ClusterAccount", 'Everyone' ` - -Description "Shared folder for Failover Cluster." - - } -ArgumentList $SharePath, $ShareName, "$DomainName\$ClusterName`$" - - Write-Log "Confguring Failover Cluster to use shared folder as qourum resourse ..." - - $null = Set-ClusterQuorum -NodeAndFileShareMajority "\\$ShareServer\$ShareName" - - Write-Log "<-- New-FailoverClusterSharedFolder" - } -} - - - -function New-FailoverCluster { - param ( - [String] $ClusterName, - [String] $StaticAddress, - [String[]] $ClusterNodes, - [String] $DomainName, - [String] $UserName, - [String] $UserPassword, - $Credential - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - Write-Log "ClusterNodes: $($ClusterNodes -join ', ')" - - if ($Credential -eq $null) { - $Credential = New-Credential -UserName "$DomainName\$UserName" -Password "$UserPassword" - } - - foreach ($Node in $ClusterNodes) { - Write-LogDebug "Installing Failover Cluster modules on '$Node' ..." - $null = Invoke-Command ` - -ComputerName $Node ` - -Credential $Credential ` - -ScriptBlock { - Add-WindowsFeature Failover-Clustering, RSAT-Clustering-PowerShell - } - } - - Import-Module FailoverClusters - - if ((Get-Cluster $ClusterName -ErrorAction SilentlyContinue) -eq $null) { - Write-Log "Creating new cluster '$ClusterName' ..." -<# - Start-PowerShellProcess -Command @" -Import-Module FailoverClusters -New-Cluster -Name '$ClusterName' -StaticAddress '$StaticAddress' -"@ -Credential $Credential -NoBase64 -#> - New-Cluster -Name "$ClusterName" -StaticAddress "$StaticAddress" - Start-Sleep -Seconds 30 - } - else { - Write-Log "Cluster '$ClusterName' already exists." - } - - foreach ($Node in $ClusterNodes) { - Write-Log "Adding node '$Node' to the cluster '$ClusterName' ..." - if ((Get-ClusterNode $Node -ErrorAction SilentlyContinue) -eq $null) { - Write-Log "Adding node ..." -<# - Start-PowerShellProcess -Command @" -Import-Module FailoverClusters -Add-ClusterNode -Cluster '$ClusterName' -Name '$Node' -"@ -Credential $Credential -NoBase64 -#> - Add-ClusterNode -Cluster "$ClusterName" -Name "$Node" - } - else { - Write-Log "Node '$Node' already a part of the cluster '$ClusterName'." - } - } - } -} - - - -<# - -# Example - -$DomainName = 'fc-acme.local' -$DomainUser = 'Administrator' -$DomainPassword = 'P@ssw0rd' - -$ClusterName = 'fc-test' -$ClusterIP = '10.200.0.60' -$ClusterNodes = @('fc-node-01','fc-node-02','fc-node-03') - -$ShareServer = 'fc-dc-01' -$ShareName = 'FCShare' - -$SharePath = "C:\$ShareName" - - - -Import-Module CoreFunctions -Force - -$Creds = New-Credential ` - -UserName "$DomainName\$DomainUser" ` - -Password "$DomainPassword" - -New-FailoverCluster ` - -ClusterName $ClusterName ` - -StaticAddress $ClusterIP ` - -ClusterNodes $ClusterNodes ` - -Credential $Creds - -New-FailoverClusterSharedFolder ` - -ClusterName $ClusterName ` - -DomainName $DomainName ` - -ShareServer $ShareServer ` - -SharePath "$SharePath" ` - -ShareName "$ShareName" ` - -Credential $Creds - -#> diff --git a/muranorepository/Services/scripts/SqlServerCluster/SQLServerForAOAG.ps1 b/muranorepository/Services/scripts/SqlServerCluster/SQLServerForAOAG.ps1 deleted file mode 100644 index ae40b73..0000000 --- a/muranorepository/Services/scripts/SqlServerCluster/SQLServerForAOAG.ps1 +++ /dev/null @@ -1,538 +0,0 @@ - -trap { - &$TrapHandler -} - -function Install-SqlServerPowerShellModule { - param ( - [String] $SetupRoot = '' - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - if ((Get-Module SQLPS -ListAvailable) -ne $null) { - Write-Log "Module SQLSP already installed." - return - } - - if ($MuranoFileShare -eq '') { - $MuranoFileShare = [String]([Environment]::GetEnvironmentVariable('MuranoFileShare')) - if ($MuranoFileShare -eq '') { - throw "Unable to find MuranoFileShare path." - } - } - Write-LogDebug "MuranoFileShare = '$MuranoFileShare'" - - if ($SetupRoot -eq '') { - $SetupRoot = [IO.Path]::Combine("$MuranoFileShare", 'Prerequisites\SQL Server\Tools') - } - Write-LogDebug "SetupRoot = '$SetupRoot'" - - $FileList = @( - 'SQLSysClrTypes.msi', - 'SharedManagementObjects.msi', - 'PowerShellTools.msi' - ) - - foreach ($MsiFile in $FileList) { - Write-Log "Trying to install '$MsiFile' ..." - $MsiPath = Join-Path $SetupRoot $MsiFile - if ([IO.File]::Exists($MsiPath)) { - Write-Log "Starting msiexe ..." - $Result = Exec -FilePath "msiexec.exe" -ArgumentList @('/i', "`"$MsiPath`"", '/quiet') -PassThru - if ($Result.ExitCode -ne 0) { - throw "Installation of MSI package '$MsiPath' failed with error code '$($Result.ExitCode)'" - } - } - else { - Write-Log "File '$MsiPath' not found." - } - } - } -} - - - -function Install-SqlServerForAOAG { - param ( - # Path to folder where msi files for additional SQL features are located - [String] $SetupRoot = '', - - # Path to folder where msi files for additional SQLPS module are located - [String] $SqlpsSetupRoot = '', - - [String] $MuranoFileShare = '', - - # (REQUIRED) Domain name - [String] $SQLServiceUserDomain = 'fc-acme.local', - - # (REQUIRED) User name for the account which will be used by SQL service - [String] $SQLServiceUserName = 'Administrator', - - # (REQUIRED) Password for that user - [String] $SQLServiceUserPassword = 'P@ssw0rd', - - [Switch] $UpdateEnabled - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - if ($MuranoFileShare -eq '') { - $MuranoFileShare = [String]([Environment]::GetEnvironmentVariable('MuranoFileShare')) - if ($MuranoFileShare -eq '') { - throw "Unable to find MuranoFileShare path." - } - } - Write-LogDebug "MuranoFileShare = '$MuranoFileShare'" - - if ($SetupRoot -eq '') { - $SetupRoot = [IO.Path]::Combine("$MuranoFileShare", 'Prerequisites\SQL Server\2012') - } - Write-LogDebug "SetupRoot = '$SetupRoot'" - - $ExtraOptions = @{} - - if ($UpdateEnabled) { - $ExtraOptions += @{'UpdateEnabled' = $true} - } - else { - $ExtraOptions += @{'UpdateEnabled' = $false} - } - - $null = New-SQLServerForAOAG ` - -SetupRoot $SetupRoot ` - -SQLSvcUsrDomain $SQLServiceUserDomain ` - -SQLSvcUsrName $SQLServiceUserName ` - -SQLSvcUsrPassword $SQLServiceUserPassword ` - -ExtraOptions $ExtraOptions - } -} - - - -function Initialize-AlwaysOnAvailabilityGroup { - param ( - [String] $DomainName, - [String] $DomainAdminAccountName, - [String] $DomainAdminAccountPassword, - [String] $SqlServiceAccountName, - [String] $PrimaryNode, - [String] $ShareName = 'SharedWorkDir' - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - $ShareNetworkPath = '\\' + $PrimaryNode + '\' + $ShareName - - $DomainAdminAccountCreds = New-Credential ` - -UserName "$DomainName\$DomainAdminAccountName" ` - -Password "$DomainAdminAccountPassword" - - $FunctionsFile = Export-Function 'Get-NextFreePort', 'Initialize-AlwaysOn' - - $null = Start-PowerShellProcess @" -trap { - `$_ - exit 1 -} - -Import-Module CoreFunctions - -Write-Log "Importing functions file '$FunctionsFile' ..." -. "$FunctionsFile" - -Write-Log "Starting 'Initialize-AlwaysOn' ..." -`$XmlFile = [IO.Path]::Combine("$ShareNetworkPath", "`$(`$Env:ComputerName).xml") -Write-Log "Output XML file is '`$XmlFile'" -Initialize-AlwaysOn | Export-CliXml -Path `$XmlFile -"@ -Credential $DomainAdminAccountCreds -NoBase64 - } -} - - -function New-SharedFolderForAOAG { - param ( - # (OPTIONAL) - [String] $SharePath = [IO.Path]::Combine($Env:SystemDrive + '\', 'SharedWorkDir'), - - # (OPTIONAL) - [String] $ShareName = 'SharedWorkDir', - - [String] $PrimaryNode = ' ' - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - if ($PrimaryNode.ToLower() -ne ($Env:ComputerName).ToLower()) { - Write-Log "This script runs on primary node only." - Write-Log "Exiting script." - return - } - - if ($ShareName -eq '') { - $ShareName = [IO.Path]::GetFileNameWithoutExtension($SharePath) - } - - Write-LogDebug "SharePath = '$SharePath'" - Write-LogDebug "ShareName = '$ShareName'" - - try { - Write-LogDebug "Trying to remove share '$ShareName'" - $null = Get-SmbShare -Name $ShareName -ErrorAction 'Stop' - $null = Remove-SmbShare -Name $ShareName -Force - write-Log "Share '$ShareName' removed." - } - catch { - Write-LogWarning "Share '$ShareName' not exists or cannot be deleted." - } - - try { - Write-LogDebug "Trying to remove folder '$SharePath" - $null = Get-Item -Path $SharePath -ErrorAction 'Stop' - $null = Remove-Item -Path $SharePath -Recurse -Force - Write-Log "Folder '$SharePath' removed." - } - catch { - Write-LogWarning "Folder '$SharePath' not exists or cannot be deleted." - } - - $null = New-Item -Path $SharePath -ItemType Container -Force - - $null = New-SmbShare -Path $SharePath ` - -Name $ShareName ` - -FullAccess "Everyone" ` - -Description "Shared folder for AlwaysOn Availability Group setup." - - return '\\' + $Env:ComputerName + '\' + $ShareName - } -} - - - -function New-DatabaseForAOAG { - param ( - [String] $DatabaseName, - [String] $DomainName, - [String] $UserName, - [String] $UserPassword - ) - - $Creds = New-Credential -UserName "$DomainName\$UserName" -Password "$UserPassword" - - $FunctionsFile = Export-Function 'Invoke-SQLText', 'ConvertTo-SQLName', 'ConvertTo-SQLString', 'New-SQLDatabase' - - Start-PowerShellProcess @" -trap { - `$_ - exit 1 -} - -Import-Module CoreFunctions - -Write-Log "Importing functions from file '$FunctionsFile' ..." -. "$FunctionsFile" - -Write-Log "Starting 'New-SQLDatabase' ..." -New-SQLDatabase $DatabaseName -"@ -Credential $Creds -NoBase64 -} - - - -function Initialize-AOAGPrimaryReplica { - param ( - # (OPTIONAL) Name of the new Availability Group. If not specified then default name will be used. - [String] $GroupName = 'MuranoAG', - - # (REQUIRED) Nodes that will be configured as replica partners. - #[Parameter(Mandatory=$true)] - [String[]] $NodeList, - - # (REQUIRED) Node name that will be primary for selected Availability Group - #[Parameter(Mandatory=$true)] - [String] $PrimaryNode, - - # (REQUIRED) Database list that will be added to the Availability Group - #[Parameter(Mandatory=$true)] - [String[]] $DatabaseList, - - # (REQUIRED) Listener name that will be used by clients to connect to databases in that AG - #[Parameter(Mandatory=$true)] - [String] $ListenerName = 'MuranoAG_Listener', - - # (REQUIRED) IP address of the listener - #[Parameter(Mandatory=$true)] - [String] $ListenerIP, - - [String] $ListenerIPMask = '255.255.255.0', - - [String] $ListenerPort = '5023', - - # Sync Mode Node List - [String[]] $SyncModeNodeList, - - [String] $SharedWorkDir = 'SharedWorkDir', - - [String] $CliXmlFile = '', - - [String] $DomainName, - [String] $UserName, - [String] $UserPassword - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - Write-Log "Primary node: '$($PrimaryNode.ToLower())'" - Write-Log "Current node: '$(($Env:ComputerName).ToLower())'" - - if ($PrimaryNode.ToLower() -ne $($Env:ComputerName).ToLower()) { - Write-Log "This function works on PrimaryNode only." - Write-Log "Exiting." - return - } - - if ($CliXmlFile -eq '') { - $ReplicaDefinitionList = @() - foreach ($Node in $NodeList) { - try { - $NodeEndpointPort = Import-CliXml -Path "\\$PrimaryNode\SharedWorkDir\$Node.xml" - } - catch { - Write-Log "Using default endpoint port 5022" - $NodeEndpointPort = 5022 - } - - $ReplicaDefinition = @{ - "SERVER_INSTANCE" = "$Node"; - "ENDPOINT_URL" = "TCP://${Node}:${NodeEndpointPort}"; - "AVAILABILITY_MODE" = "ASYNCHRONOUS_COMMIT"; - "FAILOVER_MODE"="MANUAL"; - } - - if ($SyncModeNodeList -contains $Node) { - Write-Log "$Node is in SyncModeNodeList" - $ReplicaDefinition['AVAILABILITY_MODE'] = "SYNCHRONOUS_COMMIT" - $ReplicaDefinition['FAILOVER_MODE'] = "AUTOMATIC" - } - else { - Write-Log "$Node is NOT in SyncModeNodeList" - } - - $ReplicaDefinitionList += @($ReplicaDefinition) - } - - $Preferences = @{} - - $ListenerDefinition = @{ - "NAME"=$ListenerName; - "PORT" = "$ListenerPort"; - "STATIC" = "$ListenerIP/$ListenerIPMask" - } - - $Parameters = @{ - 'WorkDir' = "\\$PrimaryNode\$SharedWorkDir"; - 'Name' = $GroupName; - 'DatabaseNames' = $DatabaseList; - 'ReplicaDefs' = $ReplicaDefinitionList; - 'Preferences' = $Preferences; - 'ListenerDef' = $ListenerDefinition; - } - - $null = Remove-Item -Path "\\$PrimaryNode\SharedWorkDir\*" -Force - - $CliXmlFile = [IO.Path]::GetTempFileName() - - Write-LogDebug "CliXml file: '$CliXmlFile'" - - $null = Export-CliXml -Path $CliXmlFile -InputObject $Parameters -Depth 10 - - $null = Initialize-AOAGPrimaryReplica ` - -CliXmlFile $CliXmlFile ` - -DomainName $DomainName ` - -UserName $UserName ` - -UserPassword $UserPassword ` - -PrimaryNode $PrimaryNode - - Write-LogDebug "Inner 'Initialize-AOAGPrimaryReplica' call completed." - } - else { - $Creds = New-Credential -UserName "$DomainName\$UserName" -Password "$UserPassword" - - $FunctionsFile = Export-Function -All - - $null = Start-PowerShellProcess @" -trap { - `$_ - exit 1 -} - -Import-Module CoreFunctions - -Write-Log "Importing functions from '$FunctionsFile' ..." -. "$FunctionsFile" - -Write-Log "Importing CliXml parameters file ..." -`$Parameters = Import-CliXml -Path $CliXmlFile - -Write-Log "Starting 'New-AlwaysOnAvailabilityGroup' ..." -New-AlwaysOnAvailabilityGroup `` - -WorkDir `$Parameters['WorkDir'] `` - -Name `$Parameters['Name'] `` - -DatabaseNames `$Parameters['DatabaseNames'] `` - -ReplicaDefs `$Parameters['ReplicaDefs'] `` - -Preferences `$Parameters['Preferences'] `` - -ListenerDef `$Parameters['ListenerDef'] -"@ -Credential $Creds -NoBase64 - } - } -} - - - -function Initialize-AOAGSecondaryReplica { - param ( - # (REQUIRED) Nodes that will be configured as replica partners. - [Parameter(Mandatory=$true)] - [String[]] $NodeList, - - # (REQUIRED) Node name that will be primary for selected Availability Group - [Parameter(Mandatory=$true)] - [String] $PrimaryNode, - - [String] $SharedWorkDir = 'SharedWorkDir', - - [String] $DomainName, - [String] $UserName, - [String] $UserPassword - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - if ($PrimaryNode.ToLower() -eq ($Env:ComputerName).ToLower()) { - Write-Log "This function works on any SecondaryNode only." - Write-Log "Exiting." - return - } - - $Creds = New-Credential -UserName "$DomainName\$UserName" -Password "$UserPassword" - - $FunctionsFile = Export-Function -All - - $null = Start-PowerShellProcess @" -trap { - $_ - exit 1 -} - -Import-Module CoreFunctions - -Write-Log "Importing functions from '$FunctionsFile' ..." -. "$FunctionsFile" - -Write-Log "Starting 'New-AlwaysOnAvailabilityGroupReplica' ..." -New-AlwaysOnAvailabilityGroupReplica -WorkDir "\\$PrimaryNode\$SharedWorkDir" -"@ -Credential $Creds -NoBase64 - } -} - - - -function Disable-Firewall { - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - netsh advfirewall set allprofiles state off - } -} - - - -function Enable-Firewall { - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - netsh advfirewall set allprofiles state on - } -} - - - -function Enable-TrustedHosts { - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - Set-Item WSMan:\localhost\Client\TrustedHosts -Value '*' -Force - } -} diff --git a/muranorepository/Services/scripts/Start-PowerShellProcess.ps1 b/muranorepository/Services/scripts/Start-PowerShellProcess.ps1 deleted file mode 100644 index 779908d..0000000 --- a/muranorepository/Services/scripts/Start-PowerShellProcess.ps1 +++ /dev/null @@ -1,151 +0,0 @@ - -trap { - &$TrapHandler -} - - - -function Select-CliXmlBlock { - param ( - [String] $Path, - [String] $OutFile = [IO.Path]::GetTempFileName() - ) - - $TagFound = $false - Get-Content $Path | - ForEach-Object { - if ($_ -eq '#< CLIXML') { - $TagFound = $true - } - if ($TagFound) { - Add-Content -Path $OutFile -Value $_ - } - } - $OutFile -} - - - -function Start-PowerShellProcess { - param ( - [String] $Command, - $Credential = $null, - [Switch] $IgnoreStdErr, - [Switch] $NoBase64 - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - $StdOut = [IO.Path]::GetTempFileName() - $StdErr = [IO.Path]::GetTempFileName() - - $ArgumentList = @('-OutputFormat', 'XML') - - if ($NoBase64) { - $TmpScript = [IO.Path]::GetTempFileName() - Rename-Item -Path "$TmpScript" -NewName "$TmpScript.ps1" -Force - $TmpScript = "$TmpScript.ps1" - - Write-LogDebug $TmpScript - - $Command | Out-File $TmpScript - - $ArgumentList += @('-File', "$TmpScript") - } - else { - $Bytes = [Text.Encoding]::Unicode.GetBytes($Command) - $EncodedCommand = [Convert]::ToBase64String($Bytes) - - Write-LogDebug $EncodedCommand - - $ArgumentList += @('-EncodedCommand', $EncodedCommand) - } - - Write-LogDebug $ArgumentList - - Write-Log "Starting external PowerShell process ..." - - if ($Credential -eq $null) { - $Process = Start-Process -FilePath 'powershell.exe' ` - -ArgumentList @($ArgumentList) ` - -RedirectStandardOutput $StdOut ` - -RedirectStandardError $StdErr ` - -NoNewWindow ` - -Wait ` - -PassThru - } - else { - $Process = Start-Process -FilePath 'powershell.exe' ` - -ArgumentList @($ArgumentList) ` - -RedirectStandardOutput $StdOut ` - -RedirectStandardError $StdErr ` - -Credential $Credential ` - -NoNewWindow ` - -Wait ` - -PassThru - } - - Write-Log "External PowerShell process exited with exit code '$($Process.ExitCode)'." - - #if ($ArgumentList -contains '-File') { - # Remove-Item -Path $TmpScript -Force - #} - - $ErrorActionPreferenceSaved = $ErrorActionPreference - $ErrorActionPreference = 'SilentlyContinue' - - Write-LogDebug "StdOut file is '$StdOut'" - Write-LogDebug "StdErr file is '$StdErr'" - - if ((Get-Item $StdOut).Length -gt 0) { - try { - Write-LogDebug "Loading StdOut from '$StdOut'" - $TmpFile = Select-CliXmlBlock $StdOut - $StdOutObject = Import-Clixml $TmpFile - Write-LogDebug "" - Write-LogDebug ($StdOutObject) - Write-LogDebug "" - $StdOutObject - #Remove-Item -Path $TmpFile -Force - } - catch { - Write-LogDebug "An error occured while loading StdOut from '$TmpFile'" - } - } - - if ((Get-Item $StdErr).Length -gt 0) { - try { - Write-LogDebug "Loading StdErr ..." - $TmpFile = Select-CliXmlBlock $StdErr - $StdErrObject = Import-Clixml $TmpFile - Write-LogDebug "" - Write-LogDebug ($StdErrObject) - Write-LogDebug "" - if (-not $IgnoreStdErr) { - $StdErrObject - } - #Remove-Item -Path $TmpFile -Force - } - catch { - Write-LogDebug "An error occured while loading StdErr from '$TmpFile'" - } - } - - $ErrorActionPreference = $ErrorActionPreferenceSaved - - if ($Process.ExitCode -ne 0) { - throw("External PowerShell process exited with code '$($Process.ExitCode)'") - } - - #Remove-Item $StdOut -Force - #Remove-Item $StdErr -Force - } -} diff --git a/muranorepository/Services/scripts/TelnetDeploy.sh b/muranorepository/Services/scripts/TelnetDeploy.sh deleted file mode 100644 index 7ee6529..0000000 --- a/muranorepository/Services/scripts/TelnetDeploy.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -# -# -#install app -rpm -aq | grep $1 > /dev/null -if [ $? -ne 0 ];then - yum install $1 --assumeyes --quiet - if [ $? -ne 0 ]; then - echo -e "Can't install $1, exiting..." - exit 1 - fi -else - echo "$1 already installed." -fi -#find iptables and add telnet rule -iptcmd=$(which iptables) - -if [ -n "$iptcmd" ]; then - $iptcmd -nvL INPUT | grep "Telnet server access on TCP port 23" > /dev/null - if [ $? -ne 0 ]; then - $iptcmd -I INPUT 1 -p tcp -m tcp --dport 23 -j ACCEPT -m comment --comment "Telnet server access on TCP port 23" - if [ $? -ne 0 ]; then - echo -e "Can't set $1 access firewall rules, exiting..." - exit 1 - else - echo "$iptcmd rule for $1 set." - fi - else - echo "$iptcmd rule for $1 exists." - fi -else - echo "There's no iptables found..." -fi - -# check telnet start disabled -xinetd_tlnt_cfg=/etc/xinetd.d/telnet -if [ -f "$xinetd_tlnt_cfg" ]; then - sed -i '/disable.*=/ s/yes/no/' $xinetd_tlnt_cfg - if [ $? -ne 0 ]; then - echo "can't modify $xinetd_tlnt_cfg" - exit 1 - fi -else - echo "$ serviec startup config not found under $xinetd_tlnt_cfg" -fi -#security tty for telnet -setty=/etc/securetty -lines=$(sed -ne '/^pts\/[0-9]/,/^pts\/[0-9]/ =' $setty) -if [ -z "$lines" ]; then - cat >> $setty << "EOF" -pts/0 -pts/1 -pts/2 -pts/3 -pts/4 -pts/5 -pts/6 -pts/7 -pts/8 -pts/9 -EOF - if [ $? -ne 0 ]; then - echo "Error occured during $setty changing..." - exit 1 -fi -else - echo "$setty has pts/0-9 options..." -fi -#restart xinetd -service xinetd restart -if [ $? -ne 0 ]; then - echo "Error occured during xinetd restart..." - exit 1 -fi diff --git a/muranorepository/Services/scripts/Update-ServiceConfig.ps1 b/muranorepository/Services/scripts/Update-ServiceConfig.ps1 deleted file mode 100644 index 791713d..0000000 --- a/muranorepository/Services/scripts/Update-ServiceConfig.ps1 +++ /dev/null @@ -1,60 +0,0 @@ - -trap { - &$TrapHandler -} - - - -function Update-ServiceConfig { - param ( - [String] $Name, - [String] $RunAsUser = '', - [String] $DomainName = '.', - [String] $Password = '', - [Switch] $RunAsLocalService - ) - begin { - Show-InvocationInfo $MyInvocation - } - end { - Show-InvocationInfo $MyInvocation -End - } - process { - trap { - &$TrapHandler - } - - $ArgumentList = @('config', "`"$Name`"") - - if ($RunAsLocalService) { - $ArgumentList += @("obj=", "`"NT AUTHORITY\LocalService`"") - } - elseif ($RunAsUser -ne '') { - $ArgumentList += @("obj=", "`"$DomainName\$RunAsUser`"", "password=", "`"$Password`"") - } - - $Process = Exec 'sc.exe' $ArgumentList -PassThru -RedirectStreams - - if ($Process.ExitCode -ne 0) { - throw "Command 'sc.exe' returned exit code '$($Process.ExitCode)'" - } - - $NtRights = "C:\Murano\Tools\ntrights.exe" - - if (-not ([IO.File]::Exists($NtRights))) { - throw "File '$NtRights' not found." - } - - $Process = Exec $NtRights @('-u', "$DomainName\$RunAsUser", '+r', 'SeServiceLogonRight') -RedirectStreams -PassThru - - if ($Process.ExitCode -ne 0) { - throw "Command '$NtRights' returned exit code '$($Process.ExitCode)'" - } - - $Process = Exec $NtRights @('-u', "$DomainName\$RunAsUser", '+r', 'SeBatchLogonRight') -RedirectStreams -PassThru - - if ($Process.ExitCode -ne 0) { - throw "Command '$NtRights' returned exit code '$($Process.ExitCode)'" - } - } -} diff --git a/muranorepository/Services/tomcat-manifest.yaml b/muranorepository/Services/tomcat-manifest.yaml deleted file mode 100644 index d2c307d..0000000 --- a/muranorepository/Services/tomcat-manifest.yaml +++ /dev/null @@ -1,44 +0,0 @@ -version: 0.1 -service_display_name: Tomcat - -description: >- - Tomcat application - -full_service_name: tomcat -author: Mirantis Inc. -service_version: 1 -enabled: True - -ui: - - Tomcat.yaml - -workflows: - - Tomcat.xml - - Networking.xml - -heat: - - Linux.template - - LinuxSecurity.template - - TomcatSecurity.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - DefaultSecurity.template - - Keypair.template - - LoadBalancer.template - - FloatingIP.template - - FloatingIPwithLB.template - -agent: - - DeployTomcat.template - - DeployTomcatApp.template - -scripts: - - Linux/common.sh - - Linux/installer.sh - - Linux/deployTomcat.sh - - Linux/deployTomcatApp.sh diff --git a/muranorepository/Services/ui_forms/ActiveDirectory.yaml b/muranorepository/Services/ui_forms/ActiveDirectory.yaml deleted file mode 100644 index 405f16f..0000000 --- a/muranorepository/Services/ui_forms/ActiveDirectory.yaml +++ /dev/null @@ -1,142 +0,0 @@ -unitTemplates: - - isMaster: true - recoveryPassword: {YAQL: $.serviceConfiguration.recoveryPassword} - - isMaster: false - recoveryPassword: {YAQL: $.serviceConfiguration.recoveryPassword} - -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. - attributeNames: [name, domain] - 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: instance - 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. - attributeNames: units - 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 - attributeNames: false - - name: assignFloatingIP - required: false - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - 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: {YAQL: $.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 - attributeNames: false - 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 diff --git a/muranorepository/Services/ui_forms/AspNetApp.yaml b/muranorepository/Services/ui_forms/AspNetApp.yaml deleted file mode 100644 index 09d3856..0000000 --- a/muranorepository/Services/ui_forms/AspNetApp.yaml +++ /dev/null @@ -1,113 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - description: ASP.NET application will be installed onto one IISWeb Server - - name: name - type: string - label: Service Name - description: >- - Enter a desired name for a service. Just A-Z, a-z, 0-9, dash and - underline are allowed. - minLength: 2 - maxLength: 64 - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - helpText: Just letters, numbers, underscores and hyphens are allowed. - - name: dcInstances - type: instance - hidden: true - attributeNames: units - initial: 1 - - 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. - - name: domain - type: domain - label: Domain - required: false - description: >- - Service can be joined to the Active Directory domain. If you want to - create an AD domain create the AD Service first. - helpText: Optional field for a domain to which service can be joined - - name: repository - type: string - label: Git repository - description: >- - URL of a git repository with the application you want to deploy. - regexpValidator: '/(\w+://)(.+@)*([\w\d\.]+)(:[\d]+)?/*(.*)/i' - errorMessages: - invalid: Enter correct git repository url - helpText: Enter a valid git repository URL - - name: assignFloatingIP - required: false - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - 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: {YAQL: $.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 - attributeNames: false - 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 diff --git a/muranorepository/Services/ui_forms/AspNetAppFarm.yaml b/muranorepository/Services/ui_forms/AspNetAppFarm.yaml deleted file mode 100644 index 57a2146..0000000 --- a/muranorepository/Services/ui_forms/AspNetAppFarm.yaml +++ /dev/null @@ -1,133 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - description: >- - The ASP.NET application will be installed on a number of IIS Web - Servers, and load balancing will be configured. - - name: name - type: string - label: Service Name - description: >- - Enter a desired name for a service. Just A-Z, a-z, 0-9, dash and - underline are allowed. - minLength: 2 - maxLength: 64 - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - helpText: Just letters, numbers, underscores and hyphens are allowed. - - name: username - type: string - hidden: true - initial: Administrator - attributeNames: credentials.username - - name: adminPassword - type: password - attributeNames: [adminPassword, credentials.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. - - name: domain - type: domain - label: Domain - required: false - description: >- - Service can be joined to the Active Directory domain. If you want to - create an AD domain create the AD Service first. - helpText: Optional field for a domain to which service can be joined - - name: repository - type: string - label: Git repository - description: >- - URL of a git repository with the application you want to deploy. - regexpValidator: '/(\w+://)(.+@)*([\w\d\.]+)(:[\d]+)?/*(.*)/i' - errorMessages: - invalid: Enter correct git repository url - helpText: Enter a valid git repository URL - - name: dcInstances - type: instance - label: Instance Count - description: >- - Several instances with ASP.NET application can be created at one time. - attributeNames: units - minValue: 2 - maxValue: 100 - initial: 2 - helpText: Enter an integer value between 2 and 100 - - name: loadBalancerPort - type: integer - label: Load Balancer port - minValue: 1 - maxValue: 65536 - initial: 80 - description: Specify port number where Load Balancer will be running - helpText: Enter an integer value from 1 to 65536 - - name: assignFloatingIP - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - 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: {YAQL: 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 - attributeNames: false - 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 diff --git a/muranorepository/Services/ui_forms/Demo.yaml b/muranorepository/Services/ui_forms/Demo.yaml deleted file mode 100644 index 15113fe..0000000 --- a/muranorepository/Services/ui_forms/Demo.yaml +++ /dev/null @@ -1,73 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: configuration - type: string - hidden: true - initial: standalone - - name: name - type: string - label: Service Name - description: >- - To identify your service in logs please specify a service name - - name: dcInstances - type: instance - label: Instance Count - description: >- - Murano can provision more then one instance of the service at a time. - For a demo scenario only 2 instances are allowed. - attributeNames: units - minValue: 1 - maxValue: 2 - initial: 2 - helpText: Enter 1 and 2 value - - 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#])$' - 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: {YAQL: $.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 - attributeNames: false - 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: cirros.demo - 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 diff --git a/muranorepository/Services/ui_forms/LinuxApache.yaml b/muranorepository/Services/ui_forms/LinuxApache.yaml deleted file mode 100644 index 64db398..0000000 --- a/muranorepository/Services/ui_forms/LinuxApache.yaml +++ /dev/null @@ -1,85 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: name - type: string - label: Service Name - description: >- - To identify your service in logs please specify a service name - - name: deployApachePHP - label: PHP module - type: boolean - description: >- - Add php support into Apache web server. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - name: dcInstances - type: instance - minValue: 1 - maxValue: 10 - attributeNames: [units, instanceCount] - initial: 1 - label: Instance Count - description: Several instances with Apache web Service can be created at one time. - helpText: Enter an integer value between 1 and 10 - - name: assignFloatingIP - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - name: unitNamingPattern - type: string - label: Hostname - description: >- - For your convenience instance hostname can be specified. - Enter a name or leave blank for random name generation. - 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#])$' - helpText: Optional field for a machine hostname - # temporaryHack - widgetMedia: - js: [muranodashboard/js/support_placeholder.js] - css: {all: [muranodashboard/css/support_placeholder.css]} - - instanceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - 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: linux - label: Instance image - description: >- - Select valid image for a service. Image should already be prepared and - registered in glance. - - name: keyPair - type: keypair - label: Key Pair - description: >- - Select the Key Pair to control access to instances. You can login to - instances using this KeyPair after the deployment of service. - required: false - - name: availabilityZone - type: azone - label: Availability zone - description: Select availability zone where service would be installed. - required: false diff --git a/muranorepository/Services/ui_forms/LinuxTelnet.yaml b/muranorepository/Services/ui_forms/LinuxTelnet.yaml deleted file mode 100644 index a3d1884..0000000 --- a/muranorepository/Services/ui_forms/LinuxTelnet.yaml +++ /dev/null @@ -1,89 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - description: Telnet service that can be installed at linux - - name: name - type: string - label: Service Name - description: >- - Enter a desired name for a service. Just A-Z, a-z, 0-9, dash and - underline are allowed. - minLength: 2 - maxLength: 64 - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - helpText: Just letters, numbers, underscores and hyphens are allowed. - - name: dcInstances - type: instance - hidden: true - attributeNames: units - initial: 1 - - name: assignFloatingIP - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - name: unitNamingPattern - type: string - label: Hostname - description: >- - For your convenience instance hostname can be specified. - Enter a name or leave blank for random name generation. - 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#])$' - helpText: Optional field for a machine hostname - # 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: {YAQL: $.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 - attributeNames: false - 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: linux - label: Instance image - description: >- - Select valid image for a service. Image should already be prepared and - registered in glance. - - name: keyPair - type: keypair - label: Key Pair - description: >- - Select the Key Pair to control access to instances. You can login to - instances using this KeyPair after the deployment of service. - required: false - - name: availabilityZone - type: azone - label: Availability zone - description: Select availability zone where service would be installed. - required: false diff --git a/muranorepository/Services/ui_forms/MsSqlClusterServer.yaml b/muranorepository/Services/ui_forms/MsSqlClusterServer.yaml deleted file mode 100644 index 40893c3..0000000 --- a/muranorepository/Services/ui_forms/MsSqlClusterServer.yaml +++ /dev/null @@ -1,250 +0,0 @@ -unitTemplates: - - isMaster: true - isSync: true - name: 'node-#' - - isMaster: false - isSync: true - name: 'node-#' - - isMaster: false - isSync: false - name: 'node-#' - -forms: - - serviceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - description: MS SQL Failover Cluster - - name: name - type: string - label: Service Name - description: >- - Enter a desired name for a service. Just A-Z, a-z, 0-9, dash and - underline are allowed. - minLength: 2 - maxLength: 64 - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - helpText: 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. - - name: externalAD - type: boolean - label: Active Directory is configured by the System Administrator - widgetAttrs: # temporary hack - class: external-ad - # temporaryHack - widgetMedia: - js: [muranodashboard/js/external-ad.js] - css: {all: [muranodashboard/css/checkbox.css]} - required: false - - name: domainAdminUserName - type: string - label: Active Directory User - enabled: {YAQL: $.serviceConfiguration.externalAD} - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - - name: domainAdminPassword - type: password - label: Active Directory Password - enabled: {YAQL: $.serviceConfiguration.externalAD} - - name: domain - type: domain - label: Domain - enabled: {YAQL: not $.serviceConfiguration.externalAD} - description: >- - Service can be joined to the Active Directory domain. If you want to - create an AD domain create the AD Service first. - helpText: Optional field for a domain to which service can be joined - - name: mixedModeAuth - type: boolean - label: Mixed-mode Authentication - initial: true - required: false - description: >- - Mixed authentication mode allows the use of Windows - credentials but supplements them with local SQL Server user - accounts that the administrator may create and maintain within - SQL Server. If this mode is on SA password is required - # temporaryHack - widgetMedia: - js: [muranodashboard/js/mixed-mode.js] - css: {all: [muranodashboard/css/checkbox.css]} - - name: saPassword - type: password - label: SA Password - description: Set system administrator password for the MS SQL Server. - helpText: SQL server System Administrator account - enabled: {YAQL: $.serviceConfiguration.mixedModeAuth} - - clusterConfiguration: - fields: - - name: clusterIp - type: clusterip - label: Cluster Static IP - description: Specify a valid IPv4 fixed IP. - # temporaryHack - widgetMedia: - js: [muranodashboard/js/support_placeholder.js] - css: {all: [muranodashboard/css/support_placeholder.css]} - - name: clusterName - type: string - label: Cluster Name - helpText: Service name for new SQL Cluster service - description: >- - Specify a name of a cluster. Just A-Z, a-z, 0-9, dash and underline are allowed. - - name: agGroupName - type: string - label: Availability Group Name - helpText: Name of AG during SQL setup - regexpValidator: '^[A-Za-z0-9_-]+$' - description: >- - Specify a name of an AG. Just A-Z, a-z, 0-9, dash and underline are allowed. - - name: agListenerName - type: string - label: Availability Group Listener Name - helpText: FQDN name of a new DNS entry for AG Listener endpoint - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - description: >- - Specify a name of an AG Listener . Just A-Z, a-z, 0-9, dash and underline are allowed. - - name: agListenerIP - type: clusterip - label: Availability Group Listener IP - description: Specify a valid IPv4 fixed IP. - - name: sqlServiceUserName - type: string - label: SQL User Name - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - description: User name that will be created to manage cluster instances. - # temporaryHack - widgetMedia: - js: [muranodashboard/js/support_placeholder.js] - css: {all: [muranodashboard/css/support_placeholder.css]} - - name: sqlServicePassword - type: password - label: SQL User Password - description: User password that will be created to manage cluster instances. - - name: dcInstances - type: instance - label: Instance Count - minValue: 2 - maxValue: 5 - initial: 2 - attributeNames: false - helpText: Enter an integer value between 2 and 5 - description: Microsoft SQL Failover Cluster includes up to 5 instances. - - name: assignFloatingIP - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - 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: {YAQL: not $.clusterConfiguration.unitNamingPattern.bool() or '#' in $.clusterConfiguration.unitNamingPattern} - message: Incrementation symbol "#" is required in the Hostname template - # if IP is not valid on its own, it will be empty - the - # first check is needed to not emit comparison error when - # both IPs are not valid - - expr: {YAQL: not $.clusterConfiguration.clusterIp.bool() or $.clusterConfiguration.clusterIp != $.clusterConfiguration.agListenerIP} - message: Listener IP and Cluster Static IP should be different - - unitsConfiguration: - fields: - - name: nodes - type: table - label: Nodes - attributeNames: units - columns: - - columnName: name - columnType: label - title: Node - - columnName: isSync - columnType: checkbox - title: Sync - - columnName: isMaster - columnType: radio - title: Master - initial: {YAQL: $.clusterConfiguration.dcInstances} - minValue: 2 - maxValue: 5 - maxSync: 2 - description: >- - Configure cluster instances. Cluster node quantity can be set - with 'Add' and 'Remove' buttons. Configure Sync mode by - enabling corresponding checkbox. All other nodes will be in - Async mode. Just 2 nodes are allowed to be Sync. Also one - Master node need to be selected. SQL Failover cluster has - limit of 5 instances. - - name: databases - type: databaselist - label: Database list - description: >- - Specify names for new databases which will be created as part - of service installation. Here should come comma-separated list - of database names, where each name has the following syntax: - first symbol should be latin letter or underscore; subsequent - symbols can be latin letter, numeric, underscore, at sign, - number sign or dollar sign. - helpText: Enter comma separated list of databases that will be created - - instanceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - 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 diff --git a/muranorepository/Services/ui_forms/MsSqlServer.yaml b/muranorepository/Services/ui_forms/MsSqlServer.yaml deleted file mode 100644 index 36ca09b..0000000 --- a/muranorepository/Services/ui_forms/MsSqlServer.yaml +++ /dev/null @@ -1,123 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - description: MS SQL Server - - name: name - type: string - label: Service Name - description: >- - Enter a desired name for a service. Just A-Z, a-z, 0-9, dash and - underline are allowed. - minLength: 2 - maxLength: 64 - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - helpText: Just letters, numbers, underscores and hyphens are allowed. - - name: dcInstances - type: instance - hidden: true - attributeNames: units - initial: 1 - - 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. - - name: domain - type: domain - label: Domain - required: false - description: >- - Service can be joined to the Active Directory domain. If you want to - create an AD domain create the AD Service first. - helpText: Optional field for a domain to which service can be joined - - name: mixedModeAuth - type: boolean - label: Mixed-mode Authentication - initial: true - required: false - description: >- - Mixed authentication mode allows the use of Windows - credentials but supplements them with local SQL Server user - accounts that the administrator may create and maintain within - SQL Server. If this mode is on SA password is required - # temporaryHack - widgetMedia: - js: [muranodashboard/js/mixed-mode.js] - css: {all: [muranodashboard/css/checkbox.css]} - - name: saPassword - type: password - label: SA Password - description: Set system administrator password for the MS SQL Server. - helpText: SQL server System Administrator account - required: {YAQL: $.serviceConfiguration.mixedModeAuth} - - name: assignFloatingIP - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - 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: {YAQL: $.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 - attributeNames: false - 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 diff --git a/muranorepository/Services/ui_forms/PostgreSql.yaml b/muranorepository/Services/ui_forms/PostgreSql.yaml deleted file mode 100644 index 717d67f..0000000 --- a/muranorepository/Services/ui_forms/PostgreSql.yaml +++ /dev/null @@ -1,92 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: name - type: string - label: Service Name - description: >- - To identify your service in logs please specify a service name - - name: database - type: string - label: Database - description: >- - Please, provide database name that is going to be created - - name: username - type: string - label: Username - description: >- - Please, provide username that is going to be used to connect to the database - - name: password - type: password - label: Password - descriptionTitle: Password - description: >- - Please, provide password that is going to be used to connect to the database - - name: dcInstances - type: instance - hidden: true - attributeNames: units - initial: 1 - - name: assignFloatingIP - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - 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]} - - instanceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - 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: linux - label: Instance image - description: >- - Select valid image for a service. Image should already be prepared and - registered in glance. - - name: keyPair - type: keypair - label: Key Pair - description: >- - Select the Key Pair to control access to instances. You can login to - instances using this KeyPair after the deployment of service. - required: false - - name: availabilityZone - type: azone - label: Availability zone - description: Select availability zone where service would be installed. - required: false diff --git a/muranorepository/Services/ui_forms/Tomcat.yaml b/muranorepository/Services/ui_forms/Tomcat.yaml deleted file mode 100644 index 9237cad..0000000 --- a/muranorepository/Services/ui_forms/Tomcat.yaml +++ /dev/null @@ -1,100 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: name - type: string - label: Service Name - description: >- - To identify your service in logs please specify a service name - - name: repository - type: string - label: Git repository - description: >- - URL of a git repository with the application you want to deploy. - regexpValidator: '/(\w+://)(.+@)*([\w\d\.]+)(:[\d]+)?/*(.*)/i' - errorMessages: - invalid: Enter correct git repository url - helpText: Enter a valid git repository URL - - name: psqlDatabase - type: psqlDatabase - label: Database - description: >- - Select database to connect with - - name: dcInstances - type: instance - label: Instance Count - description: >- - Several instances with application running on Tomcat can be created at one time. - attributeNames: units - minValue: 1 - maxValue: 100 - initial: 1 - helpText: Enter an integer value between 2 and 100 - - name: loadBalancerPort - type: integer - label: Load Balancer port - initial: 8080 - hidden: true - - name: assignFloatingIP - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - 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]} - - instanceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - 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: linux - label: Instance image - description: >- - Select valid image for a service. Image should already be prepared and - registered in glance. - - name: keyPair - type: keypair - label: Key Pair - description: >- - Select the Key Pair to control access to instances. You can login to - instances using this KeyPair after the deployment of service. - required: false - - name: availabilityZone - type: azone - label: Availability zone - description: Select availability zone where service would be installed. - required: false diff --git a/muranorepository/Services/ui_forms/WebServer.yaml b/muranorepository/Services/ui_forms/WebServer.yaml deleted file mode 100644 index 77f41d4..0000000 --- a/muranorepository/Services/ui_forms/WebServer.yaml +++ /dev/null @@ -1,103 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: title - type: string - required: false - hidden: true - attributeNames: false - description: Standalone IIS Server - - name: name - type: string - label: Service Name - description: >- - Enter a desired name for a service. Just A-Z, a-z, 0-9, dash and - underline are allowed. - minLength: 2 - maxLength: 64 - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - helpText: Just letters, numbers, underscores and hyphens are allowed. - - name: dcInstances - type: instance - hidden: true - attributeNames: units - initial: 1 - - 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. - - name: domain - type: domain - label: Domain - required: false - description: >- - Service can be joined to the Active Directory domain. If you want to - create an AD domain create the AD Service first. - helpText: Optional field for a domain to which service can be joined - - name: assignFloatingIP - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - required: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - 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: {YAQL: $.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 - attributeNames: false - 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 diff --git a/muranorepository/Services/ui_forms/WebServerFarm.yaml b/muranorepository/Services/ui_forms/WebServerFarm.yaml deleted file mode 100644 index b4ae684..0000000 --- a/muranorepository/Services/ui_forms/WebServerFarm.yaml +++ /dev/null @@ -1,121 +0,0 @@ -unitTemplates: - - {} - -forms: - - serviceConfiguration: - fields: - - name: title - type: string - hidden: true - required: false - attributeNames: false - description: A load-balanced array of IIS servers - - name: name - type: string - label: Service Name - description: >- - Enter a desired name for a service. Just A-Z, a-z, 0-9, dash and - underline are allowed. - minLength: 2 - maxLength: 64 - regexpValidator: '^[-\w]+$' - errorMessages: - invalid: Just letters, numbers, underscores and hyphens are allowed. - helpText: Just letters, numbers, underscores and hyphens are allowed. - - name: username - type: string - hidden: true - initial: Administrator - attributeNames: credentials.username - - name: adminPassword - type: password - attributeNames: [adminPassword, credentials.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. - - name: domain - type: domain - label: Domain - required: false - description: >- - Service can be joined to the Active Directory domain. If you want to - create an AD domain create the AD Service first. - helpText: Optional field for a domain to which service can be joined - - name: dcInstances - type: instance - minValue: 2 - maxValue: 100 - attributeNames: [units, instanceCount] - initial: 2 - label: Instance Count - description: Several instances with IIS Service can be created at one time. - helpText: Enter an integer value between 2 and 100 - - name: loadBalancerPort - type: integer - label: Load Balancer port - minValue: 1 - maxValue: 65536 - initial: 80 - description: Specify port number where Load Balancer will be running - helpText: Enter an integer value from 1 to 65536 - - name: assignFloatingIP - required: false - type: floatingip - label: Assign Floating IP - description: Toggle check to assign floating IP automatically. - initial: false - widgetMedia: - css: {all: [muranodashboard/css/checkbox.css]} - - 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: {YAQL: 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 - attributeNames: false - 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 diff --git a/muranorepository/Services/webServer-manifest.yaml b/muranorepository/Services/webServer-manifest.yaml deleted file mode 100644 index f09412a..0000000 --- a/muranorepository/Services/webServer-manifest.yaml +++ /dev/null @@ -1,47 +0,0 @@ -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: webServer -author: Mirantis Inc. -service_version: 1 -enabled: True - -ui: - - WebServer.yaml - -workflows: - - WebApps.xml - - Common.xml - - Networking.xml - -heat: - - Windows.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - DefaultSecurity.template - - WindowsSecurity.template - - WebServerSecurity.template - - FloatingIP.template - -agent: - - SetPassword.template - - InstallIIS.template - - DeployWebApp.template - -scripts: - - ImportCoreFunctions.ps1 - - Set-LocalUserPassword.ps1 - - CopyPrerequisites.ps1 - - InstallIIS.ps1 - - DeployWebApp.ps1 - - diff --git a/muranorepository/Services/webServerFarm-manifest.yaml b/muranorepository/Services/webServerFarm-manifest.yaml deleted file mode 100644 index 59aee3c..0000000 --- a/muranorepository/Services/webServerFarm-manifest.yaml +++ /dev/null @@ -1,46 +0,0 @@ -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: webServerFarm -author: Mirantis Inc. -service_version: 1 -enabled: True - -ui: - - WebServerFarm.yaml - -workflows: - - WebApps.xml - - Common.xml - - Networking.xml - -heat: - - Windows.template - - LoadBalancer.template - - InstancePort.template - - InstancePortWSubnet.template - - Network.template - - NNSecurity.template - - Param.template - - RouterInterface.template - - Subnet.template - - DefaultSecurity.template - - WindowsSecurity.template - - WebServerSecurity.template - - FloatingIPwithLB.template - -agent: - - SetPassword.template - - InstallIIS.template - - DeployWebApp.template - -scripts: - - ImportCoreFunctions.ps1 - - Set-LocalUserPassword.ps1 - - CopyPrerequisites.ps1 - - InstallIIS.ps1 - - DeployWebApp.ps1 - diff --git a/muranorepository/Services/workflows/AD.xml b/muranorepository/Services/workflows/AD.xml deleted file mode 100644 index 30c2209..0000000 --- a/muranorepository/Services/workflows/AD.xml +++ /dev/null @@ -1,330 +0,0 @@ - - - - - Creating instance ) - - - - - - network- - - - - - - - ( - Unable to deploy instance ) due to - - - - - - - - - - - - - - - - - - - - ( - - - - - - - - - - Unable to set domain administrator password on unit ) due to - - - - - - - - - ( - - - - - - - - - Unable to create a Primary DC on unit ) due to - - - - - - - - - - - - - - - Unable assign DNS IP on unit ) due to - - - - - - - - - - - - - - - - Unit ) has left domain - Unit ) was unable to leave the domain due to - - - - - - - - - - - - /$.services[?(@.type == 'activeDirectory' and @.domain == ' - - - - - - - - - - - - - Unit ) has joined domain - Unit ) was unable to join the domain due to - - - - - - - - - - - ( - - - - - - - - - - - - - - Domain - Unable to create Secondary Domain Controller on unit ) due to - Unable to create domain - - Unable to assign Key Pair on unit ) due to - - - - - - - - - - - WebServerSecurity - LinuxSecurity - - - - - - - - ( - - - - - - - - - - - - - - - - - - - - Linux instance ) created - - - - - - - ( - - - Configuring security groups on ) - - - - - - - - ( - - - - - - - - - - - ( - - - Unable to deploy Apache on ) due to - - - - - - - diff --git a/muranorepository/Services/workflows/Common.xml b/muranorepository/Services/workflows/Common.xml deleted file mode 100644 index bce649b..0000000 --- a/muranorepository/Services/workflows/Common.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - instance - - - - - - port- - - - - - - - ( - Creating instance ) - - - - - - - - - - - - ( - Instance ) updated - - - ( - Unable to deploy instance ) due to - - - - - - - - - - ( - - - - Demo service ) has started - - - - - ( - - Unable to assign Key Pair on unit ) due to - - - - - - - - - ( - - - - - - - - - - Linux instance ) created - - - - - ( - yum-ing telnet on unit ) - - - - - - - - - ( - Unable to deploy Telnet on ) due to - - - - - - - diff --git a/muranorepository/Services/workflows/MsSqlCluster.xml b/muranorepository/Services/workflows/MsSqlCluster.xml deleted file mode 100644 index 6002cdf..0000000 --- a/muranorepository/Services/workflows/MsSqlCluster.xml +++ /dev/null @@ -1,449 +0,0 @@ - - - - - SQL-security - WindowsSecurity - WSFCSecurity - SQLClusterSecurity - - - - - - - - Creating instance ) - - - - - - network- - - - - - - - ( - Unable to deploy instance ) due to - - - - - - - ( - - Address pair and SQL ports are open on ) - - - - - ( - - - /$.services[?(@.type == 'activeDirectory' and @.domain == ' - - - - - - - - - - - Unable to set admin password on unit ) due to - - - - - - - - - - - - - - - - - - - Failover cluster prerequisites installed on unit ) - - - - - ( - - - - - - - - - - - - - - - - Failover cluster created for SQL Server Cluster service ( - Unable to create failover cluster for SQL Server Service - - - - Environment for AlwaysOn Availability Group of SQL Server Cluster service ( - Unable to configure the environment for AlwaysOn Availability Group of SQL Server Cluster service ( - - - - - - - - - - - - - - - - ( - Unable to install SQL Server on unit ) due to - - - - - - - - - - - - - - - - - - - - - - - - - AlwaysOn AG initialized for ) - - - - - ( - - - - - - - - - - - - - - - - - - - - - - - - - ( - Unable to initialize primary replica for SQL Server AG for ) due to - - - - - - - - - - - - - - - - - - - - - - - - - Secondary replica for SQL Server AG initialized for ) - - - - - ( - - - - - - - ( - port- - - - - - - - - - - Instance ) created - - - - - ( - Opening SQL ports on ) - - - - - - - - - - - - - - - - - ( - Creating MS SQL Server on unit ) - - - - - - - - - - - - - - - - - ( - Unable to install MS SQL Server on unit ) due to - - - - - - - diff --git a/muranorepository/Services/workflows/Networking.xml b/muranorepository/Services/workflows/Networking.xml deleted file mode 100644 index 80e43f9..0000000 --- a/muranorepository/Services/workflows/Networking.xml +++ /dev/null @@ -1,378 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.0.0.0/0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - network- - - - - - - - - - - - - - - network- - - - - - - - - - - - - - - - subnet- - - - - - - - - - - - - - - - - - - - network - subnet - - - - - - - - - - - network- - - - - - - - - - - -port- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - for - - - - - - - - - - - - - - for - - - - - - - diff --git a/muranorepository/Services/workflows/PostgreSql.xml b/muranorepository/Services/workflows/PostgreSql.xml deleted file mode 100644 index 36552e1..0000000 --- a/muranorepository/Services/workflows/PostgreSql.xml +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - - - - - - - - - - ( - - Creating Linux instance ) - - - - - - - - - - - - - - - - - - - - - - - - ( - - - Unable to deploy Linux instance ) due to - - - - - - - - - ( - - - Installing PostgreSql on unit ) - - - - - - - - - - - - - ( - - - Unable to deploy PostgreSql on ) due to - - - - - - - - - - - on unit ) - - - - - - - - - - - - - Database ( - Unable to configure database on ) - - - - - - - - - - - - - - - - - - - - - - - /$.services[?(@.type == 'tomcat' and @.psqlDatabase == ' - - - - - - - - - - - has been configured to work with database - Unable to configure unit due to - - - - - - - diff --git a/muranorepository/Services/workflows/Tomcat.xml b/muranorepository/Services/workflows/Tomcat.xml deleted file mode 100644 index aa74296..0000000 --- a/muranorepository/Services/workflows/Tomcat.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - ( - - Creating Linux instance ) - - - - - - - - - - - - - - - - - - - - - - - - ( - - - Unable to deploy Linux instance ) due to - - - - - - - - - ( - - - Installing Tomcat on unit ) - - - - - - - - - - - - - ( - - - Unable to deploy Tomcat on ) due to - - - - - - - - - - on unit ) - - - - - - - - - - App ( - Unable to deploy WebApp on ) - - - - - - - - - - - - : - Unable to create a Server Farm load balancer on unit ) due to - - - - - - - - - - - - - Unable to assign floating IP to - - - - - - - ( - port- - - - - - - - ( - Unable to deploy instance ) due to - - - - - - - - - - - - : - Unable to create a Server Farm load balancer on unit ) due to - - - - - - - - - - - - - Unable to assign floating IP to - - - - - - - - - - Unable to set admin password on unit ) - - - - - - - - - - ( - - - - IIS ) has started - - - - - ( - Deploying WebApp ( - - - - - - - - - - has been deployed on unit ) - - - - - (