SlideShare a Scribd company logo
Packer openstack
Jan Collijs
@visibilityspots
Jan CollijsJan Collijs
● Linux & Open-Source enthousiastLinux & Open-Source enthousiast
● Made my hobby my profession 5 years agoMade my hobby my profession 5 years ago
@inuits@inuits
● Want to drink cocktails at the beach whileWant to drink cocktails at the beach while
everything is automatedeverything is automated
Use caseUse case
● Automated test suite using some CPE/CSAutomated test suite using some CPE/CS
(centos) devices(centos) devices
● Used to be a serverpark maintained by puppetUsed to be a serverpark maintained by puppet
● Want a more flexible way of using resourcesWant a more flexible way of using resources
● ReproducibleReproducible
● FastFast
Private cloud solutionPrivate cloud solution
● RDORDO
● https://www.rdoproject.orghttps://www.rdoproject.org
● packstackpackstack
VagrantVagrant
● Development Environments Made EasyDevelopment Environments Made Easy
● Local environment based on puppetLocal environment based on puppet
● Using vagrant-lxc containers or virtualboxUsing vagrant-lxc containers or virtualbox
– https://github.com/visibilityspots/vagrant-puppethttps://github.com/visibilityspots/vagrant-puppet
● ServerspecServerspec
– http://serverspec.orghttp://serverspec.org
– With Serverspec, you can write RSpec testsWith Serverspec, you can write RSpec tests
for checking your servers are configuredfor checking your servers are configured
correctly.correctly.
VagrantfileVagrantfileVAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "shell", inline: "true"
config.vm.provider :virtualbox do |virtualbox, override|
override.vm.box = "vStone/centos-6.x-puppet.3.x"
end
config.vm.provider :lxc do |lxc, override|
override.vm.box = "visibilityspots/centos-6.x-puppet-3.x"
end
config.vm.define :cpe do |cpe|
cpe.vm.host_name = "cpe"
cpe.vm.synced_folder "hieradata", "/etc/hiera"
ext_env = ENV['VAGRANT_PUPPET_ENV']
ext_env = 'development'
env = ext_env ? ext_env : config_env
cpe.vm.synced_folder "puppet/environments/#{env}/modules", "/etc/puppet/environments/#{env}/modules"
cpe.vm.synced_folder "spec/", "/tmp/tests"
cpe.vm.provision :puppet do |puppet|
puppet.options = "--environment #{env}"
puppet.hiera_config_path = "hieradata/hiera.yaml"
puppet.manifests_path = "puppet/environments/#{env}/manifests"
puppet.manifest_file = ""
puppet.module_path = "puppet/environments/#{env}/modules"
end
end
end
require 'vagrant-openstack-provider'
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "shell", inline: "true"
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
config.vm.provider :virtualbox do |virtualbox, override|
override.vm.box = "vStone/centos-6.x-puppet.3.x"
end
config.vm.provider :lxc do |lxc, override|
override.vm.box = "visibilityspots/centos-6.x-puppet-3.x"
end
config.vm.provider :openstack do|os, override|
override.nfs.functional = false
override.ssh.pty = true
override.ssh.username = "root"
os.flavor = "m1.small"
os.image = "centos-base-image"
os.availability_zone = "default"
os.security_groups = ['default']
os.openstack_auth_url = "http://#.#.#.#/v2.0/tokens"
os.tenant_name = "tenant"
os.keypair_name = "tenant"
os.username = "centos"
os.password = "password"
override.ssh.private_key_path = "/path/to/ssh/key"
os.networks = [
'net-tenant',
]
end
config.vm.define :cpe do |cpe|
cpe.vm.host_name = "cpe"
cpe.vm.synced_folder "hieradata", "/etc/hiera"
ext_env = ENV['VAGRANT_PUPPET_ENV']
ext_env = 'development'
env = ext_env ? ext_env : config_env
cpe.vm.synced_folder "puppet/environments/#{env}/modules", "/etc/puppet/environments/#{env}/modules"
cpe.vm.synced_folder "spec/", "/tmp/tests"
cpe.vm.provision :puppet do |puppet|
puppet.options = "--environment #{env}"
puppet.hiera_config_path = "hieradata/hiera.yaml"
puppet.manifests_path = "puppet/environments/#{env}/manifests"
puppet.manifest_file = ""
puppet.module_path = "puppet/environments/#{env}/modules"
end
end
end
Packer.ioPacker.io
● Build Automated Machine ImagesBuild Automated Machine Images
● Using puppetUsing puppet
● Based on a centos minimal with kickstart in initialBased on a centos minimal with kickstart in initial
phasephase
● ServerspecServerspec
– With Serverspec, you can write RSpec testsWith Serverspec, you can write RSpec tests
for checking your servers are configuredfor checking your servers are configured
correctly.correctly.
● Based on a centos cloud based imageBased on a centos cloud based image
– https://wiki.centos.org/Cloudhttps://wiki.centos.org/Cloud
PackerfilePackerfile
{
"provisioners": [
{
"type": "file",
"source": "hieradata",
"destination": "/tmp"
},
{
"type": "file",
"source": "tests",
"destination": "/tmp"
},
{
"type": "shell",
"execute_command": "echo 'packer' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"scripts": [
"scripts/installrepos.sh",
"scripts/initialize.sh",
"scripts/installrvm.sh",
"scripts/installserverspec.sh"
]
},
{
"type": "puppet-masterless",
"manifest_file": "puppet/environments/production/manifests/",
"hiera_config_path": "hieradata/hiera.yaml",
"module_paths": "puppet/environments/production/modules/"
},
{
"type": "shell",
"execute_command": "echo 'packer' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"scripts": [
"scripts/serverspec.sh",
"scripts/cleanup.sh",
"scripts/zerodisk.sh"
]
}
],
"builders": [
{
"availability_zone": "nova",
"type": "openstack",
"ssh_username": "username",
"tenant_name": "tenant",
"region": "RegionOne",
"image_name": "cpe",
"source_image": "####",
"flavor": "cpe.tiny",
"networks": ["####"],
"ssh_pty" : true
}
]
}
JenkinsJenkins
● The leading open source automation server,The leading open source automation server,
Jenkins provides hundreds of plugins to supportJenkins provides hundreds of plugins to support
building, deploying and automating any project.building, deploying and automating any project.
● https://jenkins.iohttps://jenkins.io
Jenkins jobJenkins job
● One repository containing the vagrantfile andOne repository containing the vagrantfile and
packer filepacker file
● Git/SVN commit hookGit/SVN commit hook
● Checkout by jenkinsCheckout by jenkins
● Shell script to execute packer provisioned onShell script to execute packer provisioned on
openstackopenstack
● Openstack image will be pushed to the cloud byOpenstack image will be pushed to the cloud by
packer automaticallypacker automatically
ContactContact
Jan Collijs jan.collijs@inuits.euJan Collijs jan.collijs@inuits.eu
Further ReadingFurther Reading
@visibilityspots@visibilityspots
https://visibilityspots.orghttps://visibilityspots.org
https://inuits.euhttps://inuits.eu
InuitsInuits
Essensteenweg 31Essensteenweg 31
BrasschaatBrasschaat
BelgiumBelgium
891.514.231891.514.231
+32 479 586488+32 479 586488

More Related Content

What's hot

Automation and Ansible
Automation and AnsibleAutomation and Ansible
Automation and Ansible
jtyr
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
Soshi Nemoto
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
Soshi Nemoto
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
bcoca
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
Murali Boyapati
 
DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)
Soshi Nemoto
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點
William Yeh
 
Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)
Chu-Siang Lai
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
Soshi Nemoto
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
Walter Heck
 
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PuppetCamp SEA 1 - Puppet Deployment  at OnAppPuppetCamp SEA 1 - Puppet Deployment  at OnApp
PuppetCamp SEA 1 - Puppet Deployment at OnApp
Walter Heck
 
Start using vagrant now!
Start using vagrant now!Start using vagrant now!
Start using vagrant now!
Andrii Podanenko
 
Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.
Workhorse Computing
 
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Puppet
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricks
bcoca
 
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101
jelrikvh
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Cosimo Streppone
 

What's hot (18)

Automation and Ansible
Automation and AnsibleAutomation and Ansible
Automation and Ansible
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
 
DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點
 
Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PuppetCamp SEA 1 - Puppet Deployment  at OnAppPuppetCamp SEA 1 - Puppet Deployment  at OnApp
PuppetCamp SEA 1 - Puppet Deployment at OnApp
 
Start using vagrant now!
Start using vagrant now!Start using vagrant now!
Start using vagrant now!
 
Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.
 
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricks
 
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 

Similar to Automated reproducible images on openstack using vagrant and packer

How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
Kris Buytaert
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
Carlos Sanchez
 
Provisioning with Puppet
Provisioning with PuppetProvisioning with Puppet
Provisioning with Puppet
Joe Ray
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011
Carlos Sanchez
 
From Dev to DevOps
From Dev to DevOpsFrom Dev to DevOps
From Dev to DevOps
Agile Spain
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
Omar Reygaert
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk Götz
NETWAYS
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
grim_radical
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012
Carlos Sanchez
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
frastel
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Puppet
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
OlinData
 
Using Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & HadoopUsing Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & Hadoop
Puppet
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
Walter Heck
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with Puppet
OlinData
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012
Walter Heck
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012
OlinData
 
Puppet and the HashiCorp Suite
Puppet and the HashiCorp SuitePuppet and the HashiCorp Suite
Puppet and the HashiCorp Suite
Bram Vogelaar
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
Carlos Sanchez
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Carlos Sanchez
 

Similar to Automated reproducible images on openstack using vagrant and packer (20)

How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
Provisioning with Puppet
Provisioning with PuppetProvisioning with Puppet
Provisioning with Puppet
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011
 
From Dev to DevOps
From Dev to DevOpsFrom Dev to DevOps
From Dev to DevOps
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk Götz
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
 
Using Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & HadoopUsing Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & Hadoop
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with Puppet
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012
 
Puppet and the HashiCorp Suite
Puppet and the HashiCorp SuitePuppet and the HashiCorp Suite
Puppet and the HashiCorp Suite
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 

Recently uploaded

zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
christinelarrosa
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 

Recently uploaded (20)

zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 

Automated reproducible images on openstack using vagrant and packer

  • 2. Jan CollijsJan Collijs ● Linux & Open-Source enthousiastLinux & Open-Source enthousiast ● Made my hobby my profession 5 years agoMade my hobby my profession 5 years ago @inuits@inuits ● Want to drink cocktails at the beach whileWant to drink cocktails at the beach while everything is automatedeverything is automated
  • 3. Use caseUse case ● Automated test suite using some CPE/CSAutomated test suite using some CPE/CS (centos) devices(centos) devices ● Used to be a serverpark maintained by puppetUsed to be a serverpark maintained by puppet ● Want a more flexible way of using resourcesWant a more flexible way of using resources ● ReproducibleReproducible ● FastFast
  • 6. VagrantVagrant ● Development Environments Made EasyDevelopment Environments Made Easy ● Local environment based on puppetLocal environment based on puppet ● Using vagrant-lxc containers or virtualboxUsing vagrant-lxc containers or virtualbox – https://github.com/visibilityspots/vagrant-puppethttps://github.com/visibilityspots/vagrant-puppet ● ServerspecServerspec – http://serverspec.orghttp://serverspec.org – With Serverspec, you can write RSpec testsWith Serverspec, you can write RSpec tests for checking your servers are configuredfor checking your servers are configured correctly.correctly.
  • 7. VagrantfileVagrantfileVAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision "shell", inline: "true" config.vm.provider :virtualbox do |virtualbox, override| override.vm.box = "vStone/centos-6.x-puppet.3.x" end config.vm.provider :lxc do |lxc, override| override.vm.box = "visibilityspots/centos-6.x-puppet-3.x" end config.vm.define :cpe do |cpe| cpe.vm.host_name = "cpe" cpe.vm.synced_folder "hieradata", "/etc/hiera" ext_env = ENV['VAGRANT_PUPPET_ENV'] ext_env = 'development' env = ext_env ? ext_env : config_env cpe.vm.synced_folder "puppet/environments/#{env}/modules", "/etc/puppet/environments/#{env}/modules" cpe.vm.synced_folder "spec/", "/tmp/tests" cpe.vm.provision :puppet do |puppet| puppet.options = "--environment #{env}" puppet.hiera_config_path = "hieradata/hiera.yaml" puppet.manifests_path = "puppet/environments/#{env}/manifests" puppet.manifest_file = "" puppet.module_path = "puppet/environments/#{env}/modules" end end end
  • 8. require 'vagrant-openstack-provider' VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision "shell", inline: "true" if Vagrant.has_plugin?("vagrant-cachier") config.cache.scope = :box end config.vm.provider :virtualbox do |virtualbox, override| override.vm.box = "vStone/centos-6.x-puppet.3.x" end config.vm.provider :lxc do |lxc, override| override.vm.box = "visibilityspots/centos-6.x-puppet-3.x" end config.vm.provider :openstack do|os, override| override.nfs.functional = false override.ssh.pty = true override.ssh.username = "root" os.flavor = "m1.small" os.image = "centos-base-image" os.availability_zone = "default" os.security_groups = ['default'] os.openstack_auth_url = "http://#.#.#.#/v2.0/tokens" os.tenant_name = "tenant" os.keypair_name = "tenant" os.username = "centos" os.password = "password" override.ssh.private_key_path = "/path/to/ssh/key" os.networks = [ 'net-tenant', ] end config.vm.define :cpe do |cpe| cpe.vm.host_name = "cpe" cpe.vm.synced_folder "hieradata", "/etc/hiera" ext_env = ENV['VAGRANT_PUPPET_ENV'] ext_env = 'development' env = ext_env ? ext_env : config_env cpe.vm.synced_folder "puppet/environments/#{env}/modules", "/etc/puppet/environments/#{env}/modules" cpe.vm.synced_folder "spec/", "/tmp/tests" cpe.vm.provision :puppet do |puppet| puppet.options = "--environment #{env}" puppet.hiera_config_path = "hieradata/hiera.yaml" puppet.manifests_path = "puppet/environments/#{env}/manifests" puppet.manifest_file = "" puppet.module_path = "puppet/environments/#{env}/modules" end end end
  • 9. Packer.ioPacker.io ● Build Automated Machine ImagesBuild Automated Machine Images ● Using puppetUsing puppet ● Based on a centos minimal with kickstart in initialBased on a centos minimal with kickstart in initial phasephase ● ServerspecServerspec – With Serverspec, you can write RSpec testsWith Serverspec, you can write RSpec tests for checking your servers are configuredfor checking your servers are configured correctly.correctly. ● Based on a centos cloud based imageBased on a centos cloud based image – https://wiki.centos.org/Cloudhttps://wiki.centos.org/Cloud
  • 10. PackerfilePackerfile { "provisioners": [ { "type": "file", "source": "hieradata", "destination": "/tmp" }, { "type": "file", "source": "tests", "destination": "/tmp" }, { "type": "shell", "execute_command": "echo 'packer' | {{.Vars}} sudo -S -E bash '{{.Path}}'", "scripts": [ "scripts/installrepos.sh", "scripts/initialize.sh", "scripts/installrvm.sh", "scripts/installserverspec.sh" ] }, { "type": "puppet-masterless", "manifest_file": "puppet/environments/production/manifests/", "hiera_config_path": "hieradata/hiera.yaml", "module_paths": "puppet/environments/production/modules/" }, { "type": "shell", "execute_command": "echo 'packer' | {{.Vars}} sudo -S -E bash '{{.Path}}'", "scripts": [ "scripts/serverspec.sh", "scripts/cleanup.sh", "scripts/zerodisk.sh" ] } ], "builders": [ { "availability_zone": "nova", "type": "openstack", "ssh_username": "username", "tenant_name": "tenant", "region": "RegionOne", "image_name": "cpe", "source_image": "####", "flavor": "cpe.tiny", "networks": ["####"], "ssh_pty" : true } ] }
  • 11. JenkinsJenkins ● The leading open source automation server,The leading open source automation server, Jenkins provides hundreds of plugins to supportJenkins provides hundreds of plugins to support building, deploying and automating any project.building, deploying and automating any project. ● https://jenkins.iohttps://jenkins.io
  • 12. Jenkins jobJenkins job ● One repository containing the vagrantfile andOne repository containing the vagrantfile and packer filepacker file ● Git/SVN commit hookGit/SVN commit hook ● Checkout by jenkinsCheckout by jenkins ● Shell script to execute packer provisioned onShell script to execute packer provisioned on openstackopenstack ● Openstack image will be pushed to the cloud byOpenstack image will be pushed to the cloud by packer automaticallypacker automatically
  • 13. ContactContact Jan Collijs jan.collijs@inuits.euJan Collijs jan.collijs@inuits.eu Further ReadingFurther Reading @visibilityspots@visibilityspots https://visibilityspots.orghttps://visibilityspots.org https://inuits.euhttps://inuits.eu InuitsInuits Essensteenweg 31Essensteenweg 31 BrasschaatBrasschaat BelgiumBelgium 891.514.231891.514.231 +32 479 586488+32 479 586488