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',
}