Skip to content

Commit b7356b0

Browse files
committed
refactor(tplroot): use tplroot instead of topdir to match tpldata
* Upstream feature request PR: - saltstack/salt#51814
1 parent bf1039c commit b7356b0

File tree

7 files changed

+31
-31
lines changed

7 files changed

+31
-31
lines changed

template/config/clean.sls

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=sls
33

4-
{#- Get the `topdir` from `tpldir` #}
5-
{%- set topdir = tpldir.split('/')[0] %}
6-
{%- set sls_service_clean = topdir ~ '.service.clean' %}
7-
{%- from topdir ~ "/map.jinja" import template with context %}
8-
{%- from topdir ~ "/macros.jinja" import files_switch with context %}
4+
{#- Get the `tplroot` from `tpldir` #}
5+
{%- set tplroot = tpldir.split('/')[0] %}
6+
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
7+
{%- from tplroot ~ "/map.jinja" import template with context %}
8+
{%- from tplroot ~ "/macros.jinja" import files_switch with context %}
99
1010
include:
1111
- {{ sls_service_clean }}

template/config/file.sls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=sls
33

4-
{#- Get the `topdir` from `tpldir` #}
5-
{%- set topdir = tpldir.split('/')[0] %}
6-
{%- set sls_pkg_install = topdir ~ '.pkg.install' %}
7-
{%- from topdir ~ "/map.jinja" import template with context %}
8-
{%- from topdir ~ "/macros.jinja" import files_switch with context %}
4+
{#- Get the `tplroot` from `tpldir` #}
5+
{%- set tplroot = tpldir.split('/')[0] %}
6+
{%- set sls_pkg_install = tplroot ~ '.pkg.install' %}
7+
{%- from tplroot ~ "/map.jinja" import template with context %}
8+
{%- from tplroot ~ "/macros.jinja" import files_switch with context %}
99
1010
include:
1111
- {{ sls_pkg_install }}
@@ -15,7 +15,7 @@ template-config:
1515
- name: {{ template.config }}
1616
- source: {{ files_switch(
1717
salt['config.get'](
18-
topdir ~ ':tofs:files:template-config',
18+
tplroot ~ ':tofs:files:template-config',
1919
['example.tmpl', 'example.tmpl.jinja']
2020
)
2121
) }}

template/map.jinja

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=jinja
33

4-
{#- Get the `topdir` from `tpldir` #}
5-
{%- set topdir = tpldir.split('/')[0] %}
4+
{#- Get the `tplroot` from `tpldir` #}
5+
{%- set tplroot = tpldir.split('/')[0] %}
66
{#- Start imports as #}
7-
{%- import_yaml topdir ~ "/defaults.yaml" or {} as default_settings %}
8-
{%- import_yaml topdir ~ "/osfamilymap.yaml" or {} as osfamilymap %}
9-
{%- import_yaml topdir ~ "/osmap.yaml" or {} as osmap %}
10-
{%- import_yaml topdir ~ "/osfingermap.yaml" or {} as osfingermap %}
7+
{%- import_yaml tplroot ~ "/defaults.yaml" or {} as default_settings %}
8+
{%- import_yaml tplroot ~ "/osfamilymap.yaml" or {} as osfamilymap %}
9+
{%- import_yaml tplroot ~ "/osmap.yaml" or {} as osmap %}
10+
{%- import_yaml tplroot ~ "/osfingermap.yaml" or {} as osfingermap %}
1111

1212
{% set defaults = salt['grains.filter_by'](default_settings,
1313
default='template',

template/pkg/clean.sls

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=sls
33

4-
{#- Get the `topdir` from `tpldir` #}
5-
{%- set topdir = tpldir.split('/')[0] %}
6-
{%- set sls_config_clean = topdir ~ '.config.clean' %}
7-
{%- from topdir ~ "/map.jinja" import template with context %}
4+
{#- Get the `tplroot` from `tpldir` #}
5+
{%- set tplroot = tpldir.split('/')[0] %}
6+
{%- set sls_config_clean = tplroot ~ '.config.clean' %}
7+
{%- from tplroot ~ "/map.jinja" import template with context %}
88
99
include:
1010
- {{ sls_config_clean }}

template/pkg/install.sls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=sls
33

4-
{#- Get the `topdir` from `tpldir` #}
5-
{%- set topdir = tpldir.split('/')[0] %}
6-
{%- from topdir ~ "/map.jinja" import template with context %}
4+
{#- Get the `tplroot` from `tpldir` #}
5+
{%- set tplroot = tpldir.split('/')[0] %}
6+
{%- from tplroot ~ "/map.jinja" import template with context %}
77
88
template-pkg:
99
pkg.installed:

template/service/clean.sls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=sls
33

4-
{#- Get the `topdir` from `tpldir` #}
5-
{%- set topdir = tpldir.split('/')[0] %}
6-
{%- from topdir ~ "/map.jinja" import template with context %}
4+
{#- Get the `tplroot` from `tpldir` #}
5+
{%- set tplroot = tpldir.split('/')[0] %}
6+
{%- from tplroot ~ "/map.jinja" import template with context %}
77
88
template-service-dead:
99
service.dead:

template/service/running.sls

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=sls
33

4-
{#- Get the `topdir` from `tpldir` #}
5-
{%- set topdir = tpldir.split('/')[0] %}
6-
{%- set sls_config_file = topdir ~ '.config.file' %}
7-
{%- from topdir ~ "/map.jinja" import template with context %}
4+
{#- Get the `tplroot` from `tpldir` #}
5+
{%- set tplroot = tpldir.split('/')[0] %}
6+
{%- set sls_config_file = tplroot ~ '.config.file' %}
7+
{%- from tplroot ~ "/map.jinja" import template with context %}
88
99
include:
1010
- {{ sls_config_file }}

0 commit comments

Comments
 (0)