SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
WELCOME
Puppet and AWS
Getting the Best of BothWorlds
Mike Ryan - Epitech BV
23
August
2013
CONTACT:
mike@epitech.nl
www.epitech.nl
Saturday, August 24, 13
EPITECH BV
Hello, I’m Mike
2
CONTACT:
mike@epitech.nl
www.epitech.nl
Sysadmin	
  with	
  a	
  passion	
  for	
  automa2on
Londoner	
  in	
  Amsterdam
Epitech.nl	
  -­‐	
  sysadmin	
  as	
  a	
  service
Saturday, August 24, 13
EPITECH BV
AWS - A very brief
introduction
3
CONTACT:
mike@epitech.nl
www.epitech.nl
EC2	
  -­‐	
  Elas2c	
  Compute	
  Cloud
AMI	
  -­‐	
  Amazon	
  Machine	
  Images
User	
  Data
Saturday, August 24, 13
EPITECH BV
EC2 - Auto Scaling
4
CONTACT:
mike@epitech.nl
www.epitech.nl
Saturday, August 24, 13
EPITECH BV
CloudFormation
5
CONTACT:
mike@epitech.nl
www.epitech.nl
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "EC2 instance",
"Resources" : {
"MyEC2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : "ami-79fd7eee",
"KeyName" : "my-ssh-key",
}
}
}
}
Saturday, August 24, 13
EPITECH BV
6
CONTACT:
mike@epitech.nl
www.epitech.nl
}
}
}
},
"asgMyAutoScalingGroup": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AvailabilityZones": [
"us-east-1b",
"us-east-1c"
],
"Cooldown": "300",
"DesiredCapacity": "1",
"MaxSize": "1",
"MinSize": "1",
"LaunchConfigurationName": {
"Ref": "lcMyLC"
},
"LoadBalancerNames": [
{
"Ref": "elbMyLB"
}
]
}
},
"s3webapplication": {
"Type": "AWS::S3::Bucket"
},
"sgwebappsecuritygroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "for web app",
"SecurityGroupIngress": [
Saturday, August 24, 13
EPITECH BV
7
CONTACT:
mike@epitech.nl
www.epitech.nl
Bootstrapping an
Infrastructure
www.infrastructures.org
Saturday, August 24, 13
EPITECH BV
8
CONTACT:
mike@epitech.nl
www.epitech.nl
CloudFormation or Puppet
Saturday, August 24, 13
EPITECH BV
9
CONTACT:
mike@epitech.nl
www.epitech.nl
Files, Services and Packages
with cfn-init
"Metadata": {
"AWS::CloudFormation::Init": {
"config": {
"sources" : {
"/etc/puppet" : "http://example.com/puppet.tar.gz"
},
"packages": {
"yum": {
"puppet-server": [],
},
},
"services": {
"sysvinit": {
"puppetmaster": {
"ensureRunning": "true",
"enabled": "true"
Saturday, August 24, 13
EPITECH BV
10
CONTACT:
mike@epitech.nl
www.epitech.nl
Run a script at launch time
with User Data
{ "AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "EC2 instance",
"Resources" : {
"PuppetMasterInstance": {
"Type": "AWS::EC2::Instance",
"Metadata": { },
"Properties": {
"UserData": {
"Fn::Base64": {
"Fn::Join": [ "",
[
"#!/bin/bashn",
"/opt/aws/bin/cfn-init --region ", "n",
"/usr/bin/puppet apply site.pp, "n"
]
...
Saturday, August 24, 13
EPITECH BV
11
CONTACT:
mike@epitech.nl
www.epitech.nl
cfn-create-stack
cfn-create-stack puppetmaster 
--template-file=puppetmaster.json
http://aws.amazon.com/developertools/
2555753788650372
http://aws.amazon.com/cli/
Saturday, August 24, 13
EPITECH BV
12
CONTACT:
mike@epitech.nl
www.epitech.nl
Auto Scale = Autosign
Saturday, August 24, 13
EPITECH BV
13
CONTACT:
mike@epitech.nl
www.epitech.nl
The Hostname Issue
mike@ip-10-32-34-116:~$ hostname -f
ip-10-32-34-116.eu-west-1.compute.internal
Saturday, August 24, 13
EPITECH BV
14
CONTACT:
mike@epitech.nl
www.epitech.nl
User Data - Web Console
Saturday, August 24, 13
EPITECH BV
15
CONTACT:
mike@epitech.nl
www.epitech.nl
User Data - CloudFormation},
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
“{”role”: ”web”, ”,
“”env”: ”staging”} ”
]
]
}
}
Saturday, August 24, 13
EPITECH BV
16
CONTACT:
mike@epitech.nl
www.epitech.nl
include stdlib
node default {
  $userdata = parsejson($ec2_userdata)
$role = userdata[‘role’]
$environment = userdata[‘env’]
case $role {
‘web’: {
include nginx
}
‘db’: {
include postgresql
}
}
}
Saturday, August 24, 13
EPITECH BV
17
CONTACT:
mike@epitech.nl
www.epitech.nl
Vagrant -> EC2
Saturday, August 24, 13
EPITECH BV
18
CONTACT:
mike@epitech.nl
www.epitech.nl
Saturday, August 24, 13
EPITECH BV
19
CONTACT:
mike@epitech.nl
www.epitech.nl
Vagrant::Config.run do |config|
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "../puppet/manifests"
puppet.module_path = "../puppet/modules"
puppet.manifest_file = "site.pp"
puppet.options = "--verbose --debug"
puppet.facter = {
:ec2_userdata => {
:role => "database",
:env => "vagrant",
}.to_json,
:vagrant => "true"
}
end
end
Saturday, August 24, 13
EPITECH BV
20
CONTACT:
mike@epitech.nl
www.epitech.nl
Decoupling
Saturday, August 24, 13
EPITECH BV
21
CONTACT:
mike@epitech.nl
www.epitech.nl
Broken Puppet Master =
Broken Auto Scaling
No
Saturday, August 24, 13
EPITECH BV
22
CONTACT:
mike@epitech.nl
www.epitech.nl
#!/bin/bash
/usr/local/bin/update.sh
/usr/bin/puppet apply site.pp
/etc/rc.local
Saturday, August 24, 13
EPITECH BV
23
CONTACT:
mike@epitech.nl
www.epitech.nl
But you lose...
Puppet	
  Dashboard
Exported	
  Resources
Stored	
  configs
Saturday, August 24, 13
EPITECH BV
24
CONTACT:
mike@epitech.nl
www.epitech.nl
env.roledefs = {
'web': ['www1', 'www2', 'www3'],
'db': ['db1', 'db1']
}
@roles('db', ‘web’)
def run_puppet():
sudo('puppet apply site.pp')
$fab run_puppet #run puppet everywhere
$fab run_puppet --roles db # role-specific
Triggering Puppet with
Fabric
Saturday, August 24, 13
EPITECH BV
25
CONTACT:
mike@epitech.nl
www.epitech.nl
def configure_roles():
 tags = EC2TagManager(AWS_KEY, AWS_SECRET,
   regions=['eu-west-1'])
 roles = {}
for role in [‘db’, ‘web’]:
roles[role] =
tags.get_instances(role=role)
return roles
Triggering Puppet with Fabric
https://github.com/mikery/fabric-ec2
Saturday, August 24, 13
THANK YOU
BACK X
CONTACT:
Mike Ryan - Epitech BV
mike@epitech.nl
mike@epitech.nl
www.epitech.nl
Saturday, August 24, 13

Weitere ähnliche Inhalte

Mehr von Puppet

Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automation
Puppet
 
Take control of your DevOps Dumping Ground; Melissa Sussmann
Take control of your DevOps Dumping Ground; Melissa SussmannTake control of your DevOps Dumping Ground; Melissa Sussmann
Take control of your DevOps Dumping Ground; Melissa Sussmann
Puppet
 

Mehr von Puppet (20)

Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automation
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliance
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNow
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden Windows
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael Pinson
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin Reeuwijk
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping ground
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User Group
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOps
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin Reeuwijk
 
Puppet in k8s, Miroslav Hadzhiev
Puppet in k8s, Miroslav HadzhievPuppet in k8s, Miroslav Hadzhiev
Puppet in k8s, Miroslav Hadzhiev
 
Bolt on Windows - James Pogran
Bolt on Windows - James PogranBolt on Windows - James Pogran
Bolt on Windows - James Pogran
 
The Business Value of Modernizing your Windows Infrastructure and Bringing Li...
The Business Value of Modernizing your Windows Infrastructure and Bringing Li...The Business Value of Modernizing your Windows Infrastructure and Bringing Li...
The Business Value of Modernizing your Windows Infrastructure and Bringing Li...
 
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
 
Navigating the new normal with self healing infrastructure automation
Navigating the new normal with self healing infrastructure automationNavigating the new normal with self healing infrastructure automation
Navigating the new normal with self healing infrastructure automation
 
Take control of your DevOps Dumping Ground; Melissa Sussmann
Take control of your DevOps Dumping Ground; Melissa SussmannTake control of your DevOps Dumping Ground; Melissa Sussmann
Take control of your DevOps Dumping Ground; Melissa Sussmann
 

Kürzlich hochgeladen

Amil baba, Black magic expert in Sialkot and Kala ilam expert in Faisalabad a...
Amil baba, Black magic expert in Sialkot and Kala ilam expert in Faisalabad a...Amil baba, Black magic expert in Sialkot and Kala ilam expert in Faisalabad a...
Amil baba, Black magic expert in Sialkot and Kala ilam expert in Faisalabad a...
baharayali
 
Real Kala Jadu, Black magic specialist in Lahore and Kala ilam expert in kara...
Real Kala Jadu, Black magic specialist in Lahore and Kala ilam expert in kara...Real Kala Jadu, Black magic specialist in Lahore and Kala ilam expert in kara...
Real Kala Jadu, Black magic specialist in Lahore and Kala ilam expert in kara...
baharayali
 
Authentic Black magic, Kala ilam expert in UAE and Kala ilam specialist in S...
Authentic Black magic, Kala ilam expert in UAE  and Kala ilam specialist in S...Authentic Black magic, Kala ilam expert in UAE  and Kala ilam specialist in S...
Authentic Black magic, Kala ilam expert in UAE and Kala ilam specialist in S...
baharayali
 
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
baharayali
 
Top Kala Jadu, Bangali Amil baba in Lahore and Kala jadu specialist in Lahore...
Top Kala Jadu, Bangali Amil baba in Lahore and Kala jadu specialist in Lahore...Top Kala Jadu, Bangali Amil baba in Lahore and Kala jadu specialist in Lahore...
Top Kala Jadu, Bangali Amil baba in Lahore and Kala jadu specialist in Lahore...
baharayali
 

Kürzlich hochgeladen (20)

No 1 Amil baba in Karachi Amil baba in Pakistan Asli Amil baba in Hyderabad
No 1 Amil baba in Karachi Amil baba in Pakistan Asli Amil baba in HyderabadNo 1 Amil baba in Karachi Amil baba in Pakistan Asli Amil baba in Hyderabad
No 1 Amil baba in Karachi Amil baba in Pakistan Asli Amil baba in Hyderabad
 
Amil baba, Black magic expert in Sialkot and Kala ilam expert in Faisalabad a...
Amil baba, Black magic expert in Sialkot and Kala ilam expert in Faisalabad a...Amil baba, Black magic expert in Sialkot and Kala ilam expert in Faisalabad a...
Amil baba, Black magic expert in Sialkot and Kala ilam expert in Faisalabad a...
 
NoHo First Good News online newsletter May 2024
NoHo First Good News online newsletter May 2024NoHo First Good News online newsletter May 2024
NoHo First Good News online newsletter May 2024
 
Real Kala Jadu, Black magic specialist in Lahore and Kala ilam expert in kara...
Real Kala Jadu, Black magic specialist in Lahore and Kala ilam expert in kara...Real Kala Jadu, Black magic specialist in Lahore and Kala ilam expert in kara...
Real Kala Jadu, Black magic specialist in Lahore and Kala ilam expert in kara...
 
Jude: The Acts of the Apostates (Jude vv.1-4).pptx
Jude: The Acts of the Apostates (Jude vv.1-4).pptxJude: The Acts of the Apostates (Jude vv.1-4).pptx
Jude: The Acts of the Apostates (Jude vv.1-4).pptx
 
Authentic Black magic, Kala ilam expert in UAE and Kala ilam specialist in S...
Authentic Black magic, Kala ilam expert in UAE  and Kala ilam specialist in S...Authentic Black magic, Kala ilam expert in UAE  and Kala ilam specialist in S...
Authentic Black magic, Kala ilam expert in UAE and Kala ilam specialist in S...
 
St. Louise de Marillac and Galley Prisoners
St. Louise de Marillac and Galley PrisonersSt. Louise de Marillac and Galley Prisoners
St. Louise de Marillac and Galley Prisoners
 
Vashikaran Specialist in London Black Magic Removal No 1 Astrologer in UK
Vashikaran Specialist in London Black Magic Removal No 1 Astrologer in UKVashikaran Specialist in London Black Magic Removal No 1 Astrologer in UK
Vashikaran Specialist in London Black Magic Removal No 1 Astrologer in UK
 
"The Magnificent Surah Rahman: PDF Version"
"The Magnificent Surah Rahman: PDF Version""The Magnificent Surah Rahman: PDF Version"
"The Magnificent Surah Rahman: PDF Version"
 
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
 
The Revelation Chapter 4 Working Copy.docx
The Revelation Chapter 4 Working Copy.docxThe Revelation Chapter 4 Working Copy.docx
The Revelation Chapter 4 Working Copy.docx
 
Hire Best Next Js Developer For Your Project
Hire Best Next Js Developer For Your ProjectHire Best Next Js Developer For Your Project
Hire Best Next Js Developer For Your Project
 
A Spiritual Guide To Truth v10.pdf xxxxxxx
A Spiritual Guide To Truth v10.pdf xxxxxxxA Spiritual Guide To Truth v10.pdf xxxxxxx
A Spiritual Guide To Truth v10.pdf xxxxxxx
 
Genesis 1:7 || Meditate the Scripture daily verse by verse
Genesis 1:7  ||  Meditate the Scripture daily verse by verseGenesis 1:7  ||  Meditate the Scripture daily verse by verse
Genesis 1:7 || Meditate the Scripture daily verse by verse
 
Study of the Psalms Chapter 1 verse 3 - wanderean
Study of the Psalms Chapter 1 verse 3 - wandereanStudy of the Psalms Chapter 1 verse 3 - wanderean
Study of the Psalms Chapter 1 verse 3 - wanderean
 
St. Louise de Marillac and Poor Children
St. Louise de Marillac and Poor ChildrenSt. Louise de Marillac and Poor Children
St. Louise de Marillac and Poor Children
 
Deerfoot Church of Christ Bulletin 4 28 24
Deerfoot Church of Christ Bulletin 4 28 24Deerfoot Church of Christ Bulletin 4 28 24
Deerfoot Church of Christ Bulletin 4 28 24
 
Elite Class ➥8448380779▻ Call Girls In Mehrauli Gurgaon Road Delhi NCR
Elite Class ➥8448380779▻ Call Girls In Mehrauli Gurgaon Road Delhi NCRElite Class ➥8448380779▻ Call Girls In Mehrauli Gurgaon Road Delhi NCR
Elite Class ➥8448380779▻ Call Girls In Mehrauli Gurgaon Road Delhi NCR
 
Top Kala Jadu, Bangali Amil baba in Lahore and Kala jadu specialist in Lahore...
Top Kala Jadu, Bangali Amil baba in Lahore and Kala jadu specialist in Lahore...Top Kala Jadu, Bangali Amil baba in Lahore and Kala jadu specialist in Lahore...
Top Kala Jadu, Bangali Amil baba in Lahore and Kala jadu specialist in Lahore...
 
Genesis 1:8 || Meditate the Scripture daily verse by verse
Genesis 1:8  ||  Meditate the Scripture daily verse by verseGenesis 1:8  ||  Meditate the Scripture daily verse by verse
Genesis 1:8 || Meditate the Scripture daily verse by verse
 

Puppet and AWS: Getting the Best of Both Worlds