A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: amazon puppet wordpress - Stikked
From Crippled Camel, 8 Years ago, written in JavaScript.
This paste is a reply to amazon puppet wordpress from Colossal Madrill - view diff
Embed
  1. //https://s3.amazonaws.com/cloudformation-templates-us-east-1/wordpress-via-puppet-client.template
  2.  
  3. {
  4.   "AWSTemplateFormatVersion" : "2010-09-09",
  5.  
  6.   "Description": "Sample template to bring up WordPress using the Puppet client to install server roles. A WaitCondition is used to hold up the stack creation until the application is deployed. **WARNING** This template creates one or more Amazon EC2 instances and CloudWatch alarms. You will be billed for the AWS resources used if you create a stack from this template.",
  7.  
  8.   "Parameters" : {
  9.     "KeyName": {
  10.       "Type": "String",
  11.       "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the web server"
  12.     },
  13.     "PuppetClientSecurityGroup": {
  14.       "Description" : "The EC2 security group for the instances",
  15.       "Type": "String"
  16.     },
  17.     "PuppetMasterDNSName": {
  18.       "Description" : "The PuppetMaster DNS name",
  19.       "Type": "String"
  20.     },
  21.     "InstanceType" : {
  22.       "Description" : "WebServer EC2 instance type",
  23.       "Type" : "String",
  24.       "Default" : "m1.small",
  25.       "AllowedValues" : [ "t1.micro","m1.small","m1.medium","m1.large","m1.xlarge","m2.xlarge","m2.2xlarge","m2.4xlarge","c1.medium","c1.xlarge","cc1.4xlarge","cc2.8xlarge","cg1.4xlarge"],
  26.       "ConstraintDescription" : "must be a valid EC2 instance type."
  27.     },
  28.     "DatabaseType": {
  29.       "Default": "db.m1.small",
  30.       "Description" : "The database instance type",
  31.       "Type": "String",
  32.       "AllowedValues" : [ "db.m1.small", "db.m1.large", "db.m1.xlarge", "db.m2.xlarge", "db.m2.2xlarge", "db.m2.4xlarge" ],
  33.       "ConstraintDescription" : "must contain only alphanumeric characters."
  34.     },
  35.     "DatabaseUser": {
  36.       "Default" : "admin",
  37.       "NoEcho": "true",
  38.       "Type": "String",
  39.       "Description" : "Test database admin account name",
  40.       "MinLength": "1",
  41.       "MaxLength": "16",
  42.       "AllowedPattern" : "[a-zA-Z][a-zA-Z0-9]*",
  43.       "ConstraintDescription" : "must begin with a letter and contain only alphanumeric characters."
  44.     },
  45.     "DatabasePassword": {
  46.       "Default" : "admin",
  47.       "NoEcho": "true",
  48.       "Type": "String",
  49.       "Description" : "Test database admin account password",
  50.       "MinLength": "1",
  51.       "MaxLength": "41",
  52.       "AllowedPattern" : "[a-zA-Z0-9]*",
  53.       "ConstraintDescription" : "must contain only alphanumeric characters."
  54.     }
  55.   },
  56.  
  57.   "Mappings" : {
  58.     "AWSInstanceType2Arch" : {
  59.       "t1.micro"    : { "Arch" : "64" },
  60.       "m1.small"    : { "Arch" : "64" },
  61.       "m1.medium"   : { "Arch" : "64" },
  62.       "m1.large"    : { "Arch" : "64" },
  63.       "m1.xlarge"   : { "Arch" : "64" },
  64.       "m2.xlarge"   : { "Arch" : "64" },
  65.       "m2.2xlarge"  : { "Arch" : "64" },
  66.       "m2.4xlarge"  : { "Arch" : "64" },
  67.       "c1.medium"   : { "Arch" : "64" },
  68.       "c1.xlarge"   : { "Arch" : "64" },
  69.       "cc1.4xlarge" : { "Arch" : "64HVM" },
  70.       "cc2.8xlarge" : { "Arch" : "64HVM" },
  71.       "cg1.4xlarge" : { "Arch" : "64HVM" }
  72.     },
  73.  
  74.     "AWSRegionArch2AMI" : {
  75.       "us-east-1"      : { "32" : "ami-31814f58", "64" : "ami-1b814f72", "64HVM" : "ami-0da96764" },
  76.       "us-west-2"      : { "32" : "ami-38fe7308", "64" : "ami-30fe7300", "64HVM" : "NOT_YET_SUPPORTED" },
  77.       "us-west-1"      : { "32" : "ami-11d68a54", "64" : "ami-1bd68a5e", "64HVM" : "NOT_YET_SUPPORTED" },
  78.       "eu-west-1"      : { "32" : "ami-973b06e3", "64" : "ami-953b06e1", "64HVM" : "NOT_YET_SUPPORTED" },
  79.       "ap-southeast-1" : { "32" : "ami-b4b0cae6", "64" : "ami-beb0caec", "64HVM" : "NOT_YET_SUPPORTED" },
  80.       "ap-northeast-1" : { "32" : "ami-0644f007", "64" : "ami-0a44f00b", "64HVM" : "NOT_YET_SUPPORTED" },
  81.       "sa-east-1"      : { "32" : "ami-3e3be423", "64" : "ami-3c3be421", "64HVM" : "NOT_YET_SUPPORTED" }
  82.     }
  83.   },
  84.    
  85.   "Resources" : {  
  86.  
  87.     "CFNInitUser" : {
  88.       "Type" : "AWS::IAM::User",
  89.       "Properties" : {
  90.         "Policies": [{
  91.           "PolicyName": "AccessForCFNInit",
  92.           "PolicyDocument" : {
  93.             "Statement": [{
  94.               "Effect"   : "Allow",
  95.               "Action"   : "cloudformation:DescribeStackResource",
  96.               "Resource" : "*"
  97.             }]
  98.           }
  99.         }]
  100.       }
  101.     },
  102.  
  103.     "CFNKeys" : {
  104.       "Type" : "AWS::IAM::AccessKey",
  105.       "Properties" : {
  106.         "UserName" : { "Ref": "CFNInitUser" }
  107.       }
  108.     },
  109.  
  110.     "WebServer": {  
  111.       "Type": "AWS::EC2::Instance",
  112.       "Metadata" : {
  113.         "AWS::CloudFormation::Init" : {
  114.           "config" : {
  115.             "packages" : {
  116.               "yum" : {
  117.                 "puppet"     : [],
  118.                 "ruby-devel" : [],
  119.                 "gcc"        : [],
  120.                 "make"       : [],
  121.                 "rubygems"   : []
  122.               },
  123.               "rubygems" : {
  124.                 "json"       : []
  125.               }
  126.             },
  127.             "files" : {
  128.               "/etc/yum.repos.d/epel.repo" : {
  129.                 "source" : "https://s3.amazonaws.com/cloudformation-examples/enable-epel-on-amazon-linux-ami",
  130.                 "mode"   : "000644",
  131.                 "owner"  : "root",
  132.                 "group"  : "root"
  133.               },
  134.               "/etc/puppet/puppet.conf" : {
  135.                 "content" : { "Fn::Join" : ["", [
  136.                   "[main]\n",
  137.                   "   logdir=/var/log/puppet\n",
  138.                   "   rundir=/var/run/puppet\n",
  139.                   "   ssldir=$vardir/ssl\n",
  140.                   "   pluginsync=true\n",
  141.                   "[agent]\n",
  142.                   "   classfile=$vardir/classes.txt\n",
  143.                   "   localconfig=$vardir/localconfig\n",
  144.                   "   server=",{ "Ref" : "PuppetMasterDNSName" },"\n"
  145.                 ]] },
  146.                 "mode" : "000644",
  147.                 "owner" : "root",
  148.                 "group" : "root"
  149.               }
  150.             },
  151.             "services" : {
  152.               "sysvinit" : {  
  153.                 "puppet" : {
  154.                   "enabled" : "true",
  155.                   "ensureRunning" : "true"                
  156.                 }
  157.               }
  158.             }
  159.           }
  160.         },
  161.         "Puppet" : {
  162.           "roles"    : [ "wordpress" ],
  163.           "host"     : {"Fn::GetAtt" : ["WordPressDatabase", "Endpoint.Address"]},
  164.           "database" : "WordPressDB",
  165.           "user"     : {"Ref" : "DatabaseUser"},
  166.           "password" : {"Ref" : "DatabasePassword" }
  167.         }
  168.       },
  169.       "Properties": {
  170.         "SecurityGroups": [ { "Ref": "PuppetClientSecurityGroup" }, { "Ref" : "EC2SecurityGroup" } ],
  171.         "ImageId": { "Fn::FindInMap": [ "AWSRegionArch2AMI", { "Ref": "AWS::Region" }, { "Fn::FindInMap": [ "AWSInstanceType2Arch", { "Ref": "InstanceType" }, "Arch" ] } ]
  172.         },
  173.         "UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
  174.           "#!/bin/bash\n",
  175.           "yum update -y aws-cfn-bootstrap\n",
  176.  
  177.           "/opt/aws/bin/cfn-init --region ", { "Ref" : "AWS::Region" },
  178.           "    -s ", { "Ref" : "AWS::StackName" }, " -r WebServer ",
  179.           "    --access-key ", { "Ref" : "CFNKeys" },
  180.           "    --secret-key ", { "Fn::GetAtt" : ["CFNKeys", "SecretAccessKey"]}, "\n",
  181.           "/opt/aws/bin/cfn-signal -e $? '", { "Ref" : "ApplicationWaitHandle" }, "'\n"
  182.         ]]}},
  183.         "KeyName": { "Ref": "KeyName" },
  184.         "InstanceType": { "Ref": "InstanceType" }
  185.       }
  186.     },
  187.  
  188.  
  189.     "EC2SecurityGroup" : {
  190.       "Type" : "AWS::EC2::SecurityGroup",
  191.       "Properties" : {
  192.         "GroupDescription" : "Enable HTTP access for Wordpress plus SSH access via port 22",
  193.         "SecurityGroupIngress" : [
  194.           {"IpProtocol" : "tcp", "FromPort" : "22", "ToPort" : "22", "CidrIp" : "0.0.0.0/0" },
  195.           {"IpProtocol" : "tcp", "FromPort" : "80", "ToPort" : "80", "CidrIp" : "0.0.0.0/0" }
  196.         ]
  197.       }
  198.     },
  199.  
  200.     "ApplicationWaitHandle" : {
  201.       "Type" : "AWS::CloudFormation::WaitConditionHandle"
  202.     },
  203.  
  204.     "ApplicationWaitCondition" : {
  205.       "Type" : "AWS::CloudFormation::WaitCondition",
  206.       "DependsOn"  : "WebServer",
  207.       "Properties" : {
  208.         "Handle"   : { "Ref" : "ApplicationWaitHandle" },
  209.         "Timeout"  : "600"
  210.       }
  211.     },
  212.  
  213.     "WordPressDatabase" : {
  214.       "Type" : "AWS::RDS::DBInstance",
  215.       "Properties" : {
  216.         "AllocatedStorage"   : "5",
  217.         "DBName"             : "WordPressDB",
  218.         "Engine"             : "MySQL",
  219.         "DBInstanceClass"    : { "Ref" : "DatabaseType" },
  220.         "DBSecurityGroups"   : [ { "Ref": "DBSecurityGroup" } ],
  221.         "MasterUsername"     : { "Ref" : "DatabaseUser" },
  222.         "MasterUserPassword" : { "Ref" : "DatabasePassword" }
  223.       }
  224.     },
  225.  
  226.     "DBSecurityGroup": {
  227.       "Type": "AWS::RDS::DBSecurityGroup",
  228.       "Properties": {
  229.         "DBSecurityGroupIngress": {
  230.           "EC2SecurityGroupName": { "Ref": "EC2SecurityGroup" }
  231.         },
  232.         "GroupDescription": "database access"
  233.       }
  234.     }
  235.   },
  236.  
  237.   "Outputs": {
  238.     "WebsiteURL": {
  239.       "Value": { "Fn::Join": [ "", [ "http://", { "Fn::GetAtt": [ "WebServer", "PublicDnsName" ] }, "/wordpress" ] ] },
  240.       "Description" : "URL of the WordPress website"
  241.     },
  242.     "InstallURL": {
  243.       "Value": { "Fn::Join": [ "", [ "http://", { "Fn::GetAtt": [ "WebServer", "PublicDnsName" ] }, "/wordpress/wp-admin/install.php" ] ] },
  244.       "Description" : "URL to install WordPress"
  245.     }
  246.   }
  247. }