Ask Your Question

What's the best way to run puppet agent both in daemon mode and onetime mode, and both of two modes rely on ENC?

asked 2013-03-13 09:49:16 -0600

Casel Chen gravatar image

I have requirement which not only need run puppet agent in daemon mode for some check tasks but also need run puppet agent in onetime mode for some patch tasks, they all rely on ENC to get configuration data from external data source. How can I implement it? Should I need setup two puppet masters, one for daemon tasks, the other for onetime tasks? If no, could anyone tell me how? Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-03-13 14:20:24 -0600

Daenney gravatar image

updated 2013-03-13 14:24:31 -0600

Okay, perhaps I'm misunderstanding something but it seems to me this works out of the box.

When the puppet agent is running as a daemon for most of the time it is sleeping, basically doing nothing. Then at certain times the daemon is woken up and does a Puppet run.

While that daemon is sleeping there's nothing preventing you to do a onetime run from the console manually.

If you need the daemon-agent and the console-agent to get different code you can do that using environments for example.

By default, puppet wil query the master for the 'production ... (more)

edit flag offensive delete link more


Thank you, Daenny! What I concerned is that under the condition of retrieving configuration data from external by ENC for both daemon-agent and console-agent, can a set of "Puppet Master ...(more)

Casel Chen gravatar imageCasel Chen ( 2013-03-13 22:43:04 -0600 )edit

Could you provide an example, it might make things easier to understand and explain on my behalf. Basically whatever the ENC returns will be what classifies the node. A single ...(more)

Daenney gravatar imageDaenney ( 2013-03-14 03:39:57 -0600 )edit

I also see quite a few problems arising with having two Puppet's managing the same host, especially if they by accident start managing the same resource.

Daenney gravatar imageDaenney ( 2013-03-14 03:40:40 -0600 )edit

I run puppet in daemon mode as I need monitor a config file NOT be changed accidently. However, I don't want to "hard code" this configuration into site.pp ...(more)

Casel Chen gravatar imageCasel Chen ( 2013-03-14 10:16:51 -0600 )edit

The question is only one ENC cannot support my above requirements, so I have to use two ENCs in two puppet master, one ENC for daemon tasks, the other ENC ...(more)

Casel Chen gravatar imageCasel Chen ( 2013-03-14 10:17:16 -0600 )edit

answered 2013-03-20 03:49:50 -0600

Steven Lu gravatar image

Hi Daenny, please take a look at example below

Current requirement is that node configuration is not pre-defined, it's saved/updated by upstream component which will put into one centralized repository(simply Oracle database).
ENC service has the knowledge to analyze/parse yaml output based on hostname.

1.Workflow of One-Time Mode:

MCollective -> Trigger Puppet Agent Run -> Send request to Puppet Master -> Fetch yaml through configured ENC service -> Send back catalogs to Puppet Agent -> Actually Puppet Agent run

2.Workflow of Daemon Mode:

Puppet Agent Run at Interval(default every 30 minutes) -> Send request to Puppet Master -> Fetch yaml ... (more)

edit flag offensive delete link more


Yup, you're right. The ENC's work based of hostname and there's no way to distinguish on the Puppet master through 'which' agent the ENC is being called ...(more)

Daenney gravatar imageDaenney ( 2013-03-20 10:17:55 -0600 )edit

Hi Daenny, thanks for your quick reply, seems we're on the same page. I ask google also, the issue is that ENC can only accept one argument (host name ...(more)

Steven Lu gravatar imageSteven Lu ( 2013-03-20 20:35:25 -0600 )edit

what's the best practice to support both one-time and daemon run in puppet agent simultaneously? I suspect my initial requirement is not valid:(

Steven Lu gravatar imageSteven Lu ( 2013-03-20 20:44:40 -0600 )edit

one-time and daemon can run side by side, it doesn't matter. As long as the daemon is 'sleeping' you can kick off one-time runs as many times as you like.

Daenney gravatar imageDaenney ( 2013-04-03 15:06:10 -0600 )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


Asked: 2013-03-13 09:49:16 -0600

Seen: 1,370 times

Last updated: Mar 20 '13