very basic beginner problem

69 views
Skip to first unread message

gau...@indoaustinvestments.com

unread,
Oct 19, 2014, 9:40:54 PM10/19/14
to puppet...@googlegroups.com
I am trying to learn puppet. I have been through the learningVM and now trying to do something basic with it and am not getting anywhere.

I have setup two VMs one as puppet master and the other as an agent. I am using the open source version  3.7.1

my site.pp is:
Package {
  allow_virtual => true,
}

class test {
  file { '/root/test':
    ensure  => file,
    content => 'succeeded',
  }
}

node 'mel-integ02.xxxx.com' {
  include test
}

node 'mel-integ04.xxxx.com' {
}

node default {
}

The test file doesn't exist on mel-integ02. When I try to apply it I get the following output and the test file still doesn't exist.
# puppet apply site.pp
Notice: Compiled catalog for mel-integ04.icellos.com in environment production in 0.33 seconds
Notice: Finished catalog run in 0.01 seconds

obviously I am missing something basic but I can't figure out what it is.

thanks
Greg

Thomas Müller

unread,
Oct 20, 2014, 6:15:54 AM10/20/14
to puppet...@googlegroups.com

> my site.pp is:
...
> node 'mel-integ02.xxxx.com' {
> include test
> }
>
> node 'mel-integ04.xxxx.com' {
> }
...

>
> The test file doesn't exist on mel-integ02. When I try to apply it I get
> the following output and the test file still doesn't exist.
> # puppet apply site.pp Notice: Compiled catalog for
> mel-integ04.icellos.com in environment production in 0.33 seconds

if your posted site.pp ist correct, you only included "test" for integ02
but not for integ04.

- Thomas

jcbollinger

unread,
Oct 20, 2014, 9:33:26 AM10/20/14
to puppet...@googlegroups.com
The machine you are building a catalog for is 'mel-integ04', not 'mel-integ02'.  The node definition for the former is empty, and you do not declare any global resources (nor should you), so the catalog that is built and applied is empty.  If you really are running this on node mel-integr02 then you must have cloned the certificate of 'mel-integ04', or somehow created one de novo with the wrong certname.

Note, too, that you are running 'puppet apply', as opposed to 'puppet agent'.  You should be using the latter if you mean to explore use of the master/agent Puppet paradigm.  The 'apply' option is for when you want to distribute manifests and data to all your nodes outside the scope of Puppet, and then build catalogs locally at each machine.


John

gau...@indoaustinvestments.com

unread,
Oct 20, 2014, 8:02:36 PM10/20/14
to puppet...@googlegroups.com
mel-integ04 is the puppet master and I am running puppet apply on it.

mel-integ02 is running puppet and factor. I want to test pushing the test change from mel-integ04 to mel-integ02.

The whole setup is just for me to experiment and learn hence it is not overly logical.

So are you saying that running puppet apply site.pp shouldn't propagate changes to the agents?

Greg
 

jcbollinger

unread,
Oct 21, 2014, 9:39:46 AM10/21/14
to puppet...@googlegroups.com


On Monday, October 20, 2014 7:02:36 PM UTC-5, gau...@indoaustinvestments.com wrote:

So are you saying that running puppet apply site.pp shouldn't propagate changes to the agents?


Yes, that is exactly what I am saying.  The "puppet apply" command causes a catalog to be compiled by the machine on which it runs, for the machine on which it runs, and applies it to (only) the machine on which it runs.

To configure a different machine based on the manifests and data on your master, you run "puppet agent" on the machine you want to configure.  The master can manage itself that way, too.  The agent runs in daemon mode by default, periodically requesting a fresh catalog from the master and applying it.  The agent can also run in one-time mode, which some people leverage to launch it via an external scheduler such as cron.

If it runs as a daemon, the agent can be configured to listen for messages ("kicks") from the master, and to respond to them by initiating a catalog run.  It seems more in vogue, however, to use an external remote-control framework if you want to do that.  In particular, mcollective is typically suggested for that purpose.


John

Reply all
Reply to author
Forward
0 new messages