
Iec6b3c56d464d26e4f1fc143e6a7804add67a35d I3f2d3a12fcb53759a906fcbae6fae768833d325e I566811521da16055a73c73052ffcd497aaa8e475 I2ee04b6d5aaa26d49243cf7e0b6045026f052625 I329620f3c8aa7e7f1bdd658cbaa8ea20d9aa4ba5 I5ff3d9146b4fbec74d8d65de84d7ab61d869725c Ib38fd52811812170bdd9bf9df90a66f1a2e6c8d9 I64ce3efaec6df2e402ca2acf6a3cf1a6f2bb1909 I66c3659ab0f33772d7a51c8961a37e32c65354c2 I29ce4a6ef165daa0fe60003301a0d807fd1cce42 Ibd2a4f55e2a64d9a992833200a791dbb20c41eca I16133a213ef25a1b374f10fa80cd5a03d1f40753 Ie09f32fcacfe70f436cad71e5749edf94be038ed Iaba6a6bf07ff223e41f705f0f1db5688a5290f5c I64a0474ecfe5ea38393fe681d520a7b6ce00d959 I270b3ce5ef776522a62d9622b36f0d6b50b9cc57 Ic5f6849ea166bb0295f84685b0a2b5c4701f972a I51190cb02255254a888f66404ecdc3dfc5be0386 I0c2180c603cd09e29d4e6c5e592b987e2b447972 Iae1cdbeb7fa3e49c2cb5cac7c92eceffef477e7e I6c643f58aada0a8525711bc452d0c581625f3d26 I9c4f999b1b3006b8ae5f18a030d5b30c7e85e03b I32eaad36edcb889b448c45ba36f4e97f7c87d1e5 I8c91c40a922690b475aac1c0a3b2c0c28274b130 I574fd1dbeea58dbf41f77d295dc03c23d2feaf96 Change-Id: I0ffb3c38c0c1b3aafa8617364e22036c47aaef76
172 lines
7.6 KiB
XML
172 lines
7.6 KiB
XML
<workflow>
|
|
<rule match="$.services[?(@.type in ('webServer', 'aspNetApp', 'webServerFarm', 'aspNetAppFarm') and @.domain)].units[*]"
|
|
desc='Units of web services with domain'>
|
|
<set path="domain">
|
|
<select path="::domain"/>
|
|
</set>
|
|
<mute/>
|
|
</rule>
|
|
|
|
<rule match="$.services[?(@.type in ('webServer', 'aspNetApp', 'webServerFarm', 'aspNetAppFarm') and @.osImage.name)].units[?(@.state.hostname and not @.temp.instanceName)]"
|
|
desc="Units of web services having hostname and image names assigned but without instances">
|
|
<report entity="unit">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">Creating instance <select path="state.hostname"/> (<select path="name"/>)</parameter>
|
|
</report>
|
|
<update-cf-stack template="Windows" error="exception">
|
|
<parameter name="mappings">
|
|
<map>
|
|
<mapping name="instanceName"><select path="state.hostname"/></mapping>
|
|
<mapping name="userData">
|
|
<prepare-user-data>
|
|
<parameter name="hostname"><select path="state.hostname"/></parameter>
|
|
<parameter name="unit"><select path="id"/></parameter>
|
|
<parameter name="service"><select path="::id"/></parameter>
|
|
</prepare-user-data>
|
|
</mapping>
|
|
<mapping name="instanceType"><select path="::flavor" default="m1.medium"/></mapping>
|
|
<mapping name="imageName"><select path="::osImage.name"/></mapping>
|
|
<mapping name="availabilityZone"><select path="::availabilityZone" default="nova"/></mapping>
|
|
</map>
|
|
</parameter>
|
|
<success>
|
|
<set path="temp.instanceName"><select path="name"/></set>
|
|
<report entity="unit">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">Instance <select path="state.hostname"/> (<select path="name"/>) created</parameter>
|
|
</report>
|
|
</success>
|
|
<failure>
|
|
<report entity="unit" level="error">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">Unable to deploy instance <select path="state.hostname"/> (<select path="name"/>) due to <select source="exception" path="message" default="unknown Heat error"/> </parameter>
|
|
</report>
|
|
<stop/>
|
|
</failure>
|
|
</update-cf-stack>
|
|
</rule>
|
|
|
|
<rule match="$.services[?(@.type in ('webServerFarm', 'aspNetAppFarm'))].units[?(@.state.hostname and not @.temp.registeredWithLB)]"
|
|
desc="Units of web-farms services which have a hostname assigned but are not registered with LB">
|
|
<update-cf-stack template="LoadBalancer" result="outputs" error="exception">
|
|
<parameter name="mappings">
|
|
<map>
|
|
<mapping name="instanceName"><select path="state.hostname"/></mapping>
|
|
<mapping name="lbPort"><select path="::loadBalancerPort"/></mapping>
|
|
<mapping name="lbName"><select path="::name"/></mapping>
|
|
</map>
|
|
</parameter>
|
|
<success>
|
|
<set path="temp.registeredWithLB"><true/></set>
|
|
<set path="::uri">http://<select source="outputs" path="LoadBalancerIP"/>:<select path="::loadBalancerPort"/></set>
|
|
</success>
|
|
<failure>
|
|
<report entity="unit" level="error">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">Unable to create a Server Farm load balancer on unit <select path="state.hostname"/> (<select path="name"/>) due to <select source="exception" path="message" default="unknown Heat error"/> </parameter>
|
|
</report>
|
|
<stop/>
|
|
</failure>
|
|
</update-cf-stack>
|
|
</rule>
|
|
|
|
<rule match="$.services[?(@.type in ('webServer', 'aspNetApp', 'webServerFarm', 'aspNetAppFarm') and @.adminPassword and @.adminPassword != @.state.adminPassword)].units[?(@.temp.instanceName)]"
|
|
desc="Units of web services which have got an instance deployed but has not got a correct admin password ">
|
|
<send-command template="SetPassword" error='exception'>
|
|
<parameter name="unit">
|
|
<select path="id"/>
|
|
</parameter>
|
|
<parameter name="service">
|
|
<select path="::id"/>
|
|
</parameter>
|
|
<parameter name="mappings">
|
|
<map>
|
|
<mapping name="adminPassword">
|
|
<select path="::adminPassword"/>
|
|
</mapping>
|
|
</map>
|
|
</parameter>
|
|
<success>
|
|
<set path="::state.adminPassword">
|
|
<select path="::adminPassword"/>
|
|
</set>
|
|
</success>
|
|
<failure>
|
|
<report entity="unit" level="warning">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">Unable to set admin password on unit <select path="state.hostname"/> (<select path="name"/>) due to <select source="exception" path="0.messages.0" default="unknown Agent error"/> </parameter>
|
|
</report>
|
|
<mute/>
|
|
</failure>
|
|
</send-command>
|
|
</rule>
|
|
|
|
|
|
<rule match="$.services[?(@.type in ('webServer', 'aspNetApp', 'webServerFarm', 'aspNetAppFarm'))].units[?(@.temp.instanceName and not @.state.iisInstalled)]"
|
|
desc="Units of web services which have got an instance deployed but have not got an IIS installed">
|
|
<report entity="unit">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">Creating IIS Web Server on unit <select path="state.hostname"/> (<select path="name"/>)</parameter>
|
|
</report>
|
|
<send-command template="InstallIIS" error='exception'>
|
|
<parameter name="unit">
|
|
<select path="id"/>
|
|
</parameter>
|
|
<parameter name="service">
|
|
<select path="::id"/>
|
|
</parameter>
|
|
<success>
|
|
<set path="state.iisInstalled"><true/></set>
|
|
<report entity="unit">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">IIS <select path="state.hostname"/> (<select path="name"/>) has started</parameter>
|
|
</report>
|
|
</success>
|
|
<failure>
|
|
<report entity="unit" level="error">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">Unable to install IIS on <select path="state.hostname"/> (<select path="name"/>) due to <select source="exception" path="0.messages.0" default="unknown Agent error"/> </parameter>
|
|
</report>
|
|
<stop/>
|
|
</failure>
|
|
</send-command>
|
|
</rule>
|
|
|
|
<rule match="$.services[?(@.type in ('aspNetApp', 'aspNetAppFarm'))].units[?(@.state.iisInstalled and not @.state.webAppDeployed)]"
|
|
desc="Units of ASP.NET app services which have got IIS installed but not the WebApplication deployed">
|
|
<report entity="unit">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">Deploying WebApp <select path="::name"/> on unit <select path="state.hostname"/> (<select path="name"/>)</parameter>
|
|
</report>
|
|
<send-command template="DeployWebApp" error="exception">
|
|
<parameter name="unit">
|
|
<select path="id"/>
|
|
</parameter>
|
|
<parameter name="service">
|
|
<select path="::id"/>
|
|
</parameter>
|
|
<parameter name="mappings">
|
|
<map>
|
|
<mapping name="repository">
|
|
<select path="::repository"/>
|
|
</mapping>
|
|
</map>
|
|
</parameter>
|
|
<success>
|
|
<set path="state.webAppDeployed"><true/></set>
|
|
<report entity="unit">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">WebApp <select path="::name"/> has been deployed on unit <select path="state.hostname"/> (<select path="name"/>)</parameter>
|
|
</report>
|
|
</success>
|
|
<failure>
|
|
<report entity="unit" level="error">
|
|
<parameter name="id"><select path="id"/></parameter>
|
|
<parameter name="text">Unable to deploy WebApp on <select path="state.hostname"/> (<select path="name"/>) due to <select source="exception" path="0.messages.0" default="unknown Agent error"/> </parameter>
|
|
</report>
|
|
<stop/>
|
|
</failure>
|
|
</send-command>
|
|
</rule>
|
|
|
|
</workflow> |