Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error: undefined method `[]' for nil:NilClass

I'm upgrading my vagrant setup to Puppet 3 so that I can use Hiera for variable management but I keep getting the following error on provisioning:

Error: undefined method `[]' for nil:NilClass at /tmp/vagrant-puppet/manifests/default.pp:7 on node drupal.example.com
Wrapped exception:
undefined method `[]' for nil:NilClass
Error: undefined method `[]' for nil:NilClass at /tmp/vagrant-puppet/manifests/default.pp:7 on node drupal.example.com
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

is means the command failed!

Here is my default.pp:

#import 'devsites.pp'

#group { 'puppet': ensure => present }
#Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/' ] }
#File { owner => 0, group => 0, mode => 0644 }

class { 'apt': }

I've stripped it back to the bare minimum just so I can get my head around what's happening. I know I'm missing something fundamental here as this used to work on puppet 2.

If someone could point me in the right direction I'd greatly appreciate it.