SlideShare una empresa de Scribd logo
1 de 38
Introduction          2




• Virtualization
  – What is it?
  – Hands-on lab
• Automation
  – How do you mean?
  – Hands-on lab
• Puppet
  – Manipulating
  – Hands-on lab
• Questions?
Virtualization: What is it?   3




• Stand alone server
  – Host & Guest


• Dedicated Server
  – Guest => Virtual Machine
  – Host => Actual machine


• Benefits
  – Less physical machines
  – Easy to move
Virtualization: What is it?                                                                4




• Virtualization today:
  – VMware         -> vsphere
  – Microsoft      -> Hyper-V
  – Redhat         -> RHEV



  – VMware player         http://www.vmware.com/products/player/


  – VMware esxi           http://www.vmware.com/products/vsphere-hypervisor/overview.html


  – VirtualBox            http://www.virtualbox.org/


  – KVM                   http://www.linux-kvm.org/page/Main_Page


  – Xen                   http://www.xen.org/
Virtualization: Hands-on lab   5
Virtualization: Hands-on lab   6
Virtualization: Hands-on lab   7
Virtualization: Hands-on lab   8
Virtualization: Hands-on lab   9
Virtualization: Hands-on lab   10
Virtualization: Hands-on lab   11
Automation: How do you mean?                             12




• Installing OS
  – > insert disc, choose options, configure root, etc…
  – > Login, create users, configure server
  –>…


• Automation = install steps written in file
  – Kickstart
  – Preseed
Automation: How do you mean?                                               13




• Creating kickstart file
   – Set language, keyboard, timezone, root password, network, …
 lang en_US
 langsupport en_US.UTF-8
 keyboard us
 timezone --utc Europe/Brussels
 rootpw ***
 text
 skipx
 install
 cdrom
 zerombr
 bootloader --location=mbr
 network --bootproto=dhcp
 key XXXXXXXXXXXXXXXX


• Hard disc formating
 clearpart --all --initlabel
 part /boot --fstype ext3 --size=150 --ondisk=sda
 part / --fstype=ext3 --size=1024 --ondisk=sda
 part swap --size=7644 --ondisk=sda
 part pv.6 --size=0 --grow --ondisk=sda
 volgroup vg00 --pesize=32768 pv.6
 logvol /var/log --fstype ext3 --name=varlog    --vgname=vg00 --size=2048
Automation: How do you mean?                                                  14




• Hard disc
  – Additional partition exlibris (35GB)
 clearpart --all --initlabel
 part /boot --fstype ext3 --size=150 --ondisk=sda
 part / --fstype=ext3 --size=1024 --ondisk=sda
 part swap --size=4096 --ondisk=sda
 part pv.6 --size=0 --grow --ondisk=sda
 volgroup vg00 --pesize=32768 pv.6
 logvol /var/log --fstype ext3 --name=varlog    --vgname=vg00   --size=2048
 logvol /var      --fstype ext3 --name=var      --vgname=vg00   --size=1536
 logvol /tmp      --fstype ext3 --name=tmp      --vgname=vg00   --size=5120
 logvol /opt      --fstype ext3 --name=opt      --vgname=vg00   --size=1024
 logvol /usr      --fstype ext3 --name=usr      --vgname=vg00   --size=4096
 logvol /home     --fstype ext3 --name=home     --vgname=vg00   --size=512
 logvol /exlibris --fstype ext3 --name=exlibris --vgname=vg00   --size=35840


• End script
 auth --useshadow --enablemd5
 selinux --disabled
 firewall --enabled --ssh
 firstboot --disabled
 reboot --eject
Automation: How do you mean?                                                15




• Add packages
 repo --name=epel --baseurl=http://dl.fedoraproject.org/pub/epel/5/x86_64/
 %packages
 @core
 epel-release-5-4
 screen
 ruby
 puppet

• Post
  – Define hostname, register with RedHat, set puppetmaster
 %post --log=/root/postinstall.log
 # set hostname to the dns one
 IP=`ifconfig eth0 | grep "addr:" | cut -d':' -f2 | cut -d' ' -f1`
 HOSTNAME=`nslookup $IP | grep "name =" | cut -d'=' -f2 | sed
 's/.(.*)./1/'`
 SHORTHOSTNAME=`nslookup $IP | grep "name =" | cut -d'=' -f2 | sed
 's/.(.*)./1/' | cut -d'.' -f1`
 # replace the hostname in the network configuration
 grep -v "HOSTNAME" /etc/sysconfig/network > /tmp/network
 echo "HOSTNAME=${HOSTNAME}" >> /tmp/network
 cp /tmp/network /etc/sysconfig/network
 echo "${IP}       ${HOSTNAME} ${SHORTHOSTNAME}" >> /etc/hosts
 rhnreg_ks --profilename=${HOSTNAME} --activationkey=XXXXXXXXXXXXX
Automation: How do you mean?                                          16




• Users and SSH
  – Add user, disable root-ssh-login, config port ssh, update system
 # Create user install
 useradd --uid 900 install
 # Set passwd for user install
 echo "***" | passwd --stdin install

 # Disable ssh rootlogin
 sed -e 's/^#PermitRootLoginsyes$/PermitRootLogin no/' <
 /etc/ssh/sshd_config > /tmp/sshd_config
 # Use port 22000 as default
 sed -e 's/^#Ports22$/Port 22000/' < /tmp/sshd_config >
 /tmp/sshd_config2
 mv /tmp/sshd_config2 /etc/ssh/sshd_config
 rm /tmp/sshd_config

 # Open non default port 22000 for ssh
 sed -e 's/--dports22/--dport 22000/' < /etc/sysconfig/iptables >
 /tmp/iptables
 mv /tmp/iptables /etc/sysconfig/iptables

 /usr/bin/yum clean all
 /usr/bin/yum -y update
 /usr/bin/yum clean all
Automation: Hands-on lab                                                    17




• Try to create SFX-installation - Packages
 /usr/bin/yum -y install glibc unixODBC unixODBC-devel e2fsprogs-libs
 expat libxml2 zlib libxslt libgcrypt libgpg-error krb5-libs keyutils-libs
 libselinux libsepol gmp pcre libaio gdbm libstdc++ ncurses bzip2-libs
 /usr/bin/yum clean all

 #Disable selinux
 echo 0 > /selinux/enforce
 #stop iptables
 /etc/init.d/iptables stop
 #disable iptables
 /sbin/chkconfig --level 2345 iptables off



  – Sfx-installer can extract only
      • ./sfx_version_4_linux64_installer.run --confirm

  – Sfx-installer can run without disclaimer
      • ./starter.sh nodisclaimer
Automation: Hands-on lab                    18




• Sfx-installer can extract only

• Sfx-installer can run without disclaimer
Automation: Hands-on lab                      19




• Sfx-installer can use auto answer-file




  – Sfx-installer can extract only
  – Sfx-installer can run without disclaimer
Automation: Hands-on lab                                               20




• How to do this?
 mkdir -m777 /exlibris/ftp_from_exlibris
 cd /exlibris/ftp_from_exlibris
 wget 'http://sartre.ugent.be/bt/sfx_version_4_linux64_installer.run‘
 chmod a+x sfx_version_4_linux64_installer.run
 /bin/echo “LICENSE-SFXGLB41" > license.txt
 /bin/echo “LICENSE-SFXLCL41" >> license.txt
 /bin/echo “LICENSE-SFXTST41" >> license.txt

 # extract sfx_installer
 echo "y" > answer.txt
 echo "n" >> answer.txt
 ./sfx_version_4_linux64_installer.run --confirm < answer.txt

 #start installer
 cd build
 echo "y" > answer.txt
 echo "3410" >> answer.txt
 echo "n" >> answer.txt
 ./starter.sh nodisclaimer < answer.txt

 # Set passwd   for users sfx
 echo "***" |   passwd --stdin sfxglb41
 echo "***" |   passwd --stdin sfxlcl41
 echo "***" |   passwd --stdin sfxtst41
Automation: Hands-on lab                                                    21




• Finishing script
 # Add port 80 for browsing
 sed -e 's/^Listens3410$/Listen 80nListen 3410/' <
 /exlibris/sfx_ver/sfx4_1/proxy/conf/httpd.conf > /tmp/httpproxy.conf
 mv /tmp/httpproxy.conf /exlibris/sfx_ver/sfx4_1/proxy/conf/httpd.conf

 # Open the port in the firewall
 sed '/23000/i-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --
 dport 80 -j ACCEPT' < /etc/sysconfig/iptables > /tmp/iptables
 sed '/23000/i-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --
 dport 3410 -j ACCEPT' < /tmp/iptables > /etc/sysconfig/iptables

 #Enable back iptables
 /sbin/chkconfig --level 2345 iptables on
Automation: Hands-on lab   22
Automation: Hands-on lab   23
Virtualization: Hands-on lab   24
Puppet: Manipulating            25




• Automation software

• DSL Language written in Ruby

• Client / server oriented

• Repeatable processes

• Abstraction layers
Puppet: Manipulating                                        26




• Abstraction layers?
  – Package managers | User management | Services
   Apt, dpkg, yum, rpm, pkg, … | useradd, adduser, dscl, …
Puppet: Manipulating                   27




• Server structure
  ‒ puppet/
     ‒ manifests/
     ‒ environments /
         ‒ production /
             ‒ modules /
                  ‒ [a-z][a-z0-9_]* /
                      ‒ files /
                      ‒ manifests /
                           ‒ init.pp
                      ‒ templates /
                      ‒ tests /
             ‒ manifests /
                  ‒ nodes.pp
         ‒ development /
Puppet: Manipulating                           28




• Nodes.pp
 node HOSTNAME {
     include apache;
     class {
         'ntp':
             enable => false;
     }
     apache::vhost {
         'personal_site':
             port    => 80,
             docroot => '/var/www/personal',
             options => 'Indexes MultiViews‘;
     }
 }



• Module
  – [a-z][a-z0-9_]* (except main, settings)
Puppet: Manipulating                                       29


                                  ‒modules /
• init.pp                            ‒[a-z][a-z0-9_]* /
                                          ‒files /
  – Class-name same as module                   ‒service.conf
                                          ‒manifests /
                                                ‒init.pp
• otherclass.pp                                 ‒otherclass.pp
                                          ‒templates /
  – my_module::otherclass                       ‒template.erb
                                          ‒tests /

• files/service.conf
  – puppet:///modules/my_module/service.conf

• templates/template.erb
  – template('my_module/template.erb')
Puppet: Manipulating                                        30




• Built-in resources:
     – file
     file { ‘/exlibris’:
         ensure => directory,
         mode    => 777,
         group   => exlibris;
     }
     file {‘/exlibris/ftp_from_exlibris/build/answer.txt’:
         ensure => present,
         content => "yn3410nn",
         require => Exec["extract_sfx"];
 }



     file {
       ‘/exlibris’:
         ensure => directory,
         mode    => 777,
         group   => exlibris;
       ‘/exlibris/ftp_from_exlibris/build/answer.txt’:
         ensure => present,
         content => "yn3410nn",
         require => Exec["extract_sfx"];
 }
Puppet: Manipulating                                                             31



    – package
    package {
      ‘glibc’:
        ensure => ‘installed’;
     ‘unixODBC’:
        ensure => ‘installed’;
      ‘unixODBC-devel’
        ensure => ‘latest’;
     ‘gdbm.i686’:
        ensure => ‘2.2.16-6’;
}



Package { ensure => ‘installed’ }
$package2install = [ ‘glibc’, ‘unixODBC’, ‘unixODBC-devel’, ‘gdbm.i686’ ]
package { $package2install: }



    – exec
 exec {
  ‘download_installer’:
    command => ‘./sfx_version_4_linux64_installer.run --confirm < answer.txt’,
    cwd      => ‘/exlibris/ftp_from_exlibris’,
    creates => ‘/exlibris/ftp_from_exlibris/build’,
    require => File[‘/exlibris/ftp_from_exlibris’];
}
Puppet: Manipulating                                             32



 – user & group
user { ‘ca20c800’:
   ensure      => ‘present’,            group { ‘ca20c800’:
   comment     => ‘Comment for user’,     ensure => ‘present’,
   uid         => ‘600’,                  gid    => ‘600’;
   gid         => ‘600’,                }
   membership => minimum,
   shell       => ‘/bin/bash’,
   home        => ‘/home/$title",
   require     => Group[$title],
   password    => ‘***’;
 }



 – ± 40 different resource types
     • cron
     • mount
     • yumrepo
Puppet: Hands-on lab                                                              33




• Sfx & puppet
 class sfx {

   Package { ensure => "installed"}
   $package2install = [ "glibc", "unixODBC-devel", "e2fsprogs-
 libs", "unixODBC", "expat", "libxml2", "zlib", "libxslt", "libgcrypt", "libgpg-
 error", "krb5-libs", "keyutils-
 libs", "libselinux", "libsepol", "gmp", "pcre.i686", "pcre.x86_64", "libaio", "
 gdbm.i686", "gdbm.x86_64", "libstdc++", "ncurses", "bzip2-libs.i686", "bzip2-
 libs.x86_64" ]

  package { $package2install: }


  concat::fragment { "/etc/sysconfig/iptables.sfx.server":
    target => "/etc/sysconfig/iptables",
    source => 'puppet:///modules/sfx/iptables.server',
    order   => 200,
  }
Puppet: Hands-on lab                                  34




• Sfx & puppet
  file {
     ‘/exlibris’:
       ensure => directory,
       group   => exlibris;
     ‘/exlibris/ftp_from_exlibris’:
       ensure   => directory,
       group    => exlibris,
       mode     => 777,
       require => File[‘/exlibris’];
     ‘/exlibris/ftp_from_exlibris/answer.txt’:
       ensure   => present,
       content => ‘ynn’,
     ‘/exlibris/ftp_from_exlibris/build/answer.txt’:
       ensure   => present,
       content => ‘yn3410nn’,
       require => Exec[‘extract_sfx"];
   }
Puppet: Hands-on lab                                                              35




• Sfx & puppet
  exec {
 "download_installer":
   command => "/usr/bin/wget
 http://sartre.ugent.be/bt/sfx_version_4_linux64_installer.run -O
 sfx_version_4_linux64_installer.run;
 /bin/chmod a+x sfx_version_4_linux64_installer.run",
   cwd     => "/exlibris/ftp_from_exlibris",
   creates => "/exlibris/ftp_from_exlibris/sfx_version_4_linux64_installer.run",
   require => File["/exlibris/ftp_from_exlibris"];
 "get_license":
   command => "/usr/bin/wget
 http://lib.ugent.be/files/elag2012/${hostname}.license -O license.txt",
   cwd     => "/exlibris/ftp_from_exlibris",
   creates => "/exlibris/ftp_from_exlibris/license.txt",
   require => File["/exlibris/ftp_from_exlibris"];
 "extract_sfx":
   command => "./sfx_version_4_linux64_installer.run --confirm < answer.txt",
   cwd     => "/exlibris/ftp_from_exlibris",
   creates => "/exlibris/ftp_from_exlibris/build",
   require => File["/exlibris/ftp_from_exlibris/answer.txt"];
 "installing_sfx":
   command => "/etc/init.d/iptables stop; /sbin/chkconfig --level 2345 iptables
 off; ./starter.sh nodisclaimer < answer.txt",
   cwd     => "/exlibris/ftp_from_exlibris/build",
   creates => "/exlibris/sfx_ver",
   timeout => "1800",
   require => File["/exlibris/ftp_from_exlibris/build/answer.txt"]; }
Puppet: Hands-on lab                         36




• Server node
 node 'ca20c802' {
   class {
     'basenode':;
     'vmware::tools':;
     'selinux::disable':;
     'exlibris':;
     'sfx':;

         'icinga':
           nrpe_allowed_hosts => ‘x.x.x.x';
         'icinga::plugins::checksfx':
           perfdata => true;
     }
 }
Puppet: Hands-on lab                                                37




• Sfx-class
 class exlibris {
   realize User_create[exlibris]

  realize   User_create[ca20c801]
  realize   User_create[ca20c802]
  realize   User_create[ca20c803]
  realize   User_create[ca20c804]

     concat::fragment { "/etc/sysconfig/iptables.exlibris.server":
       target => "/etc/sysconfig/iptables",
       source => 'puppet:///modules/exlibris/iptables.server',
       order   => 150,
     }
 }
Questions?                                                 38




                   • Questions?


                    http://www.vmware.com
        http://fedoraproject.org/wiki/Anaconda/Kickstart
                  http://www.puppetlabs.com

                  Omar.Reygaert@UGent.be

Más contenido relacionado

La actualidad más candente

Nginx 0.9.x 安装手册
Nginx 0.9.x 安装手册Nginx 0.9.x 安装手册
Nginx 0.9.x 安装手册Yiwei Ma
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Yiwei Ma
 
An example Hadoop Install
An example Hadoop InstallAn example Hadoop Install
An example Hadoop InstallMike Frampton
 
Single node hadoop cluster installation
Single node hadoop cluster installation Single node hadoop cluster installation
Single node hadoop cluster installation Mahantesh Angadi
 
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu 康志強 大人
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installationAnkit Desai
 
Node.js basics
Node.js basicsNode.js basics
Node.js basicsBen Lin
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaCosimo Streppone
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Alex S
 
OpenStack Swift - MSST 2011 Tutorial Day
OpenStack Swift - MSST 2011 Tutorial DayOpenStack Swift - MSST 2011 Tutorial Day
OpenStack Swift - MSST 2011 Tutorial DayJoshua McKenty
 
WordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry PiWordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry PiYuriko IKEDA
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Soshi Nemoto
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppetlutter
 

La actualidad más candente (20)

Nginx 0.9.x 安装手册
Nginx 0.9.x 安装手册Nginx 0.9.x 安装手册
Nginx 0.9.x 安装手册
 
Hadoop Installation
Hadoop InstallationHadoop Installation
Hadoop Installation
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册
 
Run wordcount job (hadoop)
Run wordcount job (hadoop)Run wordcount job (hadoop)
Run wordcount job (hadoop)
 
An example Hadoop Install
An example Hadoop InstallAn example Hadoop Install
An example Hadoop Install
 
Single node hadoop cluster installation
Single node hadoop cluster installation Single node hadoop cluster installation
Single node hadoop cluster installation
 
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
 
DevOps Braga #6
DevOps Braga #6DevOps Braga #6
DevOps Braga #6
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at Opera
 
Solaris_quickref.pdf
Solaris_quickref.pdfSolaris_quickref.pdf
Solaris_quickref.pdf
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
OpenStack Swift - MSST 2011 Tutorial Day
OpenStack Swift - MSST 2011 Tutorial DayOpenStack Swift - MSST 2011 Tutorial Day
OpenStack Swift - MSST 2011 Tutorial Day
 
Light my-fuse
Light my-fuseLight my-fuse
Light my-fuse
 
Hadoop 3.1.1 single node
Hadoop 3.1.1 single nodeHadoop 3.1.1 single node
Hadoop 3.1.1 single node
 
Composer
ComposerComposer
Composer
 
WordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry PiWordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry Pi
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
 

Destacado

The importance of words
The importance of wordsThe importance of words
The importance of wordsConnectingHR
 
AppCampus Overview 19.9
AppCampus Overview 19.9AppCampus Overview 19.9
AppCampus Overview 19.9Teemu Tapanila
 
Options on export freight hemanshi bharmani
Options on export freight   hemanshi bharmaniOptions on export freight   hemanshi bharmani
Options on export freight hemanshi bharmaniHemanshi Bharmani
 
TechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile servicesTechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile servicesTeemu Tapanila
 
Halon Banking Systems
Halon Banking SystemsHalon Banking Systems
Halon Banking Systemsdenisacojo
 

Destacado (7)

Vitaa
VitaaVitaa
Vitaa
 
AppCampus overview
AppCampus overviewAppCampus overview
AppCampus overview
 
The importance of words
The importance of wordsThe importance of words
The importance of words
 
AppCampus Overview 19.9
AppCampus Overview 19.9AppCampus Overview 19.9
AppCampus Overview 19.9
 
Options on export freight hemanshi bharmani
Options on export freight   hemanshi bharmaniOptions on export freight   hemanshi bharmani
Options on export freight hemanshi bharmani
 
TechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile servicesTechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile services
 
Halon Banking Systems
Halon Banking SystemsHalon Banking Systems
Halon Banking Systems
 

Similar a Virtualization and automation of library software/machines + Puppet

Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 
OpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on TutorialOpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on TutorialOpenNebula Project
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasaggarrett honeycutt
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with AnsibleRayed Alrashed
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from githubAntony Gitomeh
 
(WEB307) Scalable Site Management Using AWS OpsWorks | AWS re:Invent 2014
(WEB307) Scalable Site Management Using AWS OpsWorks | AWS re:Invent 2014(WEB307) Scalable Site Management Using AWS OpsWorks | AWS re:Invent 2014
(WEB307) Scalable Site Management Using AWS OpsWorks | AWS re:Invent 2014Amazon Web Services
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with PuppetKris Buytaert
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESQuick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESJan Kalcic
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013Puppet
 
Deploying Django with Ansible
Deploying Django with AnsibleDeploying Django with Ansible
Deploying Django with Ansibleandrewmirskynet
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modulesKris Buytaert
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawnGábor Nyers
 

Similar a Virtualization and automation of library software/machines + Puppet (20)

Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
OpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on TutorialOpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on Tutorial
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Puppet
PuppetPuppet
Puppet
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from github
 
Dev ops
Dev opsDev ops
Dev ops
 
(WEB307) Scalable Site Management Using AWS OpsWorks | AWS re:Invent 2014
(WEB307) Scalable Site Management Using AWS OpsWorks | AWS re:Invent 2014(WEB307) Scalable Site Management Using AWS OpsWorks | AWS re:Invent 2014
(WEB307) Scalable Site Management Using AWS OpsWorks | AWS re:Invent 2014
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESQuick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013
 
Deploying Django with Ansible
Deploying Django with AnsibleDeploying Django with Ansible
Deploying Django with Ansible
 
Puppi. Puppet strings to the shell
Puppi. Puppet strings to the shellPuppi. Puppet strings to the shell
Puppi. Puppet strings to the shell
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
 

Último

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Último (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Virtualization and automation of library software/machines + Puppet

  • 1.
  • 2. Introduction 2 • Virtualization – What is it? – Hands-on lab • Automation – How do you mean? – Hands-on lab • Puppet – Manipulating – Hands-on lab • Questions?
  • 3. Virtualization: What is it? 3 • Stand alone server – Host & Guest • Dedicated Server – Guest => Virtual Machine – Host => Actual machine • Benefits – Less physical machines – Easy to move
  • 4. Virtualization: What is it? 4 • Virtualization today: – VMware -> vsphere – Microsoft -> Hyper-V – Redhat -> RHEV – VMware player http://www.vmware.com/products/player/ – VMware esxi http://www.vmware.com/products/vsphere-hypervisor/overview.html – VirtualBox http://www.virtualbox.org/ – KVM http://www.linux-kvm.org/page/Main_Page – Xen http://www.xen.org/
  • 12. Automation: How do you mean? 12 • Installing OS – > insert disc, choose options, configure root, etc… – > Login, create users, configure server –>… • Automation = install steps written in file – Kickstart – Preseed
  • 13. Automation: How do you mean? 13 • Creating kickstart file – Set language, keyboard, timezone, root password, network, … lang en_US langsupport en_US.UTF-8 keyboard us timezone --utc Europe/Brussels rootpw *** text skipx install cdrom zerombr bootloader --location=mbr network --bootproto=dhcp key XXXXXXXXXXXXXXXX • Hard disc formating clearpart --all --initlabel part /boot --fstype ext3 --size=150 --ondisk=sda part / --fstype=ext3 --size=1024 --ondisk=sda part swap --size=7644 --ondisk=sda part pv.6 --size=0 --grow --ondisk=sda volgroup vg00 --pesize=32768 pv.6 logvol /var/log --fstype ext3 --name=varlog --vgname=vg00 --size=2048
  • 14. Automation: How do you mean? 14 • Hard disc – Additional partition exlibris (35GB) clearpart --all --initlabel part /boot --fstype ext3 --size=150 --ondisk=sda part / --fstype=ext3 --size=1024 --ondisk=sda part swap --size=4096 --ondisk=sda part pv.6 --size=0 --grow --ondisk=sda volgroup vg00 --pesize=32768 pv.6 logvol /var/log --fstype ext3 --name=varlog --vgname=vg00 --size=2048 logvol /var --fstype ext3 --name=var --vgname=vg00 --size=1536 logvol /tmp --fstype ext3 --name=tmp --vgname=vg00 --size=5120 logvol /opt --fstype ext3 --name=opt --vgname=vg00 --size=1024 logvol /usr --fstype ext3 --name=usr --vgname=vg00 --size=4096 logvol /home --fstype ext3 --name=home --vgname=vg00 --size=512 logvol /exlibris --fstype ext3 --name=exlibris --vgname=vg00 --size=35840 • End script auth --useshadow --enablemd5 selinux --disabled firewall --enabled --ssh firstboot --disabled reboot --eject
  • 15. Automation: How do you mean? 15 • Add packages repo --name=epel --baseurl=http://dl.fedoraproject.org/pub/epel/5/x86_64/ %packages @core epel-release-5-4 screen ruby puppet • Post – Define hostname, register with RedHat, set puppetmaster %post --log=/root/postinstall.log # set hostname to the dns one IP=`ifconfig eth0 | grep "addr:" | cut -d':' -f2 | cut -d' ' -f1` HOSTNAME=`nslookup $IP | grep "name =" | cut -d'=' -f2 | sed 's/.(.*)./1/'` SHORTHOSTNAME=`nslookup $IP | grep "name =" | cut -d'=' -f2 | sed 's/.(.*)./1/' | cut -d'.' -f1` # replace the hostname in the network configuration grep -v "HOSTNAME" /etc/sysconfig/network > /tmp/network echo "HOSTNAME=${HOSTNAME}" >> /tmp/network cp /tmp/network /etc/sysconfig/network echo "${IP} ${HOSTNAME} ${SHORTHOSTNAME}" >> /etc/hosts rhnreg_ks --profilename=${HOSTNAME} --activationkey=XXXXXXXXXXXXX
  • 16. Automation: How do you mean? 16 • Users and SSH – Add user, disable root-ssh-login, config port ssh, update system # Create user install useradd --uid 900 install # Set passwd for user install echo "***" | passwd --stdin install # Disable ssh rootlogin sed -e 's/^#PermitRootLoginsyes$/PermitRootLogin no/' < /etc/ssh/sshd_config > /tmp/sshd_config # Use port 22000 as default sed -e 's/^#Ports22$/Port 22000/' < /tmp/sshd_config > /tmp/sshd_config2 mv /tmp/sshd_config2 /etc/ssh/sshd_config rm /tmp/sshd_config # Open non default port 22000 for ssh sed -e 's/--dports22/--dport 22000/' < /etc/sysconfig/iptables > /tmp/iptables mv /tmp/iptables /etc/sysconfig/iptables /usr/bin/yum clean all /usr/bin/yum -y update /usr/bin/yum clean all
  • 17. Automation: Hands-on lab 17 • Try to create SFX-installation - Packages /usr/bin/yum -y install glibc unixODBC unixODBC-devel e2fsprogs-libs expat libxml2 zlib libxslt libgcrypt libgpg-error krb5-libs keyutils-libs libselinux libsepol gmp pcre libaio gdbm libstdc++ ncurses bzip2-libs /usr/bin/yum clean all #Disable selinux echo 0 > /selinux/enforce #stop iptables /etc/init.d/iptables stop #disable iptables /sbin/chkconfig --level 2345 iptables off – Sfx-installer can extract only • ./sfx_version_4_linux64_installer.run --confirm – Sfx-installer can run without disclaimer • ./starter.sh nodisclaimer
  • 18. Automation: Hands-on lab 18 • Sfx-installer can extract only • Sfx-installer can run without disclaimer
  • 19. Automation: Hands-on lab 19 • Sfx-installer can use auto answer-file – Sfx-installer can extract only – Sfx-installer can run without disclaimer
  • 20. Automation: Hands-on lab 20 • How to do this? mkdir -m777 /exlibris/ftp_from_exlibris cd /exlibris/ftp_from_exlibris wget 'http://sartre.ugent.be/bt/sfx_version_4_linux64_installer.run‘ chmod a+x sfx_version_4_linux64_installer.run /bin/echo “LICENSE-SFXGLB41" > license.txt /bin/echo “LICENSE-SFXLCL41" >> license.txt /bin/echo “LICENSE-SFXTST41" >> license.txt # extract sfx_installer echo "y" > answer.txt echo "n" >> answer.txt ./sfx_version_4_linux64_installer.run --confirm < answer.txt #start installer cd build echo "y" > answer.txt echo "3410" >> answer.txt echo "n" >> answer.txt ./starter.sh nodisclaimer < answer.txt # Set passwd for users sfx echo "***" | passwd --stdin sfxglb41 echo "***" | passwd --stdin sfxlcl41 echo "***" | passwd --stdin sfxtst41
  • 21. Automation: Hands-on lab 21 • Finishing script # Add port 80 for browsing sed -e 's/^Listens3410$/Listen 80nListen 3410/' < /exlibris/sfx_ver/sfx4_1/proxy/conf/httpd.conf > /tmp/httpproxy.conf mv /tmp/httpproxy.conf /exlibris/sfx_ver/sfx4_1/proxy/conf/httpd.conf # Open the port in the firewall sed '/23000/i-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -- dport 80 -j ACCEPT' < /etc/sysconfig/iptables > /tmp/iptables sed '/23000/i-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -- dport 3410 -j ACCEPT' < /tmp/iptables > /etc/sysconfig/iptables #Enable back iptables /sbin/chkconfig --level 2345 iptables on
  • 25. Puppet: Manipulating 25 • Automation software • DSL Language written in Ruby • Client / server oriented • Repeatable processes • Abstraction layers
  • 26. Puppet: Manipulating 26 • Abstraction layers? – Package managers | User management | Services Apt, dpkg, yum, rpm, pkg, … | useradd, adduser, dscl, …
  • 27. Puppet: Manipulating 27 • Server structure ‒ puppet/ ‒ manifests/ ‒ environments / ‒ production / ‒ modules / ‒ [a-z][a-z0-9_]* / ‒ files / ‒ manifests / ‒ init.pp ‒ templates / ‒ tests / ‒ manifests / ‒ nodes.pp ‒ development /
  • 28. Puppet: Manipulating 28 • Nodes.pp node HOSTNAME { include apache; class { 'ntp': enable => false; } apache::vhost { 'personal_site': port => 80, docroot => '/var/www/personal', options => 'Indexes MultiViews‘; } } • Module – [a-z][a-z0-9_]* (except main, settings)
  • 29. Puppet: Manipulating 29 ‒modules / • init.pp ‒[a-z][a-z0-9_]* / ‒files / – Class-name same as module ‒service.conf ‒manifests / ‒init.pp • otherclass.pp ‒otherclass.pp ‒templates / – my_module::otherclass ‒template.erb ‒tests / • files/service.conf – puppet:///modules/my_module/service.conf • templates/template.erb – template('my_module/template.erb')
  • 30. Puppet: Manipulating 30 • Built-in resources: – file file { ‘/exlibris’: ensure => directory, mode => 777, group => exlibris; } file {‘/exlibris/ftp_from_exlibris/build/answer.txt’: ensure => present, content => "yn3410nn", require => Exec["extract_sfx"]; } file { ‘/exlibris’: ensure => directory, mode => 777, group => exlibris; ‘/exlibris/ftp_from_exlibris/build/answer.txt’: ensure => present, content => "yn3410nn", require => Exec["extract_sfx"]; }
  • 31. Puppet: Manipulating 31 – package package { ‘glibc’: ensure => ‘installed’; ‘unixODBC’: ensure => ‘installed’; ‘unixODBC-devel’ ensure => ‘latest’; ‘gdbm.i686’: ensure => ‘2.2.16-6’; } Package { ensure => ‘installed’ } $package2install = [ ‘glibc’, ‘unixODBC’, ‘unixODBC-devel’, ‘gdbm.i686’ ] package { $package2install: } – exec exec { ‘download_installer’: command => ‘./sfx_version_4_linux64_installer.run --confirm < answer.txt’, cwd => ‘/exlibris/ftp_from_exlibris’, creates => ‘/exlibris/ftp_from_exlibris/build’, require => File[‘/exlibris/ftp_from_exlibris’]; }
  • 32. Puppet: Manipulating 32 – user & group user { ‘ca20c800’: ensure => ‘present’, group { ‘ca20c800’: comment => ‘Comment for user’, ensure => ‘present’, uid => ‘600’, gid => ‘600’; gid => ‘600’, } membership => minimum, shell => ‘/bin/bash’, home => ‘/home/$title", require => Group[$title], password => ‘***’; } – ± 40 different resource types • cron • mount • yumrepo
  • 33. Puppet: Hands-on lab 33 • Sfx & puppet class sfx { Package { ensure => "installed"} $package2install = [ "glibc", "unixODBC-devel", "e2fsprogs- libs", "unixODBC", "expat", "libxml2", "zlib", "libxslt", "libgcrypt", "libgpg- error", "krb5-libs", "keyutils- libs", "libselinux", "libsepol", "gmp", "pcre.i686", "pcre.x86_64", "libaio", " gdbm.i686", "gdbm.x86_64", "libstdc++", "ncurses", "bzip2-libs.i686", "bzip2- libs.x86_64" ] package { $package2install: } concat::fragment { "/etc/sysconfig/iptables.sfx.server": target => "/etc/sysconfig/iptables", source => 'puppet:///modules/sfx/iptables.server', order => 200, }
  • 34. Puppet: Hands-on lab 34 • Sfx & puppet file { ‘/exlibris’: ensure => directory, group => exlibris; ‘/exlibris/ftp_from_exlibris’: ensure => directory, group => exlibris, mode => 777, require => File[‘/exlibris’]; ‘/exlibris/ftp_from_exlibris/answer.txt’: ensure => present, content => ‘ynn’, ‘/exlibris/ftp_from_exlibris/build/answer.txt’: ensure => present, content => ‘yn3410nn’, require => Exec[‘extract_sfx"]; }
  • 35. Puppet: Hands-on lab 35 • Sfx & puppet exec { "download_installer": command => "/usr/bin/wget http://sartre.ugent.be/bt/sfx_version_4_linux64_installer.run -O sfx_version_4_linux64_installer.run; /bin/chmod a+x sfx_version_4_linux64_installer.run", cwd => "/exlibris/ftp_from_exlibris", creates => "/exlibris/ftp_from_exlibris/sfx_version_4_linux64_installer.run", require => File["/exlibris/ftp_from_exlibris"]; "get_license": command => "/usr/bin/wget http://lib.ugent.be/files/elag2012/${hostname}.license -O license.txt", cwd => "/exlibris/ftp_from_exlibris", creates => "/exlibris/ftp_from_exlibris/license.txt", require => File["/exlibris/ftp_from_exlibris"]; "extract_sfx": command => "./sfx_version_4_linux64_installer.run --confirm < answer.txt", cwd => "/exlibris/ftp_from_exlibris", creates => "/exlibris/ftp_from_exlibris/build", require => File["/exlibris/ftp_from_exlibris/answer.txt"]; "installing_sfx": command => "/etc/init.d/iptables stop; /sbin/chkconfig --level 2345 iptables off; ./starter.sh nodisclaimer < answer.txt", cwd => "/exlibris/ftp_from_exlibris/build", creates => "/exlibris/sfx_ver", timeout => "1800", require => File["/exlibris/ftp_from_exlibris/build/answer.txt"]; }
  • 36. Puppet: Hands-on lab 36 • Server node node 'ca20c802' { class { 'basenode':; 'vmware::tools':; 'selinux::disable':; 'exlibris':; 'sfx':; 'icinga': nrpe_allowed_hosts => ‘x.x.x.x'; 'icinga::plugins::checksfx': perfdata => true; } }
  • 37. Puppet: Hands-on lab 37 • Sfx-class class exlibris { realize User_create[exlibris] realize User_create[ca20c801] realize User_create[ca20c802] realize User_create[ca20c803] realize User_create[ca20c804] concat::fragment { "/etc/sysconfig/iptables.exlibris.server": target => "/etc/sysconfig/iptables", source => 'puppet:///modules/exlibris/iptables.server', order => 150, } }
  • 38. Questions? 38 • Questions? http://www.vmware.com http://fedoraproject.org/wiki/Anaconda/Kickstart http://www.puppetlabs.com  Omar.Reygaert@UGent.be