Created
May 28, 2012 15:12
-
-
Save nibalizer/2819655 to your computer and use it in GitHub Desktop.
fizzbuzz
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
| $foo = inline_template('<%= (1..100).to_a.join(" ")%>') | |
| $foo2 = inline_template("<%= (1..100).to_a.each { | n | if n % 15 == 0 then 'fizzbuzz' elsif n % 5 == 0 then 'buzz' elsif n % 3 == 0 then 'fizz' else n end }%>") | |
| notify { | |
| "Fizzaaaa": | |
| message => $foo, | |
| } | |
| $things = split($foo, ' ') | |
| file { | |
| 'fizzbuzz-sleepsort.py': | |
| mode => 777, | |
| path => '/tmp/fizzbuzz-sleepsort.py', | |
| content => "#!/usr/bin/python\n\nimport time\nimport sys\n\nnum = int(sys.argv[1])\ntime.sleep(0)\n\nif num % 15 == 0:\n print 'fizzbuzz'\nelif num % 5 == 0:\n print 'buzz'\nelif num % 3 == 0:\n print 'fizz'\nelse:\n print num", | |
| } | |
| define hai { | |
| $quotient = $title | |
| exec { | |
| "$quotient-$name": | |
| command => "/tmp/fizzbuzz-sleepsort.py $title", | |
| logoutput => true, | |
| require => File['fizzbuzz-sleepsort.py'], | |
| } | |
| } | |
| hai { $things: } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment