puppet syntax error

raw

README.rst

Problem: Running the first puppet manifest from the learning tutorial gives me a syntax error.

Solution: use .pp instead of .rb file extension for the manifest.

raw

commands.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$ puppet --version
2.7.23
$ puppet apply remove-katie.rb 
/usr/lib/ruby/vendor_ruby/puppet/parser/parser_support.rb:200:in `parse_ruby_file': (eval):3:in `parse_ruby_file': compile error (SyntaxError)
(eval):1: syntax error, unexpected ':', expecting '}'
        from /usr/lib/ruby/vendor_ruby/puppet/parser/parser_support.rb:157:in `parse'
        from /usr/lib/ruby/vendor_ruby/puppet/node/environment.rb:199:in `perform_initial_import'
        from /usr/lib/ruby/vendor_ruby/puppet/node/environment.rb:85:in `known_resource_types'
        from /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
        from /usr/lib/ruby/vendor_ruby/puppet/node/environment.rb:82:in `known_resource_types'
        from /usr/lib/ruby/vendor_ruby/puppet/resource/type_collection_helper.rb:5:in `known_resource_types'
        from /usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:420:in `initvars'
        from /usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:186:in `initialize'
        from /usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:24:in `new'
        from /usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:24:in `compile'
        from /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:84:in `compile'
        from /usr/lib/ruby/vendor_ruby/puppet/util.rb:166:in `benchmark'
        from /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:82:in `compile'
        from /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:42:in `find'
        from /usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:195:in `find'
        from /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:218:in `main'
        from /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:149:in `run_command'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:309:in `run'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:416:in `hook'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:309:in `run'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:407:in `exit_on_fail'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:309:in `run'
        from /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:69:in `execute'
        from /usr/bin/puppet:4
 
raw

remove-katie.rb

1
2
3
4
user {'katie':
  ensure  => absent,
}
 
Christian Weiske Christian Weiske
owner

History