Created
          August 18, 2011 09:57 
        
      - 
      
- 
        Save dcarley/1153768 to your computer and use it in GitHub Desktop. 
    Puppet variable case sensitivity test
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | notice: Scope(Class[main]): puppet version: 0.25.5 | |
| notice: Scope(Class[main]): conditional string: sensitive | |
| notice: Scope(Class[main]): conditional regex: sensitive | |
| notice: Scope(Class[main]): selector string: insensitive | |
| notice: Scope(Class[main]): selector regex: sensitive | |
| notice: Scope(Class[main]): case string: insensitive | |
| notice: Scope(Class[main]): case regex: sensitive | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | notice: Scope(Class[main]): puppet version: 2.6.1 | |
| notice: Scope(Class[main]): conditional string: insensitive | |
| notice: Scope(Class[main]): conditional regex: sensitive | |
| notice: Scope(Class[main]): selector string: insensitive | |
| notice: Scope(Class[main]): selector regex: sensitive | |
| notice: Scope(Class[main]): case string: insensitive | |
| notice: Scope(Class[main]): case regex: sensitive | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | notice: Scope(Class[main]): puppet version: 2.7.13 | |
| notice: Scope(Class[main]): conditional string: insensitive | |
| notice: Scope(Class[main]): conditional regex: sensitive | |
| notice: Scope(Class[main]): selector string: insensitive | |
| notice: Scope(Class[main]): selector regex: sensitive | |
| notice: Scope(Class[main]): case string: insensitive | |
| notice: Scope(Class[main]): case regex: sensitive | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | notice("puppet version: ${::puppetversion}") | |
| $CamelCase = "FooBar" | |
| # Conditionals. 0.25 doesn't support elsif | |
| if $CamelCase == "foobar" { | |
| notice("conditional string: insensitive") | |
| } else { | |
| if $CamelCase == "FooBar" { | |
| notice("conditional string: sensitive") | |
| } | |
| } | |
| if $CamelCase =~ /^foobar$/ { | |
| notice("conditional regex: insensitive") | |
| } else { | |
| if $CamelCase =~ /^FooBar$/ { | |
| notice("conditional regex: sensitive") | |
| } | |
| } | |
| # Selectors | |
| notice($CamelCase ? { | |
| "foobar" => "selector string: insensitive", | |
| "FooBar" => "selector string: sensitive", | |
| }) | |
| notice($CamelCase ? { | |
| /^foobar$/ => "selector regex: insensitive", | |
| /^FooBar$/ => "selector regex: sensitive", | |
| }) | |
| # Case | |
| case $CamelCase { | |
| "foobar": { notice("case string: insensitive") } | |
| "FooBar": { notice("case string: sensitive") } | |
| } | |
| case $CamelCase { | |
| /^foobar$/: { notice("case regex: insensitive") } | |
| /^FooBar$/: { notice("case regex: sensitive") } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment