Multi-VM / Provisioning dependencies

119 views
Skip to first unread message

Sascha Vogt

unread,
Nov 26, 2013, 4:27:23 AM11/26/13
to vagra...@googlegroups.com
Hi all,

Probably this is more a Puppet question, but I'm struggeling to find the
right search terms for Google and maybe someone here has already done
something similar.

What I want is to create a small cluster (3 VMs) in a private network
and install the software I'm currently developing on it. As provisioner
I used Puppet. Now setting up the first server is easy. The first server
creates the installation packages for the other nodes. This also works,
now comes the question:

At this point the provisioning on server 1 should pause, until server 2
and 3 are provisioned and after that server 1 should complete the setup
(basically "activating" server 2 and 3).

Is there any Vagrant or Puppet magic I'm missing which could be used for
something like that, or would I need to setup server 2 and server 3 as
Puppet slaves and server 1 as Puppet master and do not use the Vagrant
built-in provisioning for server 2 and 3?

Greetings
-Sascha-

Simon McCartney

unread,
Nov 26, 2013, 6:29:41 AM11/26/13
to vagra...@googlegroups.com
Sascha Vogt wrote:
>
> At this point the provisioning on server 1 should pause, until server 2
> and 3 are provisioned and after that server 1 should complete the setup
> (basically "activating" server 2 and 3).

That feels a little clumsy, for most environments where you need to
activate or enable a server in a registry, (eg signing puppet keys or
salt keys from a minion), it's either an explicit step, or the
siging/activating process has a development mode that is insecure, i.e.
it signs/activates anything that comes in - is ther such an option for
your activate process?

Could you fake one by leaving a shell script running that activates any
incoming registrations?

> Is there any Vagrant or Puppet magic I'm missing which could be used for
> something like that, or would I need to setup server 2 and server 3 as
> Puppet slaves and server 1 as Puppet master and do not use the Vagrant
> built-in provisioning for server 2 and 3?

Not that I know of - you can't block a puppet run at a certain point
(well, you can with an exec with crazy sleep, but then you never get as
far as provisioning your 2nd & 3rd boxes)

Would "vagrant up" followed by a "vagrant provision server1" help - so
that server1 gets a second go at completing?

Simon.

--
Simon McCartney
si...@mccartney.ie
+44 7710 836 915

signature.asc

Sascha Vogt

unread,
Nov 26, 2013, 3:36:23 PM11/26/13
to vagra...@googlegroups.com
Hi,

Am 26.11.13 12:29, schrieb Simon McCartney:
> Sascha Vogt wrote:
>>
>> At this point the provisioning on server 1 should pause, until server 2
>> and 3 are provisioned and after that server 1 should complete the setup
>> (basically "activating" server 2 and 3).
>
> That feels a little clumsy, for most environments where you need to
> activate or enable a server in a registry, (eg signing puppet keys or
> salt keys from a minion), it's either an explicit step, or the
> siging/activating process has a development mode that is insecure, i.e.
> it signs/activates anything that comes in - is ther such an option for
> your activate process?
Unfortunately not, the nodes get contacted from server 1, they have no
means to access the "inner" server. But I could open a separate SSH
session from the other servers and run the enabling remote. Thanks for
the idea ;)

> Could you fake one by leaving a shell script running that activates any
> incoming registrations?
Actually not needed, via SSH I can complete the registration remotely.

> Would "vagrant up" followed by a "vagrant provision server1" help - so
> that server1 gets a second go at completing?
Yes, that would work, but I would like to setup the whole thing with a
single vagrant up. Anyway, the SSH way should work. I'll try that tomorrow.

Greetings
-Sascha-

Trevor Roberts

unread,
Nov 28, 2013, 6:45:08 AM11/28/13
to vagra...@googlegroups.com
You may want to check out a Vagrant plugin called "oscar" written by Puppet's Adrian Thebo. It will automatically deploy a Puppet Master with host files created for your second and third VMs so that you get name resolution.

Also, it allows you to use multiple box files (i.e. CentOS and Ubuntu) in the same Vagrantfile if you want multiple OS's

Sascha Vogt

unread,
Dec 2, 2013, 5:12:01 AM12/2/13
to vagra...@googlegroups.com
Hey Trevor,

Am 28.11.2013 12:45, schrieb Trevor Roberts:
> You may want to check out a Vagrant plugin called "oscar" written by
> Puppet's Adrian Thebo. It will automatically deploy a Puppet Master
> with host files created for your second and third VMs so that you get
> name resolution.
Thanks for the hint. The plugin looks interesting. May play with it a
bit, for now I use the "slaves connect to the master via SSH and execute
the activation script" approach.

While this is not possible in a production env, in my test env I don't
have firewalls in plays, which would prevent such a thing.

Thanks everyone for the help!
Greetings
-Sascha-
Reply all
Reply to author
Forward
0 new messages