Skip to content

Commit 2e8ded6

Browse files
committed
refactor: improve reusability using an unique keyword TEMPLATE
BREAKING CHANGE: changed all state names and ids
1 parent 341f495 commit 2e8ded6

39 files changed

+120
-120
lines changed

FORMULA

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: template
1+
name: TEMPLATE
22
os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS
33
os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS
44
version: 3.3.4
55
release: 1
66
minimum_version: 2017.7
7-
summary: template formula
7+
summary: TEMPLATE formula
88
description: Formula to use as a template for other formulas
9-
top_level_dir: template
9+
top_level_dir: TEMPLATE
File renamed without changes.

template/config/clean.sls renamed to TEMPLATE/config/clean.sls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
{#- Get the `tplroot` from `tpldir` #}
55
{%- set tplroot = tpldir.split('/')[0] %}
66
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
7-
{%- from tplroot ~ "/map.jinja" import template with context %}
7+
{%- from tplroot ~ "/map.jinja" import TEMPLATE with context %}
88
99
include:
1010
- {{ sls_service_clean }}
1111
12-
template-config-clean-file-absent:
12+
TEMPLATE-config-clean-file-absent:
1313
file.absent:
14-
- name: {{ template.config }}
14+
- name: {{ TEMPLATE.config }}
1515
- require:
1616
- sls: {{ sls_service_clean }}

template/config/file.sls renamed to TEMPLATE/config/file.sls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
{#- Get the `tplroot` from `tpldir` #}
55
{%- set tplroot = tpldir.split('/')[0] %}
66
{%- set sls_package_install = tplroot ~ '.package.install' %}
7-
{%- from tplroot ~ "/map.jinja" import template with context %}
7+
{%- from tplroot ~ "/map.jinja" import TEMPLATE with context %}
88
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
99
1010
include:
1111
- {{ sls_package_install }}
1212
13-
template-config-file-file-managed:
13+
TEMPLATE-config-file-file-managed:
1414
file.managed:
15-
- name: {{ template.config }}
15+
- name: {{ TEMPLATE.config }}
1616
- source: {{ files_switch(['example.tmpl'],
17-
lookup='template-config-file-file-managed'
17+
lookup='TEMPLATE-config-file-file-managed'
1818
)
1919
}}
2020
- mode: 644
2121
- user: root
22-
- group: {{ template.rootgroup }}
22+
- group: {{ TEMPLATE.rootgroup }}
2323
- makedirs: True
2424
- template: jinja
2525
- require:
2626
- sls: {{ sls_package_install }}
2727
- context:
28-
template: {{ template | json }}
28+
TEMPLATE: {{ TEMPLATE | json }}
File renamed without changes.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=yaml
33
---
4-
template:
4+
TEMPLATE:
55
pkg:
6-
name: template
6+
name: TEMPLATE
77
rootgroup: root
8-
config: '/etc/template'
8+
config: '/etc/TEMPLATE'
99
service:
10-
name: template
10+
name: TEMPLATE
1111
subcomponent:
12-
config: '/etc/template-subcomponent-formula.conf'
12+
config: '/etc/TEMPLATE-subcomponent-formula.conf'
1313
# Just here for testing
1414
added_in_defaults: defaults_value
1515
winner: defaults
File renamed without changes.

template/files/default/example.tmpl.jinja renamed to TEMPLATE/files/default/example.tmpl.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
This is another example file from SaltStack template-formula.
77

88
# This is here for testing purposes
9-
{{ template | json }}
9+
{{ TEMPLATE | json }}
1010

11-
winner of the merge: {{ template['winner'] }}
11+
winner of the merge: {{ TEMPLATE['winner'] }}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)