Could not autoload puppet/provider/gauth_credential/machineaccount: cannot load such file -- googleauth

90 views
Skip to first unread message

kumar.a...@gmail.com

unread,
Apr 27, 2018, 2:50:38 PM4/27/18
to Puppet On GCP Discussions
Hi,


I have followed Nelson's blog https://cloudplatform.googleblog.com/2017/08/introducing-Puppet-support-for-Google-Cloud-Platform24.html

Made sure all the relevant modules and gems are installed but I'm still getting the following error.
Google search didn't get much hope. Was hoping if somebody could help me.


kumar_allamraju@puppetserver:~$ puppet apply gcp.pp 
Error: Could not autoload puppet/provider/gauth_credential/machineaccount: cannot load such file -- googleauth
Error: Could not autoload puppet/type/gauth_credential: Could not autoload puppet/provider/gauth_credential/machine
account: cannot load such file -- googleauth
Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/gauth_credenti
al: Could not autoload puppet/provider/gauth_credential/machineaccount: cannot load such file -- googleauth (file: 
/home/kumar_allamraju/gcp.pp, line: 1, column: 1) on node puppetserver.c.kumara-project.internal

Here is my puppet file

===========================================================
gauth_credential { 'mycred':
  provider => serviceaccount,
  path     => '/home/kumar_allamraju/puppet-gcp.json',
}
gcontainer_cluster { 'myapp-netes':
  ensure             => present,
  initial_node_count => 2,
  node_config        => {
    machine_type => 'n1-standard-1', # we want a 4-core machine for our cluster
    disk_size_gb => 10,             # ... and a lot of disk space
  },
  zone               => 'us-west1-a',
  project            => 'google.com:kumara-project',
  credential         => 'mycred',
}
===========================================================

I do have a service account created - puppe...@kumara-project.iam.gserviceaccount.com to run puppet modules on GCP.

Here is the output of

kumar_allamraju@puppetserver:~$ puppet module list/home/kumar_allamraju/.puppetlabs/etc/code/modules├── google-cloud (v0.3.0)├── google-gauth (v0.2.1)├── google-gcompute (v0.2.1)├── google-gcontainer (v0.2.0)├── google-gdns (v0.1.1)├── google-giam (v0.1.1)├── google-glogging (v0.1.1)├── google-gpubsub (v0.1.0)├── google-gresourcemanager (v0.1.1)├── google-gspanner (v0.1.0)├── google-gsql (v0.3.0)├── google-gstorage (v0.2.1)├── puppetlabs-apt (v4.5.1)└── puppetlabs-stdlib (v4.25.1)/opt/puppetlabs/puppet/modules (no modules installed)

kumar_allamraju@puppetserver:~$ puppet module install google/cloudNotice: Preparing to install into /home/kumar_allamraju/.puppetlabs/etc/code/modules ...Notice: Module google/cloud 0.3.0 is already installed.



kumar.a...@gmail.com

unread,
Apr 27, 2018, 6:47:46 PM4/27/18
to Puppet On GCP Discussions
You were right. I don't get this error if I do puppet apply file.pp on "puppet agent".

Nelson Araujo

unread,
Apr 27, 2018, 7:11:55 PM4/27/18
to Puppet On GCP Discussions
Hi,

This means that you do not have the googleauth gem available in the context where the puppet agent runs. If you run /opt/puppetlabs/puppet/bin/gem list do you see the googleauth gem there? If not can you try to install it and try again?

/opt/puppetlabs/puppet/bin/gem install googleauth
/opt/puppetlabs/puppet/bin/gem install google-api-client

Or you can use the respective 'puppet-gem' provider of the package{} resource, as explained here: https://github.com/GoogleCloudPlatform/puppet-google-auth#installing-gems-for-puppet-agentmaster-only

Let me know how it goes.

Best regards,
-- Nelson

kumar.a...@gmail.com

unread,
Apr 28, 2018, 1:05:58 PM4/28/18
to Puppet On GCP Discussions
Thanks Nelson.
I was right there on that page but looks like I missed installing the required gems.
Now I don't get any errors on the puppet server as well.. 

Thanks for your timely response..

Reply all
Reply to author
Forward
0 new messages