Skip to content

Commit

Permalink
feat(repo): add repo pattern so we can set distro repo during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed Sep 3, 2019
1 parent d26c4f8 commit 3c9efc7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions php/macro.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@
- file: {{ state }}
{%- endfor -%}
{% endmacro %}

{%- macro format_kwargs(kwarg) -%}
{%- filter indent(4) %}
{%- for k, v in kwarg|dictsort() %}
- {{ k }}: {{ v }}
{%- endfor %}
{%- endfilter %}
{%- endmacro %}
5 changes: 5 additions & 0 deletions php/repo/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .install
11 changes: 11 additions & 0 deletions php/repo/install.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import php with context %}
{%- from tplroot ~ "/macro.jinja" import format_kwargs with context %}
php/repo/install:
pkgrepo.managed:
{{- format_kwargs(php.repo) }}

0 comments on commit 3c9efc7

Please sign in to comment.