"cyclic" dependencies

3 views
Skip to first unread message

Mathijs

unread,
Jun 15, 2010, 7:49:48 AM6/15/10
to Puppet Users
Hi all,

I would like to reference a resource twice, with different
configurations.
At the moment I do this:

service { "service1":
ensure => running,
enable => true,
require => Exec["some stuff"]
}

exec { "some stuff":
command => "/etc/init.d/service1 stop; do some stuff required for
service1",
unless => "find out if already ok"
}

As you can see, "some stuff" requires service1 to be stopped, so it
brings service1 down (dirty/ugly) itself.
I tried some other tricks as well (creating second service block) but
puppet is smart enough to see I'm aliasing service1 in that case.

Is there any nice way to do this?

Thanks,
Mathijs

Peter Meier

unread,
Jun 15, 2010, 1:33:44 PM6/15/10
to puppet...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> As you can see, "some stuff" requires service1 to be stopped, so it
> brings service1 down (dirty/ugly) itself.
> I tried some other tricks as well (creating second service block) but
> puppet is smart enough to see I'm aliasing service1 in that case.

This is something that puppet isn't yet capable to do so. There have
been some discussion around that at the puppetcamp, but there's no
timeline for such a feature.

Personally, I stick with the ugly exec.

cheers pete
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwXuXcACgkQbwltcAfKi38jFQCgnuc7jD3Mr2J6CHYZ17kiHUAQ
WqsAn1FqLlQYt5odkTPqMGuWYSyLp3nS
=0jTH
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages