Sha256: 08447ee7bf9873063161b02fe232e9087d7fdac492c5782b814571b9bf5cde00

Contents?: true

Size: 964 Bytes

Versions: 4

Compression:

Stored size: 964 Bytes

Contents

# $Id: casestatement 832 2006-01-17 07:11:50Z luke $

$var = "value"

case $var {
  "nope": {
     file { "/tmp/fakefile": mode => 644, ensure => file }
  }
  "value": {
     file { "/tmp/existsfile": mode => 755, ensure => file }
  }
}

$ovar = "yayness"

case $ovar {
    "fooness": {
         file { "/tmp/nostillexistsfile": mode => 644, ensure => file }
    }
    "booness", "yayness": {
        case $var {
            "nep": { 
                 file { "/tmp/noexistsfile": mode => 644, ensure => file }
            }
            "value": { 
                 file { "/tmp/existsfile2": mode => 755, ensure => file }
            }
        }
    }
}

case $ovar {
    "fooness": {
         file { "/tmp/nostillexistsfile": mode => 644, ensure => file }
    }
    default: {
        file { "/tmp/existsfile3": mode => 755, ensure => file }
    }
}

$bool = true

case $bool {
    true: {
        file { "/tmp/existsfile4": mode => 755, ensure => file }
    }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-0.13.1 examples/code/snippets/casestatement
puppet-0.13.6 examples/code/snippets/casestatement
puppet-0.13.0 examples/code/snippets/casestatement
puppet-0.13.2 examples/code/snippets/casestatement