Generate "Compiled catalog"/yaml for a node?

2,757 views
Skip to first unread message

Yushu Yao

unread,
May 6, 2011, 4:59:47 PM5/6/11
to puppet-users
Hi Experts,

I remember we had this discussion before, but could find it.

Can I run a command to generate a "Compiled catalog" for a specific node (on the master node)? And apply this on the client node? What are the limitations for doing this?

Basically we have special handling for the webserver/CA part of puppet.

Thank you very much!

-Yushu

+-------------------------------------------------+
| Yushu Yao
| Ph:1-510-486-4690 
|
| Lawrence Berkeley National Lab
| Mailstop 50B-6222
| 1 Cyclotron Road
| Berkeley CA 94720-8147 - USA
+-------------------------------------------------+


Nan Liu

unread,
May 6, 2011, 5:12:00 PM5/6/11
to puppet...@googlegroups.com
On Fri, May 6, 2011 at 8:59 PM, Yushu Yao <yao....@gmail.com> wrote:
> Hi Experts,
>
> I remember we had this discussion before, but could find it.
>
> Can I run a command to generate a "Compiled catalog" for a specific node (on
> the master node)? And apply this on the client node? What are the
> limitations for doing this?

Compiling the catalog is straightfoward. The tricky issues are syncing
facts, and uploading facts from agent to master, and you need to have
means to distribute files out of band to the agent without it
requesting via https from the master. (local mount nfs, rsync to
local, probably some other creative ways I haven't thought of.)

Past threads:
https://groups.google.com/group/puppet-users/browse_thread/thread/871d3e6f7dde759e/b63bdb45eaa71db6?lnk=gst&q=catalog+dmz#b63bdb45eaa71db6

Thanks,

Nan

Patrick

unread,
May 6, 2011, 5:22:13 PM5/6/11
to puppet...@googlegroups.com

On May 6, 2011, at 1:59 PM, Yushu Yao wrote:

> Hi Experts,
>
> I remember we had this discussion before, but could find it.
>
> Can I run a command to generate a "Compiled catalog" for a specific node (on the master node)? And apply this on the client node? What are the limitations for doing this?
>
> Basically we have special handling for the webserver/CA part of puppet.
>
> Thank you very much!
>
> -Yushu


1) You can generate the catalog using "puppet master --verbose --compile computer.name.domain_name"
2) Anything that uses "puppet:///whatever" won't work, unless the client can connect to the master.

Yushu Yao

unread,
May 6, 2011, 5:43:41 PM5/6/11
to puppet...@googlegroups.com
Thanks.



1) You can generate the catalog using "puppet master --verbose --compile computer.name.domain_name"
2) Anything that uses "puppet:///whatever" won't work, unless the client can connect to the master.
Does this mean the file templates will not work as well?

Thanks.
 

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


Daniel Pittman

unread,
May 6, 2011, 5:48:07 PM5/6/11
to puppet...@googlegroups.com
On Fri, May 6, 2011 at 14:43, Yushu Yao <yy...@lbl.gov> wrote:

>> 1) You can generate the catalog using "puppet master --verbose --compile
>> computer.name.domain_name"
>> 2) Anything that uses "puppet:///whatever" won't work, unless the client
>> can connect to the master.
>
> Does this mean the file templates will not work as well?

They work fine; so does file 'content'; just 'source' doesn't work
without communication to the master.

You might also want to look at moonshine and shadow puppet, both built
atop Puppet: https://github.com/railsmachine/moonshine/wiki/shadow-puppet-overview-and-examples

Regards,
Daniel
--
⎋ Puppet Labs Developer – http://puppetlabs.com
✉ Daniel Pittman <dan...@puppetlabs.com>
✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775
♲ Made with 100 percent post-consumer electrons

Yushu Yao

unread,
May 7, 2011, 1:50:54 AM5/7/11
to puppet...@googlegroups.com
Thanks Folks for the answers.

Before I go into this direction, I just want to make sure one thing from the developers:

Is this a feature that you think will stay inside puppet? (in 3.0, 4.0, etc)

Or has there been any discussion to remove this feature?

Feel safer if I know this feature will stay long. Thanks


-Yushu


+-------------------------------------------------+
| Yushu Yao
| Ph:1-510-486-4690 
|
| Lawrence Berkeley National Lab
| 1 Cyclotron Road
| Berkeley CA 94720 - USA
+-------------------------------------------------+





--

Nigel Kersten

unread,
May 7, 2011, 12:00:01 PM5/7/11
to puppet...@googlegroups.com
On Sat, May 7, 2011 at 5:50 AM, Yushu Yao <yy...@lbl.gov> wrote:
Thanks Folks for the answers.

Before I go into this direction, I just want to make sure one thing from the developers:

Is this a feature that you think will stay inside puppet? (in 3.0, 4.0, etc)

Or has there been any discussion to remove this feature?

Feel safer if I know this feature will stay long. Thanks


You're only going to see more flexible control over out of band catalog compilation like this Yushu, not less.

We won't be removing this feature, we'll be improving it.


 
--
Nigel Kersten
Product, Puppet Labs
@nigelkersten

Yushu Yao

unread,
May 23, 2011, 7:21:38 PM5/23/11
to puppet...@googlegroups.com
One Follow up question:

how do I apply the compiled catalog on the client?

The yaml I get from puppet master --compile is like:
cat mytest.yaml
{
  "data": {
    "edges": [
      {
        "target": "Class[main]",
        "source": "Stage[main]"
.... ...
}

If I do on the client: puppet apply --test --debug mytest.yaml, I get
Could not parse for environment production: Syntax error at '{'; expected '}' at /root/mytest.yaml:1 on node 192.168.2.199

Am I missing anything?

Thanks a lot!


-Yushu

+-------------------------------------------------+
| Yushu Yao
| Ph:1-510-486-4690 
|
| Lawrence Berkeley National Lab
| 1 Cyclotron Road
| Berkeley CA 94720 - USA
+-------------------------------------------------+





--

Nan Liu

unread,
May 23, 2011, 7:41:36 PM5/23/11
to puppet...@googlegroups.com
On Mon, May 23, 2011 at 4:21 PM, Yushu Yao <yy...@lbl.gov> wrote:
> One Follow up question:
>
> how do I apply the compiled catalog on the client?
>
> The yaml I get from puppet master --compile is like:
> cat mytest.yaml
> {
>   "data": {
>     "edges": [
>       {
>         "target": "Class[main]",
>         "source": "Stage[main]"
> .... ...
> }
>
> If I do on the client: puppet apply --test --debug mytest.yaml, I get
> Could not parse for environment production: Syntax error at '{'; expected
> '}' at /root/mytest.yaml:1 on node 192.168.2.199

Not the most intuitive thing, puppet apply -t -d --apply mytest.yaml.
Most likely will get expired catalog, but that can either be updated
by changing expire datetime in the catalog, or controlling expiration
using --runinterval (it's overloading the same option for two
purpose).

HTH,

Nan

Yushu Yao

unread,
May 23, 2011, 11:08:06 PM5/23/11
to puppet...@googlegroups.com
That works.

Thanks a lot@
-yushu


+-------------------------------------------------+
| Yushu Yao
| Ph:1-510-486-4690 
|
| Lawrence Berkeley National Lab
| 1 Cyclotron Road
| Berkeley CA 94720 - USA
+-------------------------------------------------+




Reply all
Reply to author
Forward
0 new messages