example42 / puppet-php

A puppet module for php. According to Example42 NextGen spec.
Other
45 stars 62 forks source link

Express (or document) dependency between PHP modules and mods #97

Closed ingomueller-net closed 8 years ago

ingomueller-net commented 9 years ago

I think that there is a dependency between modules and mods, which should either be expressed in puppet, or be document so that people express them in their manifests.

I'll explain: before being to enable for example mod "sqlite3", you need to install the module "sqlite" first:

php::module { 'sqlite': } -> php::mod { 'sqlite3': }

Once you think about it, it's logical, but it's not what I had expected. If you omit the ->, your system may or may not be set up correctly after the first run of puppet, depending on the (random) order of execution.

From the documentation, I had expected that you declare things and you're fine, I still think that that would be the ideal behavior. I am not sure how this would have to be done in puppet-php. If it is not possible, it should at least be documented.

ingomueller-net commented 9 years ago

A wild guess into the blue: php::module <| |> -> php::mod <| |>

alvagante commented 9 years ago

Uhm, forcing the dependency inside php::mod or php::module would break cases where either of those defines is missing for the managed module. php::module <| |> -> php::mod <| |> could do the job, but being very generic it may have unwanted results, such as dependency loops when the above defines are used in different classes. I'd better document this, so that users know how to deal with these defines when you use them in their local classes. Wanna submit a PR?