Skip to content

Commit

Permalink
refactor(pkg): move pkg related components into separate directory
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Feb 28, 2019
1 parent be780db commit c21f82b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
4 changes: 1 addition & 3 deletions template/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
# vim: ft=sls

include:
- template.install
- template.config
- template.service
- template.pkg
6 changes: 3 additions & 3 deletions template/config.sls → template/pkg/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions template/pkg/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .install
- .config
- .service
2 changes: 1 addition & 1 deletion template/install.sls → template/pkg/install.sls
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions template/service.sls → template/pkg/service.sls
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit c21f82b

Please sign in to comment.