Ask Your Question
0

Unable to create a Disk on GCP using Puppet

asked 2018-03-04 00:36:32 -0500

updated 2018-03-05 09:30:46 -0500

DarylW gravatar image

Following is the code, when i run it it throws the following error.

Puppet Version: 3.8.5
Puppet GCP Puppet Modules version: 

 google-cloud (v0.2.2)
├── google-gauth (v0.2.0)
├── google-gcompute (v0.2.1)
├── google-gcontainer (v0.2.0)
├── google-gdns (v0.1.1)
├── google-glogging (v0.1.1)
├── google-gpubsub (v0.1.0)
├── google-gspanner (v0.1.0)
├── google-gsql (v0.2.0)
├── google-gstorage (v0.2.0)
├── puppetlabs-apt (v4.5.1)
└── puppetlabs-stdlib (v4.24.0)


Error: Could not prefetch gcompute_disk provider 'google': undefined method `[]' for nil:NilClass
Error: Could not set 'present' on ensure: undefined method `[]' for nil:NilClass at 19:/etc/puppet/manifests/disk.pp
Error: Could not set 'present' on ensure: undefined method `[]' for nil:NilClass at 19:/etc/puppet/manifests/disk.pp
Wrapped exception:
undefined method `[]' for nil:NilClass
Error: /Stage[main]/Main/Gcompute_disk[data-disk-1]/ensure: change from absent to present failed: Could not set 'present' on ensure: undefined method `[]' for nil:NilClass at 19:/etc/puppet/manifests/disk.pp

Code:

gauth_credential { 'mycred':
  path     => '/home/dscadmin/gcpkey.json',
  provider => serviceaccount,
  scopes   => ['https://www.googleapis.com/auth/compute'],
}

gcompute_zone { 'us-central1-a':
  project    => 'google.com:striped-inquiry-194312',
  credential => 'mycred',
}

gcompute_disk { 'data-disk-1':
  ensure              => present,
  size_gb             => 50,
  zone                => 'us-central1-a',
  project             => 'google.com:striped-inquiry-194312',
  credential          => 'mycred',
}
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-03-07 11:29:12 -0500

MichaelSmith gravatar image

It's not immediately clear what's going on, but that looks like an issue in the gcompute_disk implementation. You can file issues and get help with that module at https://github.com/GoogleCloudPlatfor....

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-03-04 00:36:32 -0500

Seen: 20 times

Last updated: Mar 07