Another thought : Unless I chain them together…
file{} -> exec{} -> service{} what would keep the service from trying to start before the exec has run ? Would adding “ require => Exec['/sbin/ifup eth0’], “ to the service resource mess things up ? > On Jan 30, 2015, at 4:18 PM, Dan White <d_e_wh...@icloud.com> wrote: > > Thanks. > I was not trying it that way, but I believe I will. I see where my approach > was borked. > Unfortunately, it means some non-trivial refactoring. > But (and thanks a second time for an opportunity to use this line) > "It's like the chicken said, Launchpad, 'You knew the job was dangerous when > you took it' ! " > “Sometimes I think the surest sign that intelligent life exists elsewhere in > the universe is that none of it has tried to contact us.” (Bill Waterson: > Calvin & Hobbes) > > On Jan 30, 2015, at 03:37 PM, Christopher Wood <christopher_w...@pobox.com> > wrote: > >> Possibly something like this? If you've already tried this, what was the >> result? >> >> file { '/etc/sysconfig/network-scripts/ifcfg-eth0': >> # stuff here >> } >> >> exec { '/sbin/ifup eth0': >> refreshonly => true, >> subscribe => File['/etc/sysconfig/network-scripts/ifcfg-eth0'], >> notify => Service['mysql'], >> } >> >> service { 'mysql': >> # stuff >> } >> >> (Store the ip information in hiera and template your mysql.cnf as well as >> ifcfg-eth0 with the same data.) >> >> >> On Fri, Jan 30, 2015 at 07:40:38PM +0000, Dan White wrote: >>> Red Hat / CentOS 6.x with Puppet 3.7.x >>> Creating a new network interface is easy: >>> Create the /etc/sysconfig/network-scripts/ifcfg-eth(whatever) file and then >>> refresh the network service. >>> Now the problem: If I want to run something off that new interface -- like >>> a MySQL server -- how do I express the dependency to get the interface >>> running before trying to start the service to run on it ? >>> I have been unsuccessful in making it happen in a single puppet run. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/BDCDE71E-6838-4EA7-85BB-83BAC8E5B4D9%40icloud.com. For more options, visit https://groups.google.com/d/optout.