mirror of
https://github.com/saltstack-formulas/template-formula.git
synced 2025-04-17 10:10:28 +00:00
refactor(pkgname): reserve 'pkg' as packaging dict
BREAKING CHANGE: the parameter `pkg` is now a dictionary. References to `template.pkg` should be changed to `template.pkg.name`.
This commit is contained in:
parent
9de820d71f
commit
c6ae81cc65
8 changed files with 23 additions and 13 deletions
|
@ -12,11 +12,13 @@ template:
|
|||
# test the template formula itself. You should set these parameters to
|
||||
# examples that make sense in the contexto of the formula you're writing.
|
||||
{%- if grains.osfinger == 'CentOS-6' %}
|
||||
pkg: cronie
|
||||
pkg:
|
||||
name: cronie
|
||||
service:
|
||||
name: crond
|
||||
{%- else %}
|
||||
pkg: bash
|
||||
pkg:
|
||||
name: bash
|
||||
service:
|
||||
name: systemd-udevd
|
||||
{%- endif %}
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
# vim: ft=yaml
|
||||
---
|
||||
template:
|
||||
pkg: template
|
||||
pkg:
|
||||
name: template
|
||||
rootgroup: root
|
||||
config: '/etc/template'
|
||||
service:
|
||||
|
|
|
@ -15,20 +15,24 @@
|
|||
{%- endif %}
|
||||
|
||||
Debian:
|
||||
pkg: template-debian
|
||||
pkg:
|
||||
name: template-debian
|
||||
config: /etc/template.d/custom.conf
|
||||
|
||||
RedHat:
|
||||
pkg: template-redhat
|
||||
pkg:
|
||||
name: template-redhat
|
||||
config: /etc/template.conf
|
||||
|
||||
Suse:
|
||||
pkg: template-suse
|
||||
pkg:
|
||||
name: template-suse
|
||||
|
||||
Gentoo: {}
|
||||
|
||||
Arch:
|
||||
pkg: template-arch
|
||||
pkg:
|
||||
name: template-arch
|
||||
service:
|
||||
name: service-arch
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ Ubuntu-18.04:
|
|||
|
||||
# os: CentOS
|
||||
CentOS-6:
|
||||
pkg: template-centos-6
|
||||
pkg:
|
||||
name: template-centos-6
|
||||
config: /etc/template.d/custom-centos-6.conf
|
||||
CentOS-7: {}
|
||||
|
|
|
@ -12,14 +12,16 @@
|
|||
---
|
||||
# os_family: Debian
|
||||
Ubuntu:
|
||||
pkg: template-ubuntu
|
||||
pkg:
|
||||
name: template-ubuntu
|
||||
config: /etc/template.d/custom-ubuntu.conf
|
||||
|
||||
Raspbian: {}
|
||||
|
||||
# os_family: RedHat
|
||||
Fedora:
|
||||
pkg: template-fedora
|
||||
pkg:
|
||||
name: template-fedora
|
||||
service:
|
||||
name: service-fedora
|
||||
|
||||
|
|
|
@ -11,6 +11,6 @@ include:
|
|||
|
||||
template-package-clean-pkg-removed:
|
||||
pkg.removed:
|
||||
- name: {{ template.pkg }}
|
||||
- name: {{ template.pkg.name }}
|
||||
- require:
|
||||
- sls: {{ sls_config_clean }}
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
|
||||
template-package-install-pkg-installed:
|
||||
pkg.installed:
|
||||
- name: {{ template.pkg }}
|
||||
- name: {{ template.pkg.name }}
|
||||
|
|
|
@ -12,7 +12,7 @@ control 'Template configuration' do
|
|||
its('content') { should include '"added_in_lookup": "lookup_value"' }
|
||||
its('content') { should include '"config": "/etc/template-formula.conf"' }
|
||||
its('content') { should include '"lookup": {"added_in_lookup": "lookup_value",' }
|
||||
its('content') { should include '"pkg": "' }
|
||||
its('content') { should include '"pkg": {"name": "' }
|
||||
its('content') { should include '"service": {"name": "' }
|
||||
its('content') { should include '"tofs": {"files_switch": ["any/path/can/be/used/here", "id", "osfinger", "os", "os_family"], "source_files": {"template-config-file-file-managed": ["example.tmpl.jinja"]}' }
|
||||
its('content') { should include '"winner": "pillar"}' }
|
||||
|
|
Loading…
Add table
Reference in a new issue