From c21f82b8856c88a0f40cadb8681c51b300f4a8cc Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sun, 24 Feb 2019 04:37:11 +0000 Subject: [PATCH] refactor(pkg): move `pkg` related components into separate directory --- template/init.sls | 4 +--- template/{ => pkg}/config.sls | 6 +++--- template/pkg/init.sls | 7 +++++++ template/{ => pkg}/install.sls | 2 +- template/{ => pkg}/service.sls | 4 ++-- 5 files changed, 14 insertions(+), 9 deletions(-) rename template/{ => pkg}/config.sls (71%) create mode 100644 template/pkg/init.sls rename template/{ => pkg}/install.sls (54%) rename template/{ => pkg}/service.sls (59%) diff --git a/template/init.sls b/template/init.sls index 1de0f0bd..18a05595 100644 --- a/template/init.sls +++ b/template/init.sls @@ -2,6 +2,4 @@ # vim: ft=sls include: - - template.install - - template.config - - template.service + - template.pkg diff --git a/template/config.sls b/template/pkg/config.sls similarity index 71% rename from template/config.sls rename to template/pkg/config.sls index 13ad6686..0b7095bf 100644 --- a/template/config.sls +++ b/template/pkg/config.sls @@ -2,11 +2,11 @@ # vim: ft=sls {%- set topdir = tpldir.split('/')[0] %} -{%- from tpldir ~ "/map.jinja" import template with context %} -{%- from tpldir ~ "/macros.jinja" import files_switch with context %} +{%- from salt['file.dirname'](tpldir) ~ "/map.jinja" import template with context %} +{%- from salt['file.dirname'](tpldir) ~ "/macros.jinja" import files_switch with context %} include: - - template.install + - .install template-config: file.managed: diff --git a/template/pkg/init.sls b/template/pkg/init.sls new file mode 100644 index 00000000..5a3145a3 --- /dev/null +++ b/template/pkg/init.sls @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# vim: ft=sls + +include: + - .install + - .config + - .service diff --git a/template/install.sls b/template/pkg/install.sls similarity index 54% rename from template/install.sls rename to template/pkg/install.sls index bb45cc1a..a2e4eb72 100644 --- a/template/install.sls +++ b/template/pkg/install.sls @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # vim: ft=sls -{%- from tpldir ~ "/map.jinja" import template with context %} +{%- from salt['file.dirname'](tpldir) ~ "/map.jinja" import template with context %} template-pkg: pkg.installed: diff --git a/template/service.sls b/template/pkg/service.sls similarity index 59% rename from template/service.sls rename to template/pkg/service.sls index 4e4daae6..56140677 100644 --- a/template/service.sls +++ b/template/pkg/service.sls @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # vim: ft=sls -{%- from tpldir ~ "/map.jinja" import template with context %} +{%- from salt['file.dirname'](tpldir) ~ "/map.jinja" import template with context %} include: - - template.config + - .config template-name: service.running: