Catalog synchronisation

38 views
Skip to first unread message

César

unread,
Apr 30, 2015, 11:38:53 AM4/30/15
to puppet...@googlegroups.com
Hi all,

I am facing this problem now and I cannot seem to find any tips on what would be the best option, so hopefully I can get some advice here!
The scenario is the following: I want to change the IP of the Puppetmaster node and update the hosts files -no DNS at the moment- in that node and in the rest of the agents with the new IP.
If the hosts files are updated at the same time as the IP everything is fine. 

However, some times the Puppet agent catalogs might take a big longer to compile than the catalog in the Puppetmaster node, causing the following:

1- Puppet master compiles catalog for its node
2- Puppet agent in the Puppetmaster node applies the catalog with the IP change.
3- The rest of the nodes finally compile their catalogs, but the Puppetmaster node has finished applying its catalog by then.

As a consequence, the nodes cannot reach the Puppetmaster any more because their hosts file have the old IP.

The question would be: Is there some sort of synchronisation method for catalog compilation? Can I specify any kind of ordering? I know Puppet has no means to synchronise resources between nodes, so I thought this might be another option.
(I know the best answer would be "Use DNS!!!!!!!", but unfortunately that's not an option at the moment).

Thanks!
Cesar.

Jochen Häberle

unread,
Apr 30, 2015, 1:10:51 PM4/30/15
to puppet...@googlegroups.com
Hi Cesar,

I know of no way to synchronise catalog compilation.

I would try to update all nodes in a first step. When all agents are updated, I would change the IP of the puppetmaster.
If the nodes do not reconnect to the master automatically, because for example the agent stops working, I would add a cron job to the agents to keep them trying. This would require a third step to remove the cron job afterwards…

Regards
Jochen

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/0e57576b-d658-42dd-aada-b4a91f62a6e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jcbollinger

unread,
May 1, 2015, 9:12:32 AM5/1/15
to puppet...@googlegroups.com


On Thursday, April 30, 2015 at 12:10:51 PM UTC-5, Jochen Haeberle wrote:
Hi Cesar,

I know of no way to synchronise catalog compilation.



Me neither.  However, you can control which resources are managed for each node, and which properties are assigned to them.

 
I would try to update all nodes in a first step. When all agents are updated, I would change the IP of the puppetmaster.


Sounds like a plan to me.  Specifically, the nodes get updated with both their own new IP addresses and the new (not yet implemented) IP for the master.  Address lookups for the master (and for other nodes not yet updated) will return the wrong result for a time, but I can't think of any strategy with or without Puppet that could altogether avoid such a result.  Once all the agents have updated (or at least retrieved their catalogs successfully), the master updates itself.

You could orchestrate the master vs other agents timing manually, but if you are willing to rely on all agents to update successfully within a predictable window, then you could consider using Schedules to automatically control when the master's update can take place.

 
If the nodes do not reconnect to the master automatically, because for example the agent stops working, I would add a cron job to the agents to keep them trying. This would require a third step to remove the cron job afterwards…



Or if you run the agent out of cron anyway then you get that for free.  Determining what you might need to do in this area certainly requires testing; don't skip that!


John

Reply all
Reply to author
Forward
0 new messages