Skip to content

Latest commit

 

History

History
250 lines (202 loc) · 4.41 KB

presentation.md

File metadata and controls

250 lines (202 loc) · 4.41 KB

class: center, middle

background-image: url(images/crowd.jpg)

Ents24 Logo

Vagrant & Puppet

Tips & Tricks


class: table-list, center

--

  • --

  • --

  • --

  • --

  • --

  • --

  • --

  • --

--

#Why we use Vagrant & Puppet


class: center #Overview .left[

  • Vagrant - CLI for virtual machines
  • Puppet - Configuration & software management ] .left[
  • Vagrantfile
  • Manifests & Modules
  • Version control your development environment ]

class: center, middle background-image: url(images/puphpet.png)

Getting Started

Using PuPHPet


class: center, middle #Customising

Let's install selenium RC in our VM


Puppetfile :

mod 'jhoblitt/selenium'
	mod 'rodjek/logrotate' #Dependency for selenium

default.pp:

class { 'selenium::server':
  display      => ':99',
}
C:\Users\Doug\Code\vagrant>vagrant provision

class: center, middle #YAML 1 minute SSL VHost


apache:
    vhosts:
        "%{::vm_hostname}": &ents24
            servername: "%{::vm_hostname}"
            serveraliases:
                - "%{::host_hostname}.local.ents24.com"
            docroot: /var/www/
            port: '80'
            directories:
                - path: /var/www/
                  allow_override: all
                - path: /var/www/ents24/Web/
                  fallbackresource: /ents24/Web/index.php
            request_headers:
                - set Served-As "HTTP"

--

        #This SSL vhost is a reference to the one above,
		#and overrides some settings
        "%{::vm_hostname}-ssl":
            <<: *ents24
            ssl: true
            port: 443
            ssl_cert: '/etc/ssl/ents24/ents24-dev.crt'
            ssl_key: '/etc/ssl/ents24/ents24-dev.key'
            request_headers:
                - set Served-As "HTTPS"

apache:
    vhosts:
*        "%{::vm_hostname}": &ents24
            servername: "%{::vm_hostname}"
            serveraliases:
                - "%{::host_hostname}.local.ents24.com"
            docroot: /var/www/
            port: '80'
            directories:
                - path: /var/www/
                  allow_override: all
                - path: /var/www/ents24/Web/
                  fallbackresource: /ents24/Web/index.php
            request_headers:
                - set Served-As "HTTP"
        #This SSL vhost is a reference to the one above,
		#and overrides some settings
        "%{::vm_hostname}-ssl":
*            <<: *ents24
            ssl: true
            port: 443
            ssl_cert: '/etc/ssl/ents24/ents24-dev.crt'
            ssl_key: '/etc/ssl/ents24/ents24-dev.key'
            request_headers:
                - set Served-As "HTTPS"

#Shared Folder Speed

  • NFS (root)
  • Samba (root)
  • VMWare (money)

class: center, middle #Port Forwarding


#Windows

  host_port     = Vagrant::Util::Platform.windows? ? 80  : 8080
  host_port_ssl = Vagrant::Util::Platform.windows? ? 443 : 8443

  config.vm.network "forwarded_port", guest: 80,  host: host_port
  config.vm.network "forwarded_port", guest: 443, host: host_port_ssl

.center[ ]


#Linux (rinetd)

sudo apt-get install rinetd

/etc/rinetd.conf:

# bindadress bindport connectaddress connectport
192.168.2.1 80 192.168.2.3 80
192.168.2.1 443 192.168.2.3 443

#OSX (pf)

Anchor File:

rdr pass on lo0 inet proto tcp 
	from any to 127.0.0.2 port 80 -> 127.0.0.1 port 8080

PF Config:

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/<anchor file>"

Sysctl :

net.inet.ip.forwarding=1
net.inet6.ip6.forwarding=1

Launch list :

<key>ProgramArguments</key>
<array>
	<string>pfctl -e -f /etc/pf.conf</string>
</array>

class: center, middle #Golden Master


class: center #Puppet is Idempotent

p = Puppet Manifest

x = System State