Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds NG states to php-formula #14

Merged
merged 12 commits into from Jun 8, 2014
Merged

Conversation

cheuschober
Copy link
Contributor

This rather big pull requests adds NG states to the php formula much in the same way we did with NGINX. It does require the helium release (or an updated pillar module) in order to take advantage of salt.modules.pillar.get(merge=True).

@@ -0,0 +1,2 @@
{% set state = 'adodb' %}
{% include "php/ng/installed.jinja" %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love cheating like this. We only have to write the installation state once and the {{ state }} variable does the rest of the work for us. It's not dissimilar from doing it with a macro (also used) but arguably simpler.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever Jinja trick. Interesting pattern. Not sure I'm a fan though I definitely see the appeal. Will give this some thought.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely understand any hesitation. A macro is more explicit, even if it's several lines longer. If there's a negative reaction, I could always rewrite it as a macro. Jinja imports are obviously good for the pattern, includes, however, hadn't really been tried/discussed. Thought I'd give them a look. All-said, this particular set of states are so bare-bones it makes me wish I had some type of state-router with a single real state. As it is, though, the benefits do not likely get anywhere near the costs.

whiteinge added a commit that referenced this pull request Jun 8, 2014
Adds NG states to php-formula
@whiteinge whiteinge merged commit feb3c03 into saltstack-formulas:master Jun 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants