Skip to content

Commit def40ce

Browse files
Merge pull request #137 from noelmcloughlin/repo_1
refactor(naming): reserve 'pkg' as name of packaging dict
2 parents 7bd20f3 + c6ae81c commit def40ce

File tree

8 files changed

+23
-13
lines changed

8 files changed

+23
-13
lines changed

pillar.example

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ template:
1212
# test the template formula itself. You should set these parameters to
1313
# examples that make sense in the contexto of the formula you're writing.
1414
{%- if grains.osfinger == 'CentOS-6' %}
15-
pkg: cronie
15+
pkg:
16+
name: cronie
1617
service:
1718
name: crond
1819
{%- else %}
19-
pkg: bash
20+
pkg:
21+
name: bash
2022
service:
2123
name: systemd-udevd
2224
{%- endif %}

template/defaults.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# vim: ft=yaml
33
---
44
template:
5-
pkg: template
5+
pkg:
6+
name: template
67
rootgroup: root
78
config: '/etc/template'
89
service:

template/osfamilymap.yaml

+8-4
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,24 @@
1515
{%- endif %}
1616

1717
Debian:
18-
pkg: template-debian
18+
pkg:
19+
name: template-debian
1920
config: /etc/template.d/custom.conf
2021

2122
RedHat:
22-
pkg: template-redhat
23+
pkg:
24+
name: template-redhat
2325
config: /etc/template.conf
2426

2527
Suse:
26-
pkg: template-suse
28+
pkg:
29+
name: template-suse
2730

2831
Gentoo: {}
2932

3033
Arch:
31-
pkg: template-arch
34+
pkg:
35+
name: template-arch
3236
service:
3337
name: service-arch
3438

template/osfingermap.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Ubuntu-18.04:
1616

1717
# os: CentOS
1818
CentOS-6:
19-
pkg: template-centos-6
19+
pkg:
20+
name: template-centos-6
2021
config: /etc/template.d/custom-centos-6.conf
2122
CentOS-7: {}

template/osmap.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
---
1313
# os_family: Debian
1414
Ubuntu:
15-
pkg: template-ubuntu
15+
pkg:
16+
name: template-ubuntu
1617
config: /etc/template.d/custom-ubuntu.conf
1718

1819
Raspbian: {}
1920

2021
# os_family: RedHat
2122
Fedora:
22-
pkg: template-fedora
23+
pkg:
24+
name: template-fedora
2325
service:
2426
name: service-fedora
2527

template/package/clean.sls

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ include:
1111
1212
template-package-clean-pkg-removed:
1313
pkg.removed:
14-
- name: {{ template.pkg }}
14+
- name: {{ template.pkg.name }}
1515
- require:
1616
- sls: {{ sls_config_clean }}

template/package/install.sls

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
88
template-package-install-pkg-installed:
99
pkg.installed:
10-
- name: {{ template.pkg }}
10+
- name: {{ template.pkg.name }}

test/integration/default/controls/config_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
its('content') { should include '"added_in_lookup": "lookup_value"' }
1313
its('content') { should include '"config": "/etc/template-formula.conf"' }
1414
its('content') { should include '"lookup": {"added_in_lookup": "lookup_value",' }
15-
its('content') { should include '"pkg": "' }
15+
its('content') { should include '"pkg": {"name": "' }
1616
its('content') { should include '"service": {"name": "' }
1717
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"]}' }
1818
its('content') { should include '"winner": "pillar"}' }

0 commit comments

Comments
 (0)