Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(naming): reserve 'pkg' as name of packaging dict #137

Merged
merged 1 commit into from
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
3 changes: 2 additions & 1 deletion template/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# vim: ft=yaml
---
template:
pkg: template
pkg:
name: template
rootgroup: root
config: '/etc/template'
service:
Expand Down
12 changes: 8 additions & 4 deletions template/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion template/osfingermap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
6 changes: 4 additions & 2 deletions template/osmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion template/package/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ include:

template-package-clean-pkg-removed:
pkg.removed:
- name: {{ template.pkg }}
- name: {{ template.pkg.name }}
- require:
- sls: {{ sls_config_clean }}
2 changes: 1 addition & 1 deletion template/package/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

template-package-install-pkg-installed:
pkg.installed:
- name: {{ template.pkg }}
- name: {{ template.pkg.name }}
2 changes: 1 addition & 1 deletion test/integration/default/controls/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
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"}' }
Expand Down