saltstack-formulas / template-formula

SaltStack formula template filled with dummy content
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
119 stars 85 forks source link

[QUESTIONS] Best practice to include other formulas? #202

Closed nikAizuddin closed 4 years ago

nikAizuddin commented 4 years ago

Hi, what is the best way to include other formulas in a formula.

For example, I want to create a podman-formula repository for Podman installation on Centos7, but requires elrepo-formula.

So, if I want to add elrepo-formula as submodule, should I put elrepo-formula into TEMPLATE/subcomponent/elrepo-formula?

myii commented 4 years ago

@nikAizuddin When we're developing formulas within this org, we tend to avoid cross-formula (hard) dependencies, since that can lead to difficulties for end users. However, if you are maintaining your own formulas, then you can achieve this by using include in your state files, such as this example:

include:
  - git
  - perl

For a really detailed example, you can look at the opensds-formula.

nikAizuddin commented 4 years ago

@myii thanks, I'll take a look at the examples.