Sha256: 53401176595883c636d1bc98e8f3e2f5e30a31441d4af58061a427a259424cf5

Contents?: true

Size: 1.42 KB

Versions: 192

Compression:

Stored size: 1.42 KB

Contents

# $Id$

$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 }
    }
}

$yay = yay
$a = yay
$b = boo

case $yay {
    $a: { file { "/tmp/existsfile5": mode => 755, ensure => file } }
    $b: { file { "/tmp/existsfile5": mode => 644, ensure => file } }
    default: { file { "/tmp/existsfile5": mode => 711, ensure => file } }

}

$regexvar = "exists regex"
case $regexvar {
    "no match": { file { "/tmp/existsfile6": mode => 644, ensure => file } }
    /(.*) regex$/: { file { "/tmp/${1}file6": mode => 755, ensure => file } }
    default: { file { "/tmp/existsfile6": mode => 711, ensure => file } }
}

Version data entries

192 entries across 117 versions & 3 rubygems

Version Path
puppet-2.7.22 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-2.7.22 test/data/snippets/casestatement.pp
puppet-3.2.1 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-3.2.1 spec/fixtures/unit/pops/parser/lexer/casestatement.pp
puppet-3.2.1.rc1 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-3.2.1.rc1 spec/fixtures/unit/pops/parser/lexer/casestatement.pp
puppet-3.2.0.rc2 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-3.2.0.rc2 spec/fixtures/unit/pops/parser/lexer/casestatement.pp
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-3.2.0.rc1 spec/fixtures/unit/pops/parser/lexer/casestatement.pp
puppet-3.2.0.rc1 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-2.7.21 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-2.7.21 test/data/snippets/casestatement.pp
puppet-3.1.1 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-2.6.18 test/data/snippets/casestatement.pp
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-3.1.0 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-3.1.0.rc2 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-3.1.0.rc1 spec/fixtures/unit/parser/lexer/casestatement.pp
puppet-3.0.2 spec/fixtures/unit/parser/lexer/casestatement.pp