Ask Your Question
0

How to compile a catalog on the master without using puppet agent -t

asked 2016-02-04 21:30:38 -0500

rajiv272 gravatar image

updated 2016-02-08 07:33:37 -0500

How to compile or execute a manifest from master itself instead of compiling it on agent using puppet agent --test. I think there must be some way to do that because compiling manifest on all agent doesn't sound so feasible. Thanks ,

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2016-02-07 18:15:49 -0500

Henrik Lindberg gravatar image

Look at the command puppet master compile. It does just that. You may also want to look at the puppet parser validate command if you just want manifests to be parsed and syntax errors reported.

edit flag offensive delete link more
0

answered 2016-02-22 05:52:17 -0500

FranzCC gravatar image

Hi Alex, It seems, that an offline apply of a catalog cannot resolve puppet file paths.
This is true for mcollective and my own files.

Error: /Stage[main]/Puppet_enterprise::Mcollective::Server::Plugins/File[/opt/puppetlabs/mcollective/plugins/mcollective]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/puppet_enterprise/mcollective/plugins

I use the latest version of puppet pe. (2015.3.2) Since a puppet agent -t run speeded up about 8s compared to version 2015.3.1, there's no use for me to offline compile, copy it to the node and then apply it.
. It don't know if it's a bug or a design issue though.

Rgds. Franz

edit flag offensive delete link more

Comments

Did you compile the catalog on the puppet master? Does it work if you use a full URL puppet://puppetmaster.domain.com/puppet_enterprise/mcollective/plugins etc? (I presume it will.) Because I haven't seen this before, maybe try the mailing list, & because this character limit isn't ideal!

Alex Harvey gravatar imageAlex Harvey ( 2016-02-22 08:39:04 -0500 )edit
0

answered 2016-02-08 07:30:23 -0500

I actually wrote a related blog post showing how you can do this from a bundle on a laptop, that also covers how to do it on a Puppet Master: http://razorconsulting.com.au/compili...

Doing it on the Puppet Master is just:

# puppet master --compile myhost.example.com > myhost.json

And then on your client node:

# puppet apply --catalog myhost.json
edit flag offensive delete link more

Comments

Hi Alex, i'm searching for a way to speed up puppet agent -t on the nodes. Unfortunately your solution doesn't work for me. Applying the catalog throws a lot of error message on the node. Perhaps a bug ? Rgds. Franz

FranzCC gravatar imageFranzCC ( 2016-02-09 01:55:24 -0500 )edit

Of course, i cut the first line. E.g: Error: /Stage[main]/Puppet_enterprise::Mcollective::Server::Plugins/File[/opt/puppetlabs/mcollective/plugins/mcollective]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/puppet_enterprise...

FranzCC gravatar imageFranzCC ( 2016-02-09 01:57:52 -0500 )edit

I think of a bug, because the files have been accessed w/o errors: 09/Feb/2016:08:57:48 +0100 "GET /puppet/v3/file_metadatas/modules/puppet_enterprise/mcollective/plugins?environment=production&links=manage&recurse=true&source_permissions=ignore&checksum_type=md5 HTTP/1.1 BUG ?

FranzCC gravatar imageFranzCC ( 2016-02-09 01:59:21 -0500 )edit

If you're having a problem with this, or the procedure I documented at my blog, you're welcome to comment there, as I only have a few hundred characters to respond in this comments section.

Alex Harvey gravatar imageAlex Harvey ( 2016-02-09 02:18:55 -0500 )edit

Hi Alex, we have a dualstacked env. IPV4/IPV6. Puppet PE seems to have a severe BUG. I changed the file /opt/puppetlabs/puppet/modules/puppet_enterprise/manifests/mcollective/server/plugins.pp to use the fqdn. works now. Will file a SR. Thx. Franz

FranzCC gravatar imageFranzCC ( 2016-02-23 00:12:56 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-02-04 21:28:05 -0500

Seen: 1,226 times

Last updated: Feb 22 '16