-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Require a relative sls file #10838
Comments
Thanks for the request! Since we have relative includes, we should definitely be able to require that same relative include. |
I think this one can be closed as a duplicate of #14497 |
Thanks, done. |
I think you may be right, thanks @mbrgm |
This is intended to resolve saltstack#10838
I've recently run into this problem. Big +1 to supporting relative requires for sls files. |
As a workaround one can use
|
@mallniya your workaround of using |
* `tpldot` is the equivalent of `tpldir` but using `.` instead of `/`: - https://github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py#L120 - https://github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py#L145 * Implementation based on upstream issue: - saltstack/salt#10838 (comment)
* `tpldot` is the equivalent of `tpldir` but using `.` instead of `/`: - https://github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py#L120 - https://github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py#L145 * Implementation based on upstream issue: - saltstack/salt#10838 (comment)
Working on making SaltStack Formulas portable, find the need for a common point of reference. Comparing the import of `map.jinja` with and without context: | `tpldata` | without context | with context | |-----------|--------------------|--------------------------| | `tplfile` | template/map.jinja | template/pkg/install.sls | | `tpldir` | template | template/pkg | | `tpldot` | template | template.pkg | | `tplroot` | template | template | With `tplroot`, it is possible to use a single point of reference for all paths, avoiding the various incantations currently used, such as: * `from tpldir ~ "/map.jinja" import ...` * `from salt.file.dirname(tpldir) ~ "/map.jinja" import ...` * `from salt['file.dirname'](tpldir) ~ "/map.jinja" import ...` In all of the above circumstances, this simply becomes: * `from tplroot ~ "/map.jinja" import ...` Additional benefits are gained when referencing by colon `:` for pillars or by period `.` for `include` statements or for any requisites. Related issues: saltstack#10838, saltstack#41195.
* `tpldot` is the equivalent of `tpldir` but using `.` instead of `/`: - https://github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py#L120 - https://github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py#L145 * Implementation based on upstream issue: - saltstack/salt#10838 (comment)
* `tpldot` is the equivalent of `tpldir` but using `.` instead of `/`: - https://github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py#L120 - https://github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py#L145 * Implementation based on upstream issue: - saltstack/salt#10838 (comment)
# [1.0.0](v0.7.6...v1.0.0) (2019-02-28) ### Code Refactoring * **components:** split components into separate subdirs ([d957055](d957055)), closes [/github.com//pull/48#pullrequestreview-207182085](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/pullrequestreview-207182085) [/github.com//pull/48#discussion_r259805312](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259805312) * **include+require:** use variable for duplicate values ([4443518](4443518)) * **pkg:** change to `package` instead ([2cd82e5](2cd82e5)), closes [/github.com//pull/48#discussion_r259951123](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259951123) * **pkg:** move `pkg` related components into separate directory ([c21f82b](c21f82b)) * **states:** set state IDs based on a dependable structure ([6690ee6](6690ee6)), closes [/github.com//pull/48#discussion_r259953473](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259953473) [/github.com//pull/48#discussion_r259956996](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259956996) * **topdir:** use for `include` and `require` except `init.sls` ([a218e91](a218e91)) * **tpldir:** use `topdir` globally in place of `tpldir` ([2838bc9](2838bc9)) * **tplroot:** use `tplroot` instead of `topdir` to match `tpldata` ([b7356b0](b7356b0)) ### Continuous Integration * **kitchen:** specify `image` explicitly for each platform ([b25fbdc](b25fbdc)) * **kitchen+travis:** use `debian:jessie-backports` as `debian-8` ([1b9d249](1b9d249)), closes [#50](#50) [/github.com/vmware-archive/salt-pack/issues/657#issuecomment-467932962](https://github.com//github.com/saltstack/salt-pack/issues/657/issues/issuecomment-467932962) ### Documentation * **components:** update for separation of `pkg`, `config` & `service` ([726fcab](726fcab)) * **readme:** add suggested improvement to `template.service.clean` ([bf1039c](bf1039c)) * **readme:** fix typos ([007159a](007159a)) ### Features * **pkg:** add `clean` states ([422c7ac](422c7ac)) * **pkg:** use `require` requisite between `pkg` states ([6e7141b](6e7141b)), closes [/github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py#L120](https://github.com//github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py/issues/L120) [/github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py#L145](https://github.com//github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py/issues/L145) [/github.com/saltstack/salt/issues/10838#issuecomment-391718086](https://github.com//github.com/saltstack/salt/issues/10838/issues/issuecomment-391718086) ### Reverts * **kitchen+travis:** disable `debian-8` due to `2019.2` bug ([e8f0f7e](e8f0f7e)) ### BREAKING CHANGES * **states:** Wholesale state ID changes will break implementations that are relying on the previous state IDs for requisite purposes. * **pkg:** Changing the `pkg` directory to `package` will break implementations that are depending on `pkg` for `include` or `sls`-based requisite purposes.
# [1.0.0](v0.2.0...v1.0.0) (2019-02-28) ### Bug Fixes * **pillar:** fix `os_family` typo ([3f89c12](3f89c12)) * **tofs:** update comments in `files_switch` macro for new method ([3fa3640](3fa3640)) * **tofs:** use `tpldir` derivative `topdir` for pillar (config) paths ([5e9df00](5e9df00)) ### Code Refactoring * **components:** split components into separate subdirs ([d957055](d957055)), closes [/github.com/saltstack-formulas/pull/48#pullrequestreview-207182085](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/pullrequestreview-207182085) [/github.com/saltstack-formulas/pull/48#discussion_r259805312](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259805312) * **include+require:** use variable for duplicate values ([4443518](4443518)) * **kitchen:** prefer `kitchen.yml` to `.kitchen.yml` ([3860bf9](3860bf9)) * **macros:** use `tplroot` instead of `topdir` to match `tpldata` ([923b459](923b459)) * **pkg:** change to `package` instead ([2cd82e5](2cd82e5)), closes [/github.com/saltstack-formulas/pull/48#discussion_r259951123](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259951123) * **pkg:** move `pkg` related components into separate directory ([c21f82b](c21f82b)) * **states:** set state IDs based on a dependable structure ([6690ee6](6690ee6)), closes [/github.com/saltstack-formulas/pull/48#discussion_r259953473](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259953473) [/github.com/saltstack-formulas/pull/48#discussion_r259956996](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259956996) * **topdir:** use for `include` and `require` except `init.sls` ([a218e91](a218e91)) * **tpldir:** use `topdir` globally in place of `tpldir` ([2838bc9](2838bc9)) * **tpldir:** use `tpldir` or derivatives to make formula portable ([52d03d8](52d03d8)), closes [saltstack-formulas#22](https://github.com/myii/template-formula/issues/22) * **tplroot:** use `tplroot` instead of `topdir` to match `tpldata` ([b7356b0](b7356b0)) ### Continuous Integration * **kitchen:** check for repos updates before trying package installation ([b632383](b632383)) * **kitchen:** improve comments about `opensuse` problems encountered ([c246939](c246939)) * **kitchen:** specify `image` explicitly for each platform ([b25fbdc](b25fbdc)) * **kitchen:** use `salt-minion` version of `opensuse` to ensure tests run ([99b073a](99b073a)) * **kitchen+travis:** disable `debian-8` due to `2019.2` installation bug ([178c710](178c710)) * **kitchen+travis:** use `debian:jessie-backports` as `debian-8` ([1b9d249](1b9d249)), closes [saltstack-formulas#50](https://github.com/myii/template-formula/issues/50) [/github.com/vmware-archive/salt-pack/issues/657#issuecomment-467932962](https://github.com//github.com/saltstack/salt-pack/issues/657/issues/issuecomment-467932962) * **travis:** include `commitlint` stage ([6659a69](6659a69)) * **travis:** prevent `release` stage running for PRs ([3a072c7](3a072c7)), closes [/travis-ci.com/saltstack-formulas/template-formula/jobs/180068519#L466](https://github.com//travis-ci.com/saltstack-formulas/template-formula/jobs/180068519/issues/L466) [/github.com/saltstack-formulas/pull/42#issuecomment-466446324](https://github.com//github.com/saltstack-formulas/template-formula/pull/42/issues/issuecomment-466446324) * **travis:** remove obsolete check based on `$TRAVIS_TEST_RESULT` ([6df9c95](6df9c95)) ### Documentation * **changelog:** add missing entry under `v0.3.2` ([50352b5](50352b5)) * **changelog:** merge previous `rst` into new `md` format ([2b4e485](2b4e485)) * **changelog:** remove erroneous "closes" used by `semantic-release` ([be4571d](be4571d)) * **components:** update for separation of `pkg`, `config` & `service` ([726fcab](726fcab)) * **contributing:** add basic introductory text before the TOC ([45ccaf6](45ccaf6)) * **contributing:** add commit message formatting instructions ([fb3d173](fb3d173)) * **contributing:** centre-align version bump columns in table ([a238cae](a238cae)) * **contributing:** create blank template ([3633e8f](3633e8f)) * **contributing:** modify quoted heading to prevent TOC inclusion ([abcb6ef](abcb6ef)) * **contributing:** separate `BREAKING CHANGE` under its own heading ([ee053d7](ee053d7)) * **contributing:** update with sub-headings and `commitlint` details ([ea2c9a4](ea2c9a4)) * **index:** use include for `README.rst` in `docs` and test RTD ([f073d36](f073d36)) * **readme:** add suggested improvement to `template.service.clean` ([bf1039c](bf1039c)) * **readme:** convert note into a heading ([5f2d789](5f2d789)) * **readme:** fix typos ([007159a](007159a)) * **rtd:** conduct further tests ([0e29290](0e29290)) * **tofs:** add more sub-headings to ease document navigation ([2c5dc21](2c5dc21)) * **tofs:** apply language formatting to source code blocks ([0638413](0638413)) * **tofs:** explain how all parts of the `source` can be customised ([2f82eb5](2f82eb5)), closes [saltstack-formulas#44](https://github.com/myii/template-formula/issues/44) * **tofs:** improve general use of language ([5105d29](5105d29)) * **tofs:** update the `files_switch` section for the updated macro ([788f732](788f732)) * **tofs:** use `{%-` for all Jinja statements ([4348df8](4348df8)) * **yaml:** os*.yaml map files needs at least an empty dict ([dd99750](dd99750)) ### Features * **authors:** update automatically alongside `semantic-release` ([8000098](8000098)) * **kitchen+travis:** add `opensuse-leap` after resolving issues ([7614a3c](7614a3c)) * **kitchen+travis:** conduct tests on a wider range of platforms ([1348078](1348078)) * **pkg:** add `clean` states ([422c7ac](422c7ac)) * **pkg:** use `require` requisite between `pkg` states ([6e7141b](6e7141b)), closes [/github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py#L120](https://github.com//github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py/issues/L120) [/github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py#L145](https://github.com//github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py/issues/L145) [/github.com/saltstack/salt/issues/10838#issuecomment-391718086](https://github.com//github.com/saltstack/salt/issues/10838/issues/issuecomment-391718086) * **semantic-release:** configure for this formula ([cbcfd75](cbcfd75)) * **toc:** use `markdown-toc` directly to update inline ([a5bae1e](a5bae1e)) * **tofs:** implement backwards-compatible TOFSv2 for configurability ([068a94d](068a94d)), closes [/freenode.logbot.info/saltstack-formulas/20190214#c1995273](https://github.com//freenode.logbot.info/saltstack-formulas/20190214/issues/c1995273) [/freenode.logbot.info/saltstack-formulas/20190214#c1995487](https://github.com//freenode.logbot.info/saltstack-formulas/20190214/issues/c1995487) ### Reverts * **kitchen+travis:** disable `debian-8` due to `2019.2` bug ([e8f0f7e](e8f0f7e)) ### Tests * **inspec:** update `supports` for all platforms added ([42f93b3](42f93b3)) ### BREAKING CHANGES * **states:** Wholesale state ID changes will break implementations that are relying on the previous state IDs for requisite purposes. * **pkg:** Changing the `pkg` directory to `package` will break implementations that are depending on `pkg` for `include` or `sls`-based requisite purposes.
# [1.0.0](v0.2.0...v1.0.0) (2019-02-28) ### Bug Fixes * **pillar:** fix `os_family` typo ([3f89c12](3f89c12)) * **tofs:** update comments in `files_switch` macro for new method ([3fa3640](3fa3640)) * **tofs:** use `tpldir` derivative `topdir` for pillar (config) paths ([5e9df00](5e9df00)) ### Code Refactoring * **components:** split components into separate subdirs ([d957055](d957055)), closes [/github.com/saltstack-formulas/pull/48#pullrequestreview-207182085](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/pullrequestreview-207182085) [/github.com/saltstack-formulas/pull/48#discussion_r259805312](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259805312) * **include+require:** use variable for duplicate values ([4443518](4443518)) * **kitchen:** prefer `kitchen.yml` to `.kitchen.yml` ([3860bf9](3860bf9)) * **macros:** use `tplroot` instead of `topdir` to match `tpldata` ([923b459](923b459)) * **pkg:** change to `package` instead ([2cd82e5](2cd82e5)), closes [/github.com/saltstack-formulas/pull/48#discussion_r259951123](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259951123) * **pkg:** move `pkg` related components into separate directory ([c21f82b](c21f82b)) * **states:** set state IDs based on a dependable structure ([6690ee6](6690ee6)), closes [/github.com/saltstack-formulas/pull/48#discussion_r259953473](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259953473) [/github.com/saltstack-formulas/pull/48#discussion_r259956996](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259956996) * **topdir:** use for `include` and `require` except `init.sls` ([a218e91](a218e91)) * **tpldir:** use `topdir` globally in place of `tpldir` ([2838bc9](2838bc9)) * **tpldir:** use `tpldir` or derivatives to make formula portable ([52d03d8](52d03d8)), closes [saltstack-formulas#22](https://github.com/myii/template-formula/issues/22) * **tplroot:** use `tplroot` instead of `topdir` to match `tpldata` ([b7356b0](b7356b0)) ### Continuous Integration * **kitchen:** check for repos updates before trying package installation ([b632383](b632383)) * **kitchen:** improve comments about `opensuse` problems encountered ([c246939](c246939)) * **kitchen:** specify `image` explicitly for each platform ([b25fbdc](b25fbdc)) * **kitchen:** use `salt-minion` version of `opensuse` to ensure tests run ([99b073a](99b073a)) * **kitchen+travis:** disable `debian-8` due to `2019.2` installation bug ([178c710](178c710)) * **kitchen+travis:** use `debian:jessie-backports` as `debian-8` ([1b9d249](1b9d249)), closes [saltstack-formulas#50](https://github.com/myii/template-formula/issues/50) [/github.com/vmware-archive/salt-pack/issues/657#issuecomment-467932962](https://github.com//github.com/saltstack/salt-pack/issues/657/issues/issuecomment-467932962) * **travis:** include `commitlint` stage ([6659a69](6659a69)) * **travis:** prevent `release` stage running for PRs ([3a072c7](3a072c7)), closes [/travis-ci.com/saltstack-formulas/template-formula/jobs/180068519#L466](https://github.com//travis-ci.com/saltstack-formulas/template-formula/jobs/180068519/issues/L466) [/github.com/saltstack-formulas/pull/42#issuecomment-466446324](https://github.com//github.com/saltstack-formulas/template-formula/pull/42/issues/issuecomment-466446324) * **travis:** remove obsolete check based on `$TRAVIS_TEST_RESULT` ([6df9c95](6df9c95)) ### Documentation * **changelog:** add missing entry under `v0.3.2` ([50352b5](50352b5)) * **changelog:** merge previous `rst` into new `md` format ([2b4e485](2b4e485)) * **changelog:** remove erroneous "closes" used by `semantic-release` ([be4571d](be4571d)) * **components:** update for separation of `pkg`, `config` & `service` ([726fcab](726fcab)) * **contributing:** add basic introductory text before the TOC ([45ccaf6](45ccaf6)) * **contributing:** add commit message formatting instructions ([fb3d173](fb3d173)) * **contributing:** centre-align version bump columns in table ([a238cae](a238cae)) * **contributing:** create blank template ([3633e8f](3633e8f)) * **contributing:** modify quoted heading to prevent TOC inclusion ([abcb6ef](abcb6ef)) * **contributing:** separate `BREAKING CHANGE` under its own heading ([ee053d7](ee053d7)) * **contributing:** update with sub-headings and `commitlint` details ([ea2c9a4](ea2c9a4)) * **index:** use include for `README.rst` in `docs` and test RTD ([f073d36](f073d36)) * **readme:** add suggested improvement to `template.service.clean` ([bf1039c](bf1039c)) * **readme:** convert note into a heading ([5f2d789](5f2d789)) * **readme:** fix typos ([007159a](007159a)) * **rtd:** conduct further tests ([c6520bf](c6520bf)) * **tofs:** add more sub-headings to ease document navigation ([2c5dc21](2c5dc21)) * **tofs:** apply language formatting to source code blocks ([0638413](0638413)) * **tofs:** explain how all parts of the `source` can be customised ([2f82eb5](2f82eb5)), closes [saltstack-formulas#44](https://github.com/myii/template-formula/issues/44) * **tofs:** improve general use of language ([5105d29](5105d29)) * **tofs:** update the `files_switch` section for the updated macro ([788f732](788f732)) * **tofs:** use `{%-` for all Jinja statements ([4348df8](4348df8)) * **yaml:** os*.yaml map files needs at least an empty dict ([dd99750](dd99750)) ### Features * **authors:** update automatically alongside `semantic-release` ([8000098](8000098)) * **kitchen+travis:** add `opensuse-leap` after resolving issues ([7614a3c](7614a3c)) * **kitchen+travis:** conduct tests on a wider range of platforms ([1348078](1348078)) * **pkg:** add `clean` states ([422c7ac](422c7ac)) * **pkg:** use `require` requisite between `pkg` states ([6e7141b](6e7141b)), closes [/github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py#L120](https://github.com//github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py/issues/L120) [/github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py#L145](https://github.com//github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py/issues/L145) [/github.com/saltstack/salt/issues/10838#issuecomment-391718086](https://github.com//github.com/saltstack/salt/issues/10838/issues/issuecomment-391718086) * **semantic-release:** configure for this formula ([cbcfd75](cbcfd75)) * **toc:** use `markdown-toc` directly to update inline ([a5bae1e](a5bae1e)) * **tofs:** implement backwards-compatible TOFSv2 for configurability ([068a94d](068a94d)), closes [/freenode.logbot.info/saltstack-formulas/20190214#c1995273](https://github.com//freenode.logbot.info/saltstack-formulas/20190214/issues/c1995273) [/freenode.logbot.info/saltstack-formulas/20190214#c1995487](https://github.com//freenode.logbot.info/saltstack-formulas/20190214/issues/c1995487) ### Reverts * **kitchen+travis:** disable `debian-8` due to `2019.2` bug ([e8f0f7e](e8f0f7e)) ### Tests * **inspec:** update `supports` for all platforms added ([42f93b3](42f93b3)) ### BREAKING CHANGES * **states:** Wholesale state ID changes will break implementations that are relying on the previous state IDs for requisite purposes. * **pkg:** Changing the `pkg` directory to `package` will break implementations that are depending on `pkg` for `include` or `sls`-based requisite purposes.
# [1.0.0](v0.2.0...v1.0.0) (2019-03-01) ### Bug Fixes * **pillar:** fix `os_family` typo ([3f89c12](3f89c12)) * **tofs:** update comments in `files_switch` macro for new method ([3fa3640](3fa3640)) * **tofs:** use `tpldir` derivative `topdir` for pillar (config) paths ([5e9df00](5e9df00)) ### Code Refactoring * **components:** split components into separate subdirs ([d957055](d957055)), closes [/github.com/saltstack-formulas/pull/48#pullrequestreview-207182085](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/pullrequestreview-207182085) [/github.com/saltstack-formulas/pull/48#discussion_r259805312](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259805312) * **include+require:** use variable for duplicate values ([4443518](4443518)) * **kitchen:** prefer `kitchen.yml` to `.kitchen.yml` ([3860bf9](3860bf9)) * **macros:** use `tplroot` instead of `topdir` to match `tpldata` ([923b459](923b459)) * **pkg:** change to `package` instead ([2cd82e5](2cd82e5)), closes [/github.com/saltstack-formulas/pull/48#discussion_r259951123](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259951123) * **pkg:** move `pkg` related components into separate directory ([c21f82b](c21f82b)) * **states:** set state IDs based on a dependable structure ([6690ee6](6690ee6)), closes [/github.com/saltstack-formulas/pull/48#discussion_r259953473](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259953473) [/github.com/saltstack-formulas/pull/48#discussion_r259956996](https://github.com//github.com/saltstack-formulas/template-formula/pull/48/issues/discussion_r259956996) * **topdir:** use for `include` and `require` except `init.sls` ([a218e91](a218e91)) * **tpldir:** use `topdir` globally in place of `tpldir` ([2838bc9](2838bc9)) * **tpldir:** use `tpldir` or derivatives to make formula portable ([52d03d8](52d03d8)), closes [saltstack-formulas#22](https://github.com/myii/template-formula/issues/22) * **tplroot:** use `tplroot` instead of `topdir` to match `tpldata` ([b7356b0](b7356b0)) ### Continuous Integration * **kitchen:** check for repos updates before trying package installation ([b632383](b632383)) * **kitchen:** improve comments about `opensuse` problems encountered ([c246939](c246939)) * **kitchen:** specify `image` explicitly for each platform ([b25fbdc](b25fbdc)) * **kitchen:** use `salt-minion` version of `opensuse` to ensure tests run ([99b073a](99b073a)) * **kitchen+travis:** disable `debian-8` due to `2019.2` installation bug ([178c710](178c710)) * **kitchen+travis:** use `debian:jessie-backports` as `debian-8` ([1b9d249](1b9d249)), closes [saltstack-formulas#50](https://github.com/myii/template-formula/issues/50) [/github.com/vmware-archive/salt-pack/issues/657#issuecomment-467932962](https://github.com//github.com/saltstack/salt-pack/issues/657/issues/issuecomment-467932962) * **travis:** include `commitlint` stage ([6659a69](6659a69)) * **travis:** prevent `release` stage running for PRs ([3a072c7](3a072c7)), closes [/travis-ci.com/saltstack-formulas/template-formula/jobs/180068519#L466](https://github.com//travis-ci.com/saltstack-formulas/template-formula/jobs/180068519/issues/L466) [/github.com/saltstack-formulas/pull/42#issuecomment-466446324](https://github.com//github.com/saltstack-formulas/template-formula/pull/42/issues/issuecomment-466446324) * **travis:** remove obsolete check based on `$TRAVIS_TEST_RESULT` ([6df9c95](6df9c95)) * **travis:** remove unavailable files from `markdown-toc` process ([3148f0d](3148f0d)) ### Documentation * **changelog:** add missing entry under `v0.3.2` ([50352b5](50352b5)) * **changelog:** merge previous `rst` into new `md` format ([2b4e485](2b4e485)) * **changelog:** remove erroneous "closes" used by `semantic-release` ([be4571d](be4571d)) * **components:** update for separation of `pkg`, `config` & `service` ([726fcab](726fcab)) * **contributing:** add basic introductory text before the TOC ([45ccaf6](45ccaf6)) * **contributing:** add commit message formatting instructions ([fb3d173](fb3d173)) * **contributing:** centre-align version bump columns in table ([a238cae](a238cae)) * **contributing:** convert to `.rst` and move to `docs` subdir ([474f318](474f318)) * **contributing:** create blank template ([3633e8f](3633e8f)) * **contributing:** format table for better layout ([25586ae](25586ae)) * **contributing:** modify quoted heading to prevent TOC inclusion ([abcb6ef](abcb6ef)) * **contributing:** separate `BREAKING CHANGE` under its own heading ([ee053d7](ee053d7)) * **contributing:** update with sub-headings and `commitlint` details ([ea2c9a4](ea2c9a4)) * **index:** add `CONTRIBUTING` to the `toctree` ([0c98e67](0c98e67)) * **readme:** add suggested improvement to `template.service.clean` ([bf1039c](bf1039c)) * **readme:** convert note into a heading ([5f2d789](5f2d789)) * **readme:** fix typos ([007159a](007159a)) * **readme:** move under `docs` subdir to access in both GitHub and RTD ([c92f674](c92f674)) * **readme:** update heading markers for consistency ([5a2bea8](5a2bea8)) * **rtd:** add basic `index.rst` to allow RTD to produce docs ([f02139f](f02139f)) * **rtd:** use `conf.py` to add custom `css` ([cb94e3b](cb94e3b)) * **rtd:** use internal link targets at the top of each `.rst` file ([da09528](da09528)) * **tofs:** add more sub-headings to ease document navigation ([2c5dc21](2c5dc21)) * **tofs:** apply language formatting to source code blocks ([0638413](0638413)) * **tofs:** explain how all parts of the `source` can be customised ([2f82eb5](2f82eb5)), closes [saltstack-formulas#44](https://github.com/myii/template-formula/issues/44) * **tofs:** improve general use of language ([5105d29](5105d29)) * **tofs:** update the `files_switch` section for the updated macro ([788f732](788f732)) * **tofs:** use `{%-` for all Jinja statements ([4348df8](4348df8)) * **yaml:** os*.yaml map files needs at least an empty dict ([dd99750](dd99750)) ### Features * **authors:** update automatically alongside `semantic-release` ([8000098](8000098)) * **kitchen+travis:** add `opensuse-leap` after resolving issues ([7614a3c](7614a3c)) * **kitchen+travis:** conduct tests on a wider range of platforms ([1348078](1348078)) * **pkg:** add `clean` states ([422c7ac](422c7ac)) * **pkg:** use `require` requisite between `pkg` states ([6e7141b](6e7141b)), closes [/github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py#L120](https://github.com//github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py/issues/L120) [/github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py#L145](https://github.com//github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py/issues/L145) [/github.com/saltstack/salt/issues/10838#issuecomment-391718086](https://github.com//github.com/saltstack/salt/issues/10838/issues/issuecomment-391718086) * **semantic-release:** configure for this formula ([cbcfd75](cbcfd75)) * **toc:** use `markdown-toc` directly to update inline ([a5bae1e](a5bae1e)) * **tofs:** implement backwards-compatible TOFSv2 for configurability ([068a94d](068a94d)), closes [/freenode.logbot.info/saltstack-formulas/20190214#c1995273](https://github.com//freenode.logbot.info/saltstack-formulas/20190214/issues/c1995273) [/freenode.logbot.info/saltstack-formulas/20190214#c1995487](https://github.com//freenode.logbot.info/saltstack-formulas/20190214/issues/c1995487) ### Reverts * **kitchen+travis:** disable `debian-8` due to `2019.2` bug ([e8f0f7e](e8f0f7e)) ### Tests * **inspec:** update `supports` for all platforms added ([42f93b3](42f93b3)) ### BREAKING CHANGES * **states:** Wholesale state ID changes will break implementations that are relying on the previous state IDs for requisite purposes. * **pkg:** Changing the `pkg` directory to `package` will break implementations that are depending on `pkg` for `include` or `sls`-based requisite purposes.
Working on making SaltStack Formulas portable, find the need for a common point of reference. Comparing the import of `map.jinja` with and without context: | `tpldata` | without context | with context | |-----------|--------------------|--------------------------| | `tplfile` | template/map.jinja | template/pkg/install.sls | | `tpldir` | template | template/pkg | | `tpldot` | template | template.pkg | | `tplroot` | template | template | With `tplroot`, it is possible to use a single point of reference for all paths, avoiding the various incantations currently used, such as: * `from tpldir ~ "/map.jinja" import ...` * `from salt.file.dirname(tpldir) ~ "/map.jinja" import ...` * `from salt['file.dirname'](tpldir) ~ "/map.jinja" import ...` In all of the above circumstances, this simply becomes: * `from tplroot ~ "/map.jinja" import ...` Additional benefits are gained when referencing by colon `:` for pillars or by period `.` for `include` statements or for any requisites. Related issues: saltstack#10838, saltstack#41195.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
@sagetherage Another issue that's been closed prematurely, reproduced here: Would you mind getting someone to confirm this and re-open it? |
Still being reproduced, this issue needs to be reopened: |
@myii apologies I didn't get back to this - does the Core team need to look into addressing this? |
Working on making SaltStack Formulas portable, find the need for a common point of reference. Comparing the import of `map.jinja` with and without context: | `tpldata` | without context | with context | |-----------|--------------------|--------------------------| | `tplfile` | template/map.jinja | template/pkg/install.sls | | `tpldir` | template | template/pkg | | `tpldot` | template | template.pkg | | `tplroot` | template | template | With `tplroot`, it is possible to use a single point of reference for all paths, avoiding the various incantations currently used, such as: * `from tpldir ~ "/map.jinja" import ...` * `from salt.file.dirname(tpldir) ~ "/map.jinja" import ...` * `from salt['file.dirname'](tpldir) ~ "/map.jinja" import ...` In all of the above circumstances, this simply becomes: * `from tplroot ~ "/map.jinja" import ...` Additional benefits are gained when referencing by colon `:` for pillars or by period `.` for `include` statements or for any requisites. Related issues: saltstack#10838, saltstack#41195.
Bump, it would be really good to see this land. |
Working on making SaltStack Formulas portable, find the need for a common point of reference. Comparing the import of `map.jinja` with and without context: | `tpldata` | without context | with context | |-----------|--------------------|--------------------------| | `tplfile` | template/map.jinja | template/pkg/install.sls | | `tpldir` | template | template/pkg | | `tpldot` | template | template.pkg | | `tplroot` | template | template | With `tplroot`, it is possible to use a single point of reference for all paths, avoiding the various incantations currently used, such as: * `from tpldir ~ "/map.jinja" import ...` * `from salt.file.dirname(tpldir) ~ "/map.jinja" import ...` * `from salt['file.dirname'](tpldir) ~ "/map.jinja" import ...` In all of the above circumstances, this simply becomes: * `from tplroot ~ "/map.jinja" import ...` Additional benefits are gained when referencing by colon `:` for pillars or by period `.` for `include` statements or for any requisites. Related issues: saltstack#10838, saltstack#41195.
@kintel Closing this due to age, the old version of Salt. |
@dmurphy18 this is still an issue. Looks like #65503 was opened and is a duplicate of this. |
@ekristen Well that is what #10838 (comment) asked to do. |
Ref. #5098
It looks like the require statement takes an absolute path to the required sls file. It would be cool if it could also support relative sls files, e.g.:
Today (0.17.5) the last require statement would have to read
sls: path.to.here.local
The text was updated successfully, but these errors were encountered: