Skip to content

Instantly share code, notes, and snippets.

Created April 27, 2012 19:04
Show Gist options
  • Select an option

  • Save anonymous/2511914 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/2511914 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Apr 27, 2012.
    41 changes: 41 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    apache::params:

    class apache::params {


    $vgname = 'vg01'
    $lvname = 'wwwlv'
    $lvsize = '2G'
    $fstype = 'ext4'
    $fsname = "/dev/$vgname/$lvname"

    }

    class apache::lvm {
    include apache::params

    logical_volume { "$apache::params::lvname":
    ensure => present,
    volume_group => "$apache::params::vgname",
    size => "$apache::params::lvsize",
    }

    filesystem { "$apache::params::fsname":
    ensure => present,
    fs_type => "$apache::params::fsytpe",
    require => Logical_volume["$apache::params::lvname"],
    }

    file { "/www":
    ensure => 'directory'
    }

    mount { "www":
    require => [ File['/www'], Filesystem["$apache::params::fsname"] ],
    atboot => 'yes',
    ensure => 'mounted',
    device => "/dev/$apache::params::vgname/$apache::params::lvname",
    fstype => "$apache::params::fstype",
    }

    }