Skip to content

Instantly share code, notes, and snippets.

@nvalentine-puppetlabs
Last active August 29, 2015 14:25
Show Gist options
  • Save nvalentine-puppetlabs/9ba46b84f2bd425bf4f1 to your computer and use it in GitHub Desktop.
Save nvalentine-puppetlabs/9ba46b84f2bd425bf4f1 to your computer and use it in GitHub Desktop.
demo.pp
$pe_username = 'admin@puppetlabs.com'
$pe_password = 'puppetlabs'
$pe_version_string = '3.7.0'
$seteam_env_build = '2.0.5'
$aws_public_key = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxo0CLz8UIFMfhBGunu25HLwHSfkWzUpYUATOMHZOxV053YT6pRS+OLB5wc7M826JzriGQ8S5pweUPEbksN1OdzSfT/YDiw39uGep8Eoj5FoRwGAWv8Maoeif/t24KNHnW+IiI4hTnzPJXAmwoJXIXa2O6ZK323rYYBF/QmfPLcKXPWKKMSjfkskYPFcNIDyZ7Gfzou9UStZ85fTAhQa4KyKJ3v7UPvLVZChXbIoiC2xo0jW5ocKFfRUkktNfU2YvQZFT1/0wMnh2man7LbTlK9Wmh/BVnPO36iQ86PST7tw0ITf2ebHU1g4RTcruTwioyxwiF9Nxfi8LqQbccvHPJ'
$aws_region = 'us-west-1'
$aws_ami = 'ami-c154b385'
$demo = {
'department' => 'TSE',
'created_by' => "${::id}",
'project' => 'iStartup presales demo',
}
ec2_securitygroup { 'iStartup demo SG':
ensure => present,
region => $aws_region,
description => 'SG for all iStartup demo nodes',
ingress => [
{ protocol => 'tcp', port => '443', cidr => '0.0.0.0/0', },
{ protocol => 'tcp', port => '22', cidr => '0.0.0.0/0', }
],
tags => [{
'department' => $demo['department'],
'created_by' => $demo['created_by'],
'project' => $demo['project'],
}],
}
ec2_instance { "lb0-${::id}":
ensure => present,
region => $aws_region,
image_id => $aws_ami,
instance_type => 'm1.small',
monitoring => 'true',
key_name => 'nvalentine',
security_groups => ['iStartup demo SG'],
user_data => template('aws_stack/master-pe-userdata.erb'),
tags => [{
'department' => $demo['department'],
'created_by' => $demo['created_by'],
'project' => $demo['project'],
}],
require => Ec2_securitygroup['iStartup demo SG'],
}
ec2_instance { "app0-${::id}":
ensure => present,
region => $aws_region,
image_id => $aws_ami,
instance_type => 'm1.small',
monitoring => 'true',
key_name => 'nvalentine',
security_groups => ['iStartup demo SG'],
user_data => template('aws_stack/master-pe-userdata.erb'),
tags => [{
'department' => $demo['department'],
'created_by' => $demo['created_by'],
'project' => $demo['project'],
}],
require => Ec2_securitygroup['iStartup demo SG'],
}
ec2_instance { "app1-${::id}":
ensure => present,
region => $aws_region,
image_id => $aws_ami,
instance_type => 'm1.small',
monitoring => 'true',
key_name => 'nvalentine',
security_groups => ['iStartup demo SG'],
user_data => template('aws_stack/master-pe-userdata.erb'),
tags => [{
'department' => $demo['department'],
'created_by' => $demo['created_by'],
'project' => $demo['project'],
}],
require => Ec2_securitygroup['iStartup demo SG'],
}
ec2_instance { "db0-${::id}":
ensure => present,
region => $aws_region,
image_id => $aws_ami,
instance_type => 'm1.small',
monitoring => 'true',
key_name => 'nvalentine',
security_groups => ['iStartup demo SG'],
user_data => template('aws_stack/master-pe-userdata.erb'),
tags => [{
'department' => $demo['department'],
'created_by' => $demo['created_by'],
'project' => $demo['project'],
}],
require => Ec2_securitygroup['iStartup demo SG'],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment