RAPID DEV
ENVIRONMENTS
Przemek Hejman - Marcin Brański
MACHINE IMAGE
PACKER.IO
{
"builders": [
{
"type": "amazon-ebs",
"access_key": "
"secret_key": "
"region": "ap-northeast-1",
"source_ami": "ami-bfdaa2be",
"instance_type": "t1.micro",
"ssh_username": "ubuntu",
"ami_name": "packer-quick-start {{timestamp}}"
}
],
"provisioners": [
{
"type": "puppet-masterless",
"manifest_file": "site.pp",
"module_paths": [ "./modules" ]
}
]
}
node default {
class { '::ntp':
servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ],
}
cron { 'taki_sobie_maintenance':
command => "/usr/bin/skrypt_robiacy_porzadek.sh",
user => root,
hour => 5,
minute => 0,
}
$str = "Jestem DNSem google"
if $::ipaddress_eth0 == "8.8.8.8" {
file { '/root/pliczQ':
ensure => present,
content => "$str",
owner => root,
group => root,
mode => '644',
}
}
}
packer build
Vagrant
Vagrantfile
vagrant up
vagrant-aws
vagrant-azure
vagrant-brightbox
vagrant-cloudstack
vagrant-digitalocean
vagrant-ganeti
vagrant-hp
vagrant-joyent
vagrant-kvm
vagrant-libvirt
vagrant-lxc
vagrant-managed-servers
vagrant-openstack
vagrant-openvz
vagrant-parallels
vagrant-proxmox
vagrant-rackspace
vagrant-softlayer
vagrant-vcloud
vagrant-vsphere
vagrant-windows-hyperv
● Infrastructure as Code;
● Deklaratywny język, czytelna
konfiguracja;
● Proste zarządzanie,
wprowadzanie zmian;
● Dokumentacja infrastruktury;
Provisioning
# yum install nrpe
# aptitude install nagios-nrpe-server
Ze względu na koszty i bycie trendy, przenosimy
wszystko w chmurę!!!
Zmienimy serwery HTTP
na NGINX, dodajcie klucz
ssh użytkownika janusz,
zróbmy upgrade tomcata, niech
logowanie będzie po certyfikacie,
olejmy rsysloga,
może podepniemy też nagiosa…
PUPPET VS. CHEF VS. ANSIBLE VS.
SALT VS. FABRIC ??
PUPPET
CHEF
ANSIBLE
SALT
nginx:
pkg:
- installed
service:
- running
- require:
- pkg: nginx
/var/www/index.html:
file:
- managed
- source: salt://webserver/index.html
- require:
- pkg: nginx
PUPPET VS. CHEF VS. ANSIBLE VS.
SALT VS. FABRIC ??
YES.
READY-TO-GO
Bare Metal
Hardware Assisted
Dockerfile
FROM e1337h4xx/saltwheezy
MAINTAINER 3h4x
RUN apt-get -qq update
RUN apt-get install -y wget
RUN echo "deb http://pkg.jenkins-ci.org/debian binary/" >>
/etc/apt/sources.list
RUN wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key |
apt-key add -
RUN apt-get -qq update
RUN apt-get upgrade -y
RUN apt-get install -y jenkins
EXPOSE 8080
CMD (/etc/init.d/jenkins start && sleep 5 && tailf
/var/log/jenkins/jenkins.log)
VOLUME ["/var/lib/jenkins", "/var/log/jenkins"]
docker run
What docker can do for you
fig up
Time comparison
docker <1s vagrant up > 30s
Vagrant and Docker
NEXT? ● Jenkins CI
● Continuous Deployment
● Automated Testing
● Demo
● Microservices
Thanks!

Rapid dev env DevOps Warsaw July 2014