0

Basically I want to do the following using puppet:

1.sudo yum install nodejs npm --enablerepo=epel
setup nodejs evironment(latest stable version) on puppet agent
2.sudo yum install git-(install git)
3.git clone git@gitlab.ishwarya.net:hello-world/nodejs-helloworld.git -(git clone the application repo)
4.Run the application
npm install
npm start
npm test

I am new to puppet configurtion management tool. So far,I have done puppet master -agent setup.

sudo yum install puppet-server on puppet master node
sudo yum install puppet on agent node

and was able to successfully install apache on my agent.

I am using puppet version 3.8.7 on RHEL. As a first step I need to install nodejs on puppet agent to run my application.

Installed the puppetlabs-nodejs module

puppet module install puppetlabs-nodejs

/etc/puppet/manifests/site.pp on master node contains below code:

class { '::nodejs':
  nodejs_dev_package_ensure => 'present',
  npm_package_ensure        => 'present',
  repo_class                => '::epel',
}

when i run the below command on agent i get this error:

puppet agent -t 

the code fails with below error

 Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: 
Invalid resource type gpg_key at /etc/puppet/modules/nodejs/manifests/repo/nodesource/yum.pp:58 on node ip-**********
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
nad87563
  • 3,672
  • 7
  • 32
  • 54

2 Answers2

2

You should either install the puppetlabs-nodejs module or write it yourself. Either way you should have a nodejs module which has the nodejs class defined in it's init.pp file.

Make sure the something like include 'nodejs' is called withing your manifest

Miad Abrin
  • 952
  • 7
  • 14
  • i have installed the puppetlabs-nodejs module and changed my site.pp file. please check my question for more details. this time it fails with different error 'Invalid resource type gpg_key at /etc/puppet/modules/nodejs/manifests/repo/nodesource/yum.pp' – nad87563 Aug 24 '16 at 18:39
  • 1
    This 'answer' needs to be either updated or deleted. As it is, it merely suggests doing something the asker already stated he did in the question. – Matthew Schuchard Aug 25 '16 at 11:46
  • The question has been updated multiple times and the answer covers the issues others might experience as well – Miad Abrin Aug 25 '16 at 13:03
0

installing the below modules solved the error and installed nodejs

puppet module install treydock-gpg_key

puppet module install stahnma-epel
nad87563
  • 3,672
  • 7
  • 32
  • 54