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

Require a relative sls file #10838

Closed
kintel opened this issue Feb 27, 2014 · 16 comments
Closed

Require a relative sls file #10838

kintel opened this issue Feb 27, 2014 · 16 comments
Labels
Core relates to code central or existential to Salt Feature new functionality including changes to functionality and code refactors, etc.
Milestone

Comments

@kintel
Copy link

kintel commented Feb 27, 2014

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.:

include:
  - .local

somename:
  - somemodule:somefunction
      - require:
          sls: .local

Today (0.17.5) the last require statement would have to read sls: path.to.here.local

@basepi
Copy link
Contributor

basepi commented Feb 27, 2014

Thanks for the request! Since we have relative includes, we should definitely be able to require that same relative include.

@basepi basepi added the Feature label Feb 27, 2014
@basepi basepi added this to the Approved for future release milestone Feb 27, 2014
@eliasp
Copy link
Contributor

eliasp commented Dec 23, 2014

I think this one can be closed as a duplicate of #14497

@basepi
Copy link
Contributor

basepi commented Dec 23, 2014

Thanks, done.

@basepi basepi closed this as completed Dec 23, 2014
@basepi basepi added the Duplicate Duplicate of another issue or PR - will be closed label Dec 23, 2014
@mbrgm
Copy link

mbrgm commented May 21, 2015

@eliasp Are you sure about the duplicate? Isn't #14497 about a problem with a relative include instead of the need for relative require?

@basepi basepi reopened this May 26, 2015
@basepi
Copy link
Contributor

basepi commented May 26, 2015

I think you may be right, thanks @mbrgm

@rallytime rallytime added Core relates to code central or existential to Salt and removed Duplicate Duplicate of another issue or PR - will be closed labels Sep 10, 2015
blast-hardcheese added a commit to blast-hardcheese/salt that referenced this issue Apr 25, 2016
@ekristen
Copy link
Contributor

I've recently run into this problem. Big +1 to supporting relative requires for sls files.

@mallniya
Copy link

As a workaround one can use slspath variable:

somename:
  - somemodule:somefunction
      - require:
          sls: {{ slspath }}.local

@UtahDave
Copy link
Contributor

@mallniya your workaround of using {{ slspath }} works great unless the files are in the root of the salt master file roots.

myii added a commit to myii/salt that referenced this issue Feb 26, 2019
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.
saltstack-formulas-travis pushed a commit to saltstack-formulas/template-formula that referenced this issue Feb 28, 2019
# [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.
myii pushed a commit to myii/template-formula that referenced this issue Feb 28, 2019
# [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.
myii pushed a commit to myii/template-formula that referenced this issue Feb 28, 2019
# [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.
myii pushed a commit to myii/template-formula that referenced this issue Mar 1, 2019
# [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.
johnclyde pushed a commit to johnclyde/salt that referenced this issue Aug 5, 2019
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.
@stale
Copy link

stale bot commented Jan 9, 2020

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.

@stale stale bot added the stale label Jan 9, 2020
@stale stale bot closed this as completed Jan 16, 2020
@myii
Copy link
Contributor

myii commented Apr 26, 2020

@sagetherage Another issue that's been closed prematurely, reproduced here:

Would you mind getting someone to confirm this and re-open it?

@myii
Copy link
Contributor

myii commented Jun 4, 2020

Still being reproduced, this issue needs to be reopened:

@sagetherage
Copy link
Contributor

@myii apologies I didn't get back to this - does the Core team need to look into addressing this?

waynew pushed a commit to alexey-zhukovin/salt that referenced this issue Mar 9, 2021
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.
@ekristen
Copy link
Contributor

ekristen commented Jan 7, 2022

Bump, it would be really good to see this land.

Ch3LL pushed a commit to alexey-zhukovin/salt that referenced this issue Oct 6, 2022
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.
lkubb added a commit to lkubb/salt-tool-sublime-text-formula that referenced this issue Dec 11, 2022
@dmurphy18
Copy link
Contributor

@kintel Closing this due to age, the old version of Salt.
Can you retest this with the latest release of Salt (currently 3006.3) and if still an issue, please open a new issue, which will have metrics in tracking issues.

@ekristen
Copy link
Contributor

@dmurphy18 this is still an issue. Looks like #65503 was opened and is a duplicate of this.

@dmurphy18
Copy link
Contributor

dmurphy18 commented Sep 18, 2024

@ekristen Well that is what #10838 (comment) asked to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core relates to code central or existential to Salt Feature new functionality including changes to functionality and code refactors, etc.
Projects
None yet
Development

No branches or pull requests