Weird "cannot reassign variable name on node" error when I try to use standalone

5,646 views
Skip to first unread message

doug livesey

unread,
Jul 26, 2012, 4:41:05 AM7/26/12
to puppet...@googlegroups.com
Hi -- I'm trying call apply in standalone mode on a configuration I've written.
The way I call the command is like this:
  $ puppet apply manifests/site.pp -v --modulepath modules

The directory structure is simple:
  .
  manifests/site.pp
  manifests/nodes.pp
  modules/ ...

site.pp just includes nodes.pp, and nodes.pp looks like this: https://gist.github.com/3181007

When I comment out the node declaration, it all compiles just fine, but with the node declaration, I get this error:
  Cannot reassign variable name on node ip-xx-xx-xx-xx.eu-west-1.compute.internal

Obviously, the node's name in the original doesn't have 'xx's, but a valid IP.

Can anybody advise me as to how to get this working? I've tried everything I can think of.
Thanks very much for any & all assistance,
   Doug.

jcbollinger

unread,
Jul 26, 2012, 9:17:10 AM7/26/12
to puppet...@googlegroups.com
The problem is in one of the classes declared by class 'imageserver', not in nodes.pp itself.  When you comment out the node declaration, no resource declarations remain for any node, so of course there is no error.

You didn't say anything about the classes declared by class 'imageserver', so I can't be more specific than that.  If I were to take a wild guess, however, it would be that somewhere in there you have a defined type that attempts to assign a value to a local variable $name.  The variable names "name" and "title" are reserved inside defined types; for each instance, they are pre-assigned to the resource title, and like all puppet variables, their values cannot be reassigned.


John

jcbollinger

unread,
Jul 26, 2012, 9:23:39 AM7/26/12
to puppet...@googlegroups.com


On Thursday, July 26, 2012 8:17:10 AM UTC-5, jcbollinger wrote:

Hmm.  I just realized that you are using Puppet in "apply" mode rather than "agent" mode.  The problem may simply be that puppet apply doesn't want to handle node declarations.  I don't use Puppet in "apply" mode, so I'm not sure, but node declarations don't make much sense in that context.


John

doug livesey

unread,
Jul 26, 2012, 9:43:59 AM7/26/12
to puppet...@googlegroups.com
Actually, your first answer was bang on the money -- thankyou ever so much for that!
I'm now hacking through all the rest of the errors and typos to get it all running -- it's maybe time I looked into the puppet test module!
Thanks again, that's really appreciated,
   Doug.




John

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/TXUPq24EBpkJ.

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.

Nick Fagerlund

unread,
Jul 26, 2012, 4:05:58 PM7/26/12
to puppet...@googlegroups.com


On Thursday, July 26, 2012 6:23:39 AM UTC-7, jcbollinger wrote:

Hmm.  I just realized that you are using Puppet in "apply" mode rather than "agent" mode.  The problem may simply be that puppet apply doesn't want to handle node declarations.  I don't use Puppet in "apply" mode, so I'm not sure, but node declarations don't make much sense in that context.

Nah, node declarations work great with apply mode.  The use case is a little fuzzy, but let's say you're doing a whole standalone site w/ puppet apply being run out of cron. Node definitions would mean you still get the traditional benefit of only maintaining one codebase for many heterogeneous nodes, and then you just rsync the whole /etc/puppet directory around to every node. Every node would get a bunch of extraneous code it never uses, but assuming there's no sensitive info in it, you probably don't mind.

(Apply mode can use an ENC too, come to think of it.)
Reply all
Reply to author
Forward
0 new messages