{"id":208710,"date":"2014-01-12T18:18:03","date_gmt":"2014-01-12T14:18:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208710"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208710","title":{"rendered":"<span class=\"post_title\">\u0410\u0432\u0442\u043e\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Puppet \u0438 AWS Cloud Formation<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/200\/79c\/fe5\/20079cfe55c72ed0ce9ed5b9ac52108a.jpg\" alt=\"image\" align=\"left\"\/>\u0412\u043e\u0442 \u0438 \u043d\u0430\u0441\u0442\u0430\u043b \u0442\u043e\u0442 \u0434\u0435\u043d\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043a\u0443\u043a\u0431\u0443\u043a\u0438, \u0440\u0435\u0446\u0435\u043f\u0442\u044b, \u043d\u043e\u0436 \u0448\u0435\u0444-\u043f\u043e\u0432\u0430\u0440\u0430 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043a\u0443\u043a\u043b\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c. <br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u2014 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u0435\u0440\u043e\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/puppetlabs.com\/puppet\/puppet-enterprise\">Puppet Enterprise<\/a><a name=\"habracut\"><\/a><br \/>  \u0418\u0442\u0430\u043a, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u041e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u0434\u0432\u0443\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043f\u0435\u0440\u0432\u044b\u0439 \u2014 FrontEnd, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 IIS \u0441\u0435\u0440\u0432\u0435\u0440, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 BackEnd, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b\u0439 Worker service \u0438 \u0431\u0430\u0437\u0443 MongoDB. \u041e\u0431\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043a\u0430\u043a \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0431\u0443\u0434\u0443\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043d\u0430 Windows Server. \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 FrontEnd \u0438 Worker service \u0431\u0443\u0434\u0443\u0442 \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 AWS S3, \u043a\u0443\u0434\u0430 \u0438\u0445 \u0443\u0436\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u043d\u043e\u0447\u044c Jenkins.<\/p>\n<h5>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Cloud Fromation Template<\/h5>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c Cloud Formation template, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 Windows \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e. \u041a\u0443\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c Puppet, \u043a\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043a \u044d\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c.<br \/>  \u0412 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Puppet \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a \u0445\u043e\u0441\u0442\u043d\u0435\u0439\u043c\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0445\u043e\u0441\u0442\u043d\u0435\u0439\u043c \u043d\u0430 AWS Amazon \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c \u0438 \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u043e\u043f-\u0441\u0442\u0430\u0440\u0442\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u044f \u0431\u044b\u043b \u0431\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u0432\u044b\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442-\u0441\u0442\u0430\u0440\u0442 \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043c\u0435\u043d\u044f\u0442\u044c \u0445\u043e\u0441\u0442\u043d\u0435\u0439\u043c \u043c\u0430\u0448\u0438\u043d\u044b \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c puppet agent.<br \/>  \u041f\u043e\u043a\u043e\u043f\u0430\u0432\u0448\u0438\u0441\u044c \u0435\u0449\u0435 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u044f \u043d\u0430\u0448\u0451\u043b \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u2014 <a href=\"http:\/\/docs.puppetlabs.com\/guides\/custom_facts.html#external-facts\">Custom External Facts<\/a>. \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 c Chef Server, facts \u2014 \u044d\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433 attributes.<br \/>  \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0444\u0430\u043a\u0442\u044b \u0434\u043b\u044f \u0432\u0438\u043d\u0434\u043e\u0443\u0441 \u043c\u0430\u0448\u0438\u043d\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c bat \u0438\u043b\u0438 ps1 \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0435\u0433\u043e \u0432 &quot;<b>C:\\ProgramData\\PuppetLabs\\facter\\facts.d\\&quot;<\/b>.  <\/p>\n<pre><code class=\"dos\">@echo off echo node_role=frontend echo app_version=Build1.2.0 <\/code><\/pre>\n<p>  \u0413\u0434\u0435 serverRole \u2014 \u044d\u0442\u043e, \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0430 buildNumber \u2014 \u044d\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0447\u0430\u043d\u0430 \u0441 S3 AWS.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 Cloud Formation template.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">DevEnv.tmpl<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">{     &quot;AWSTemplateFormatVersion&quot; : &quot;2010-09-09&quot;,      &quot;Description&quot; : &quot;Developers Stack&quot;, \t&quot;Parameters&quot; : { \t\t&quot;KeyName&quot; : { \t\t\t&quot;Description&quot; : &quot;Key-pair name&quot;, \t\t\t&quot;Type&quot; : &quot;String&quot; \t\t}, \t\t&quot;SuffixName&quot; : { \t\t\t&quot;Description&quot; : &quot;Suffix for all created resources&quot;, \t\t\t&quot;Type&quot; : &quot;String&quot; \t\t}, \t\t&quot;FrontEndInstanceType&quot; : { \t\t\t&quot;Type&quot; : &quot;String&quot;, \t\t\t&quot;Default&quot; : &quot;m1.small&quot;, \t\t\t&quot;AllowedValues&quot; : [ &quot;m1.small&quot;, &quot;m1.medium&quot;, &quot;m1.large&quot;, &quot;m1.xlarge&quot;], \t\t\t&quot;Description&quot; : &quot;EC2 instance type&quot; \t\t}, \t\t&quot;BackEndInstanceType&quot; : { \t\t\t&quot;Type&quot; : &quot;String&quot;, \t\t\t&quot;Default&quot; : &quot;m1.small&quot;, \t\t\t&quot;AllowedValues&quot; : [ &quot;m1.small&quot;, &quot;m1.medium&quot;, &quot;m1.large&quot;, &quot;m1.xlarge&quot;], \t\t\t&quot;Description&quot; : &quot;EC2 instance type&quot; \t\t}, \t    &quot;PuppetServer&quot;: { \t\t\t&quot;Description&quot; : &quot;Puppet Server URL&quot;, \t\t\t&quot;Type&quot; : &quot;String&quot;, \t\t\t&quot;Default&quot; : &quot;ec2-231-231-123-123.us-west-2.compute.amazonaws.com&quot; \t\t}, \t\t&quot;Zone&quot; : { \t\t\t&quot;Type&quot; : &quot;CommaDelimitedList&quot;, \t\t\t&quot;Description&quot; : &quot;The Availability Zone &quot;, \t\t\t&quot;Default&quot; : &quot;us-west-2c&quot; \t\t}, \t\t&quot;BuildVersion&quot; : { \t\t\t&quot;Type&quot; : &quot;String&quot;, \t\t\t&quot;Description&quot; : &quot;Version of application build&quot; \t\t}, \t\t&quot;RoleName&quot; : { \t\t\t&quot;Type&quot; : &quot;String&quot;, \t\t\t&quot;Description&quot; : &quot;Instance IAM role&quot;, \t\t\t&quot;Default&quot; : &quot;WebInstance&quot; \t\t}, \t\t&quot;SecurityGroup&quot; : { \t\t\t&quot;Type&quot; : &quot;String&quot;, \t\t\t&quot;Description&quot; : &quot;Default security group for stack&quot;, \t\t\t&quot;Default&quot; : &quot;taws-security-group&quot; \t\t} \t}, \t&quot;Mappings&quot; : { \t\t&quot;WindowsInstanceType&quot; : { \t\t  &quot;t1.micro&quot;    : { &quot;Arch&quot; : &quot;64&quot; }, \t\t  &quot;m1.small&quot;    : { &quot;Arch&quot; : &quot;64&quot; }, \t\t  &quot;m1.medium&quot;   : { &quot;Arch&quot; : &quot;64&quot; }, \t\t  &quot;m1.large&quot;    : { &quot;Arch&quot; : &quot;64&quot; }, \t\t  &quot;m1.xlarge&quot;   : { &quot;Arch&quot; : &quot;64&quot; } \t\t},  \t\t&quot;WindowsRegionMap&quot; : { \t\t  &quot;us-east-1&quot;      : { &quot;AMI&quot; : &quot;ami-e55a7e8c&quot; }, \t\t  &quot;us-west-2&quot;      : { &quot;AMI&quot; : &quot;ami-1e53c82e&quot; }, \t\t  &quot;us-west-1&quot;      : { &quot;AMI&quot; : &quot;ami-b687b1f3&quot; }, \t\t  &quot;eu-west-1&quot;      : { &quot;AMI&quot; : &quot;ami-5f3ad728&quot; }, \t\t  &quot;ap-southeast-1&quot; : { &quot;AMI&quot; : &quot;ami-96cd98c4&quot; }, \t\t  &quot;ap-southeast-2&quot; : { &quot;AMI&quot; : &quot;ami-ab4a2daa&quot; }, \t\t  &quot;ap-northeast-1&quot; : { &quot;AMI&quot; : &quot;ami-133fa329&quot; }, \t\t  &quot;sa-east-1&quot;      : { &quot;AMI&quot; : &quot;ami-bd3d9ba0&quot; } \t\t} \t}, \t&quot;Resources&quot; : { \t\t&quot;FrontEnd&quot; : { \t\t&quot;Type&quot; : &quot;AWS::EC2::Instance&quot;, \t\t&quot;Properties&quot; : { \t\t\t&quot;KeyName&quot; : { &quot;Ref&quot; : &quot;KeyName&quot; }, \t\t\t&quot;ImageId&quot; : { &quot;Fn::FindInMap&quot; : [ &quot;WindowsRegionMap&quot;, { &quot;Ref&quot; : &quot;AWS::Region&quot; }, &quot;AMI&quot; ]}, \t\t\t&quot;InstanceType&quot; : { &quot;Ref&quot; : &quot;FrontEndInstanceType&quot; }, \t\t\t&quot;IamInstanceProfile&quot; : { &quot;Ref&quot; : &quot;RoleName&quot; }, \t\t\t&quot;SecurityGroups&quot; : [{ &quot;Ref&quot; : &quot;SecurityGroup&quot; }], \t\t\t&quot;Tags&quot; : [                 {&quot;Key&quot; : &quot;Name&quot;, &quot;Value&quot; : { &quot;Fn::Join&quot; : [&quot;&quot;,[{&quot;Ref&quot; : &quot;SuffixName&quot;},&quot;-DEV-FrontEnd&quot;]]}} \t\t\t\t], \t\t\t&quot;UserData&quot; : { &quot;Fn::Base64&quot; : { &quot;Fn::Join&quot; : [&quot;&quot;, [ \t\t\t\t  &quot;&lt;powershell&gt;\\n&quot;, \t\t\t\t\t&quot;$MsiUrl = \\&quot;https:\/\/s3-us-west-2.amazonaws.com\/mybucket\/puppet.msi\\&quot;\\n&quot;, \t\t\t\t\t&quot;$downloadPath = \\&quot;c:\\\\puppet.msi\\&quot;\\n&quot;, \t\t\t\t\t&quot;$webClient = New-Object System.Net.WebClient\\n&quot;, \t\t\t\t\t&quot;$webClient.DownloadFile($MsiUrl, $downloadPath)\\n&quot;, \t\t\t\t\t&quot;$process = Start-Process -File $downloadPath -arg \\&quot;\/qn \/norestart\\&quot; -PassThru |wait-process\\n&quot;, \t\t\t\t\t \t\t\t\t\t&quot;$PublicHostName = Invoke-RestMethod -Uri http:\/\/169.254.169.254\/latest\/meta-data\/public-hostname -Method Get\\n&quot;, \t\t\t\t\t&quot;Clear-Content 'C:\\\\ProgramData\\\\PuppetLabs\\\\puppet\\\\etc\\\\puppet.conf'\\n&quot;, \t\t\t\t\t&quot;Add-Content 'C:\\\\ProgramData\\\\PuppetLabs\\\\puppet\\\\etc\\\\puppet.conf' \\&quot;[main]\\&quot;, \\&quot;runinterval=300\\&quot;, \\&quot;certname=$PublicHostName\\&quot;, \\&quot;server=&quot;,{ &quot;Ref&quot; : &quot;PuppetServer&quot; },&quot;\\&quot;, \\&quot;environment=&quot;,{ &quot;Ref&quot; : &quot;PuppetEnvironment&quot; },&quot;\\&quot;\\n&quot;, \t\t\t\t\t&quot;Add-Content 'C:\\\\ProgramData\\\\PuppetLabs\\\\facter\\\\facts.d\\\\facts.bat' \\&quot;@echo off\\&quot;, \\&quot;echo node_role=frontend\\&quot;, \\&quot;echo app_version=&quot;,{ &quot;Ref&quot; : &quot;BuildVersion&quot; },&quot;\\&quot;\\n&quot;, \t\t\t\t\t&quot;Restart-Service pe-puppet\\n&quot;, \t\t\t\t\t \t\t\t\t\t&quot;$MsiUrl = \\&quot;https:\/\/s3-us-west-2.amazonaws.com\/mybucket\/7zip.msi\\&quot;\\n&quot;, \t\t\t\t\t&quot;$downloadPath = \\&quot;c:\\\\7zip.msi\\&quot;\\n&quot;, \t\t\t\t\t&quot;$webClient = New-Object System.Net.WebClient\\n&quot;, \t\t\t\t\t&quot;$webClient.DownloadFile($MsiUrl, $downloadPath)\\n&quot;, \t\t\t\t\t&quot;$process = Start-Process -File $downloadPath -arg \\&quot;\/qn \\&quot; -PassThru |wait-process\\n&quot;, \t\t\t\t\t \t\t\t\t  &quot;&lt;\/powershell&gt;\\n&quot; \t\t\t]]}} \t\t\t} \t\t}, \t\t&quot;BackEnd&quot; : { \t\t&quot;Type&quot; : &quot;AWS::EC2::Instance&quot;, \t\t&quot;Properties&quot; : { \t\t\t&quot;KeyName&quot; : { &quot;Ref&quot; : &quot;KeyName&quot; }, \t\t\t&quot;ImageId&quot; : { &quot;Fn::FindInMap&quot; : [ &quot;WindowsRegionMap&quot;, { &quot;Ref&quot; : &quot;AWS::Region&quot; }, &quot;AMI&quot; ]}, \t\t\t&quot;InstanceType&quot; : { &quot;Ref&quot; : &quot;BackEndInstanceType&quot; }, \t\t\t&quot;IamInstanceProfile&quot; : { &quot;Ref&quot; : &quot;RoleName&quot; }, \t\t\t&quot;SecurityGroups&quot; : [{ &quot;Ref&quot; : &quot;SecurityGroup&quot; }], \t\t\t&quot;Tags&quot; : [                 {&quot;Key&quot; : &quot;Name&quot;, &quot;Value&quot; : { &quot;Fn::Join&quot; : [&quot;&quot;,[{&quot;Ref&quot; : &quot;SuffixName&quot;},&quot;-DEV-BackEnd&quot;]]}} \t\t\t\t], \t\t\t&quot;UserData&quot; : { &quot;Fn::Base64&quot; : { &quot;Fn::Join&quot; : [&quot;&quot;, [ \t\t\t\t  &quot;&lt;powershell&gt;\\n&quot;, \t\t\t\t\t&quot;$MsiUrl = \\&quot;https:\/\/s3-us-west-2.amazonaws.com\/mybucket\/puppet.msi\\&quot;\\n&quot;, \t\t\t\t\t&quot;$downloadPath = \\&quot;c:\\\\puppet.msi\\&quot;\\n&quot;, \t\t\t\t\t&quot;$webClient = New-Object System.Net.WebClient\\n&quot;, \t\t\t\t\t&quot;$webClient.DownloadFile($MsiUrl, $downloadPath)\\n&quot;, \t\t\t\t\t&quot;$process = Start-Process -File $downloadPath -arg \\&quot;\/qn \/norestart\\&quot; -PassThru |wait-process\\n&quot;, \t\t\t\t\t \t\t\t\t\t&quot;$PublicHostName = Invoke-RestMethod -Uri http:\/\/169.254.169.254\/latest\/meta-data\/public-hostname -Method Get\\n&quot;, \t\t\t\t\t&quot;Clear-Content 'C:\\\\ProgramData\\\\PuppetLabs\\\\puppet\\\\etc\\\\puppet.conf'\\n&quot;, \t\t\t\t\t&quot;Add-Content 'C:\\\\ProgramData\\\\PuppetLabs\\\\puppet\\\\etc\\\\puppet.conf' \\&quot;[main]\\&quot;, \\&quot;runinterval=300\\&quot;, \\&quot;certname=$PublicHostName\\&quot;, \\&quot;server=&quot;,{ &quot;Ref&quot; : &quot;PuppetServer&quot; },&quot;\\&quot;, \\&quot;environment=&quot;,{ &quot;Ref&quot; : &quot;PuppetEnvironment&quot; },&quot;\\&quot;\\n&quot;, \t\t\t\t\t&quot;Add-Content 'C:\\\\ProgramData\\\\PuppetLabs\\\\facter\\\\facts.d\\\\facts.bat' \\&quot;@echo off\\&quot;, \\&quot;echo node_role=backend\\&quot;, \\&quot;echo app_version=&quot;,{ &quot;Ref&quot; : &quot;BuildVersion&quot; },&quot;\\&quot;\\n&quot;, \t\t\t\t\t&quot;Restart-Service pe-puppet\\n&quot;, \t\t\t\t\t \t\t\t\t\t&quot;$MsiUrl = \\&quot;https:\/\/s3-us-west-2.amazonaws.com\/mybucket\/7zip.msi\\&quot;\\n&quot;, \t\t\t\t\t&quot;$downloadPath = \\&quot;c:\\\\7zip.msi\\&quot;\\n&quot;, \t\t\t\t\t&quot;$webClient = New-Object System.Net.WebClient\\n&quot;, \t\t\t\t\t&quot;$webClient.DownloadFile($MsiUrl, $downloadPath)\\n&quot;, \t\t\t\t\t&quot;$process = Start-Process -File $downloadPath -arg \\&quot;\/qn \\&quot; -PassThru |wait-process\\n&quot;,\t\t\t\t\t \t\t\t\t  &quot;&lt;\/powershell&gt;\\n&quot; \t\t\t]]}} \t\t\t} \t\t} \t}, \t&quot;Outputs&quot; : { \t\t&quot;FrontEndPublicDnsName&quot; : { \t\t\t\t&quot;Description&quot; : &quot;Public IP address of FrontEnd&quot;, \t\t\t\t&quot;Value&quot; :  { &quot;Fn::Join&quot; : [&quot;&quot;,[{ &quot;Fn::GetAtt&quot; : [ &quot;FrontEnd&quot;, &quot;PublicDnsName&quot; ] }]]}  \t\t\t}, \t\t&quot;BackEndPublicDnsName&quot; : { \t\t\t\t&quot;Description&quot; : &quot;Public IP address of BackEnd&quot;, \t\t\t\t&quot;Value&quot; :  { &quot;Fn::Join&quot; : [&quot;&quot;,[{ &quot;Fn::GetAtt&quot; : [ &quot;BackEnd&quot;, &quot;PublicDnsName&quot; ]}]]}  \t\t\t}\t\t\t \t}\t }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0435:  <\/p>\n<ul>\n<li>KeyName \u2014 \u0418\u043c\u044f \u043a\u043b\u044e\u0447\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/li>\n<li>SuffixName \u2014 \u041d\u0435\u043a\u0438\u0439 \u0441\u0443\u0444\u0444\u0438\u043a\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0430 \u0442\u044d\u0433 Name (\u044d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u044b \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u0435\u0440\u0430)<\/li>\n<li>FrontEndInstanceType \u2014 \u0422\u0438\u043f \u0448\u0435\u0439\u043f\u0430 \u0434\u043b\u044f FrontEnd<\/li>\n<li>BackEndInstanceType \u2014 \u0422\u0438\u043f \u0448\u0435\u0439\u043f\u0430 \u0434\u043b\u044f BackEnd<\/li>\n<li>PuppetServer \u2014 Url \u0432\u0430\u0448\u0435\u0433\u043e Puppet \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/li>\n<li>Zone \u2014 \u0417\u043e\u043d\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/li>\n<li>BuildVersion \u2014 \u0412\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u0430 \u0441 S3<\/li>\n<li>RoleName \u2014 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044f IAM Role \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u00abS3 Read-Only\u00bb<\/li>\n<li>SecurityGroup \u2014 \u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u043a\u044c\u044e\u0440\u0438\u0442\u0438 \u0433\u0440\u0443\u043f\u043f\u0430<\/li>\n<\/ul>\n<p>  IAM Role \u0438 Security Group \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u0436\u0435 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u043e\u043c, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0436\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435. \u0412 \u043c\u043e\u0435\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0441 \u0446\u0435\u043b\u044c\u044e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<br \/>  \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 UserData \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 puppet agent, 7zip \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f puppet.conf \u0438 facts.bat.<br \/>  \u0421 Cloud Formation \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438, \u043f\u043e\u0440\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Puppet.<\/p>\n<h5>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Puppet Server Enterprise<\/h5>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Puppet Server Enterprise, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"http:\/\/puppetlabs.com\/misc\/pe-files\/previous-releases\">\u0430\u0440\u0445\u0438\u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u0430<\/a>, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c puppet-server-installer. \u0427\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b <b>\/etc\/puppetlabs\/puppet\/autosign.conf<\/b> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"bash\">* <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438. \u041c\u043e\u0434\u0443\u043b\u0438, \u044d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043a\u0443\u043a\u0431\u0443\u043a\u043e\u0432 \u0432 Chef. \u0420\u0430\u0437\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0432 \u043f\u0430\u043f\u043a\u0435 <b>\/etc\/puppetlabs\/puppet\/modules<\/b>.<br \/>  \u0423\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f:  <\/p>\n<ul>\n<li><code>my_module\/<\/code> \u2014 \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044f.<br \/> \n<ul>\n<li><code>manifests\/<\/code> \u2014 \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u044f.<br \/> \n<ul>\n<li><code>init.pp<\/code> \u2014 \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441 <strong><code>my_module<\/code>.<\/strong> <strong>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f.<\/strong><\/li>\n<li><code>other_class.pp<\/code> \u2014 \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0434\u0443\u043b\u044f <strong><code>my_module::other_class<\/code>.<\/strong><\/li>\n<\/ul>\n<\/li>\n<li><code>files\/<\/code> \u2014 \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043a\u0430\u0447\u0430\u043d\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c<\/li>\n<li><code>lib\/<\/code> \u2014 \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0444\u0430\u043a\u0442\u044b<\/li>\n<li><code>templates\/<\/code> \u2014 \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u0435<br \/> \n<ul>\n<li><code>component.erb<\/code> \u2014 \u042d\u0442\u043e\u0442 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u043a\u0430\u043a <code>template('my_module\/component.erb')<\/code>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>  \u0423 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u0435\u043c\u044c \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442).  <\/p>\n<ol>\n<li><b>nodes<\/b> \u2014 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <b>node_role<\/b>, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c <br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/puppetlabs\/puppet\/modules\/nodes\/manifests\/init.pp<\/b><\/p>\n<div class=\"spoiler_text\">class nodes {<br \/>   if &quot;${node_role}&quot; == \u00abbackend\u00bb {<br \/>   include backend<br \/>   }<br \/>   if &quot;${node_role}&quot; == \u00abfrontend\u00bb {<br \/>   include frontend<br \/>   }<br \/>  }   <\/div>\n<\/div>\n<p>   <\/li>\n<li><b>getbuild<\/b> \u2014 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 AWS S3.<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/puppetlabs\/puppet\/modules\/getbuild\/manifests\/init.pp<\/b><\/p>\n<div class=\"spoiler_text\"> class getbuild {<br \/>   file { &#8216;c:\\config&#8217;:<br \/>   ensure =&gt; &#8216;directory&#8217;<br \/>   } -&gt; <br \/>   file { &#8216;c:\\Build&#8217;:<br \/>   ensure =&gt; &#8216;directory&#8217;<br \/>   } -&gt;<br \/>   exec { &#8216;download_build&#8217;:<br \/>   creates =&gt; \u00abc:\\\\config\\\\${app_version}\u00bb,<br \/>   path =&gt; $::path,<br \/>   command =&gt; \u00abpowershell.exe -executionpolicy unrestricted start-bitstransfer -source <a href=\"https:\/\/s3-us-west-2.amazonaws.com\/mybucket\/\">s3-us-west-2.amazonaws.com\/mybucket\/<\/a>${app_version} -Destination &#8216;c:\\\\config\\\\&#8217;\u00bb,<br \/>   } -&gt; <br \/>   exec { &#8216;app_install&#8217;:<br \/>   creates =&gt; \u00abc:\\\\Build\\CustomBackendService.exe.config\u00bb,<br \/>   command =&gt; &quot;\\\u00abc:\\\\Program Files\\\\7-Zip\\\\7z.exe\\\u00bb x c:\\\\config\\\\${app_version} -oC:\\\\Build &quot;,<br \/>   } <\/p>\n<p>  }   <\/div>\n<\/div>\n<p>   <\/li>\n<li><b>mongodb<\/b> \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 MongoDB<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/puppetlabs\/puppet\/modules\/mongodb\/manifests\/init.pp<\/b><\/p>\n<div class=\"spoiler_text\">class mongodb {<br \/>   file { &#8216;c:\/config&#8217;:<br \/>   ensure =&gt; directory,<br \/>   } -&gt;<br \/>   file { &#8216;c:\/config\/mongodb.zip&#8217;:<br \/>   ensure =&gt; file,<br \/>   mode =&gt; &#8216;0777&#8217;,<br \/>   source =&gt; &#8216;puppet:\/\/\/modules\/mongodb\/mongodb-win32-x86_64-v2.4-latest.zip&#8217;,<br \/>   } -&gt;<br \/>   file { &#8216;c:\/MongoDB&#8217;:<br \/>   ensure =&gt; directory,<br \/>   } -&gt;<br \/>   file { &#8216;c:\/MongoDB\/bin&#8217;:<br \/>   ensure =&gt; directory,<br \/>   } -&gt;<br \/>   file { &#8216;c:\/MongoDB\/Data&#8217;:<br \/>   ensure =&gt; directory,<br \/>   } -&gt;<br \/>   file { &#8216;c:\/MongoDB\/logs&#8217;:<br \/>   ensure =&gt; directory,<br \/>   } -&gt;<br \/>   exec { &#8216;mongodb-unzip&#8217;:<br \/>   creates =&gt; &#8216;c:\/MongoDB\/bin\/mongod.exe&#8217;,<br \/>   command =&gt; &#8216;\u00abc:\\\\Program Files\\\\7-Zip\\\\7z.exe\u00bb e c:\\\\config\\mongodb.zip -oC:\\\\MongoDB\\\\bin&#8217;,<br \/>   } -&gt;<br \/>   exec { &#8216;mongodb-install&#8217;:<br \/>   creates =&gt; &#8216;c:\/MongoDB\/logs\/mongodb.log&#8217;,<br \/>   command =&gt; &#8216;\u00abc:\\\\MongoDB\\\\mongod.exe\u00bb &#8212;dbpath=c:\\\\MongoDB\\\\Data &#8212;port 27017 &#8212;logpath=c:\\\\MongoDB\\logs\\\\mongodb.log &#8212;install &#8212;serviceName mongodb &#8212;serviceDisplayName \u00abMongoDB Server\u00bb &#8212;serviceDescription \u00abMongoDB Server\u00bb&#8217;,<br \/>   } -&gt;<br \/>   exec { &#8216;mongodb-run&#8217;:<br \/>   path =&gt; $::path,<br \/>   command =&gt; &#8216;powershell.exe start-service mongodb&#8217;<br \/>   }<br \/>  }   <\/div>\n<\/div>\n<p>   <\/li>\n<li><b>api <\/b> \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 FrontEnd<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/puppetlabs\/puppet\/modules\/api\/manifests\/init.pp<\/b><\/p>\n<div class=\"spoiler_text\">class api {<br \/>   include getbuild <br \/>   exec { &#8216;iis_enable&#8217;:<br \/>   creates =&gt; \u00abC:\\inetpub\u00bb,<br \/>   command =&gt; \u00abServerManagerCmd -install Web-Server\u00bb<\/p>\n<p>   } -&gt;<br \/>   exec { &#8216;api_deploy&#8217;:<br \/>   path =&gt; $::path,<br \/>   command =&gt; \u00abpowershell.exe Set-ItemProperty &#8216;IIS:\\Sites\\Default Web Site&#8217; -Name MySite -Value C:\\Build\u00bb<br \/>   }<br \/>  }   <\/div>\n<\/div>\n<p>   <\/li>\n<li><b>worker<\/b> \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 BackEnd<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/puppetlabs\/puppet\/modules\/worker\/manifests\/init.pp<\/b><\/p>\n<div class=\"spoiler_text\">class worker {<br \/>   include getbuild <br \/>   exec { &#8216;service_install&#8217;:<br \/>   creates =&gt; \u00abc:\\\\Build\\\\Custom.AWS.BackendService.InstallLog\u00bb,<br \/>   command =&gt; \u00abc:\\\\Build\\\\Custom.AWS.BackendService.exe -install\u00bb,<br \/>   } -&gt;<br \/>   exec { &#8216;service-run&#8217;:<br \/>   path =&gt; $::path,<br \/>   command =&gt; &#8216;powershell.exe start-service Custom.AWS.Backend&#8217;<br \/>   } <br \/>  }   <\/div>\n<\/div>\n<p>   <\/li>\n<li><b>frontend<\/b> \u2014 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b FrontEnd<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/puppetlabs\/puppet\/modules\/frontend\/manifests\/init.pp<\/b><\/p>\n<div class=\"spoiler_text\">class frontend {<br \/>   include api<br \/>  }   <\/div>\n<\/div>\n<p>   <\/li>\n<li><b>backend<\/b> \u2014 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b BackEnd<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/puppetlabs\/puppet\/modules\/backend\/manifests\/init.pp<\/b><\/p>\n<div class=\"spoiler_text\">class backend {<br \/>   include mongodb<br \/>   include worker<br \/>  }   <\/div>\n<\/div>\n<p>   <\/li>\n<\/ol>\n<p>  \u0412 \u0441\u0432\u043e\u0438\u0445 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430\u0445 \u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0435\u0437\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0440\u0435\u0441\u0443\u0440\u0441 <b>exec<\/b>. \u041f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 <b>creates<\/b> \u044d\u0442\u043e\u0442 \u0440\u0435\u0441\u0443\u0440\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437\u043e\u0442\u043a\u0430\u0437\u043d\u043e.<br \/>  \u0411\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:  <\/p>\n<pre><code class=\"bash\">exec { 'mongodb-unzip': \t\tcreates =&gt; 'c:\/MongoDB\/bin\/mongod.exe', \t\tcommand =&gt; '&quot;c:\\\\Program Files\\\\7-Zip\\\\7z.exe&quot; e c:\\\\config\\mongodb.zip -oC:\\\\MongoDB\\\\bin', \t}  <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b <b>c:\/MongoDB\/bin\/mongod.exe<\/b> \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u0430\u0440\u0445\u0438\u0432\u0430.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u0412\u0430\u0448\u0435\u0439 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 CI \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/jenkins-ci.org\/\">Jenkins<\/a>, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0442\u0443\u0434\u0430 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Cloud Formation template \u0438 \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u0435\u0440\u044b \u0441\u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u0438\u043d \u043a\u043b\u0438\u043a.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u2026<br \/>  \u0415\u0441\u043b\u0438 \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0432\u0448\u0438\u0445 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0431\u0443\u0434\u0443\u0442 \u0441\u043f\u0435\u0446\u044b \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e Puppet, \u044f \u0441 \u043f\u0440\u0435\u0432\u0435\u043b\u0438\u043a\u043e\u0439 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u044e \u0412\u0430\u0448\u0435 \u043c\u043d\u0435\u043d\u0438\u0435.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/epam_systems\/blog\/208710\/\"> http:\/\/habrahabr.ru\/company\/epam_systems\/blog\/208710\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/200\/79c\/fe5\/20079cfe55c72ed0ce9ed5b9ac52108a.jpg\" alt=\"image\" align=\"left\"\/>\u0412\u043e\u0442 \u0438 \u043d\u0430\u0441\u0442\u0430\u043b \u0442\u043e\u0442 \u0434\u0435\u043d\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043a\u0443\u043a\u0431\u0443\u043a\u0438, \u0440\u0435\u0446\u0435\u043f\u0442\u044b, \u043d\u043e\u0436 \u0448\u0435\u0444-\u043f\u043e\u0432\u0430\u0440\u0430 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043a\u0443\u043a\u043b\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c. <br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u2014 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u0435\u0440\u043e\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/puppetlabs.com\/puppet\/puppet-enterprise\">Puppet Enterprise<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-208710","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208710"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208710\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}