Skip to content

Commit

Permalink
fix(environ): remove superfluous config dict (#301)
Browse files Browse the repository at this point in the history
* fix(environ): remove superfluous config dict

* fix(jinja): corrected file.managed state
  • Loading branch information
noelmcloughlin committed Sep 8, 2021
1 parent 3abb86b commit 67ba2af
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Your changes may be overwritten.
########################################################################

{%- if config %}
{%- for line in config|unique %}
{%- if environ %}
{%- for line in environ|unique %}
{{ line }}
{%- endfor %}
{%- endif %}
3 changes: 0 additions & 3 deletions docker/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,4 @@
{%- endfor %}
{%- endif %}

{%- if 'formula' not in d %}
{%- do d.update({'formula': 'docker'}) %}
{%- endif %}
{%- set data = d %}
1 change: 0 additions & 1 deletion docker/software/config/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ include:
docker-software-config-clean:
file.absent:
- names:
- {{ d.pkg.docker.config_file }}
- {{ d.pkg.docker.environ_file }}
- {{ d.pkg.docker.daemon_config_file }}
- require:
Expand Down
4 changes: 2 additions & 2 deletions docker/software/config/environ.sls
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include:
docker-software-environ-file-managed-environ_file:
file.managed:
- name: {{ d.pkg.docker.environ_file }}
- source: {{ files_switch(['config.sh.jinja'],
- source: {{ files_switch(['environ.sh.jinja'],
lookup='docker-software-environ-file-managed-environ_file'
)
}}
Expand All @@ -28,7 +28,7 @@ docker-software-environ-file-managed-environ_file:
{%- endif %}
- template: jinja
- context:
config: {{ d.pkg.docker.environ|json }}
environ: {{ d.pkg.docker.environ|json }}
- require:
- sls: {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }}
Expand Down
35 changes: 0 additions & 35 deletions docker/software/config/file.sls

This file was deleted.

1 change: 0 additions & 1 deletion docker/software/config/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
# vim: ft=sls

include:
- .file
- .environ
- .daemon
12 changes: 6 additions & 6 deletions docker/software/service/running.sls
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
{%- if 'service' in d.pkg.docker and d.pkg.docker.service and grains.os != 'Windows' %}
{%- set sls_config_daemon = tplroot ~ '.software.config.daemon' %}
{%- set sls_config_file = tplroot ~ '.software.config.file' %}
{%- set sls_environ = tplroot ~ '.software.config.environ' %}
{%- set sls_archive = tplroot ~ '.software.archive.install' %}
{%- set sls_desktop = tplroot ~ '.software.desktop.install' %}
{%- set sls_package = tplroot ~ '.software.package.install' %}
include:
- {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }}
- {{ sls_config_file }}
- {{ sls_environ }}
- {{ sls_config_daemon }}
{%- if grains.kernel|lower == 'linux' %}
Expand All @@ -26,8 +26,8 @@ docker-software-service-running-unmasked:
- service: docker-software-service-running-docker
- require:
- sls: {{ sls_config_daemon }}
{%- if 'config' in d.pkg.docker and d.pkg.docker.config %}
- sls: {{ sls_config_file }}
{%- if 'environ' in d.pkg.docker and d.pkg.docker.environ %}
- sls: {{ sls_environ }}
{%- endif %}
{%- if d.misc.firewall %}
pkg.installed:
Expand All @@ -42,8 +42,8 @@ docker-software-service-running-docker:
- name: {{ d.pkg.docker.service.name }}
- require:
- sls: {{ sls_config_daemon }}
{%- if 'config' in d.pkg.docker and d.pkg.docker.config %}
- sls: {{ sls_config_file }}
{%- if 'environ' in d.pkg.docker and d.pkg.docker.environ %}
- sls: {{ sls_environ }}
{%- endif %}
- enable: True
- watch:
Expand Down
2 changes: 2 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ docker:

pkg:
docker:
# choice is 'archive' (default) or 'repo' (yum/apt)
use_upstream: archive # or repo
service:
name: docker
env: HTTP_PROXY=http://YOUR_PROXY_IP_ADDRESS:PROXY_PORT
Expand Down
2 changes: 1 addition & 1 deletion test/salt/pillar/package.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ docker:
pkg:
docker:
use_upstream: package
config:
environ:
# yamllint disable-line rule:line-length
- OPTIONS='-s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs --selinux-enabled'
# yamllint disable-line rule:line-length
Expand Down
2 changes: 1 addition & 1 deletion test/salt/pillar/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ docker:
pkg:
docker:
use_upstream: repo
config:
environ:
# yamllint disable-line rule:line-length
- OPTIONS='-s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs --selinux-enabled'
# yamllint disable-line rule:line-length
Expand Down

0 comments on commit 67ba2af

Please sign in to comment.