On Wednesday, April 2, 2014 12:12:14 PM UTC-5, Drew Raines wrote:
>
> Hello!
>
> I'm running `apply --noop` regularly. I would really like to also
> do it on a fresh machine before changing bits on the disk.
> Unfortunately this fails for Service types because their init
> scripts don't yet exist. For example, take ntp:
>
> package { "ntp":
> ensure => present,
> } ->
> service { "ntp":
> ensure => running,
> }
>
> If I run `sudo puppet apply --noop foo.pp` I get:
>
> [...]
> Error: /Stage[main]/Main/Service[ntp]: Could not evaluate:
> Could not find init script or upstart conf file for 'ntp'
>
> I get why this fails. Package["ntp"] hasn't written anything to
> disk during the dry run, so Service["ntp"] can't find the right
> pieces that it would have needed. I was hoping the
> `Package["ntp"] -> Service["ntp"]` relationship would have
> accounted for this.
>
>
Nope, sorry. Puppet running in --noop mode has no visibility into what
applying any resource -- especially a package -- *would have done*, or even
into whether applying that resource would have succeeded at all. The most
it can know is what commands it would have run, and that doesn't yield the
kind of information you hoped for. It may at times seem magical, but
Puppet is not actually a real boy.
> This thread from years ago touches on this but quickly gets into a
> semantic discussion about include/require:
> https://groups.google.com/d/msg/puppet-users/vTDoxY3OdNI/HOWeN_ZhDJ8J.
>
>
That is an orthogonal issue. Yours is specific to --noop mode, and it
would occur regardless of resource relationships.
> I'm mostly curious if I'm cutting across the grain here. I'm
> relatively new to Puppet. Is --noop not universally useful for
> dry runs? If it is, how can I work around this issue?
>
>
Nothing is "universally useful" for dry runs in the sense of accurately
predicting all the outcomes of a series of commands that modify the system,
without actually running the commands. This is what testing is for. The
only work around is to change your interpretation of the data: you should
not view your result as "Puppet fails" but as "Puppet tries to start the
service". There is also useful information there about when Puppet makes
that attempt relative to syncing other resources.
John
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/23477397-0e84-483b-ac2c-98d05174aafd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.