Skip to content

Commit

Permalink
fix(salt-lint): fix all errors
Browse files Browse the repository at this point in the history
```bash
varnish-formula$ git ls-files | grep '\.sls$\|\.jinja$\|\.j2$\|\.tmpl$\|\.tst$' | xargs salt-lint

[206] Jinja variables should have spaces before and after: {{ var_name }}
varnish/files/Suse/etc/default/varnish.jinja:4
VARNISHD_PARAMS="-a {{ settings.get('listen', ':6081')}} \

[206] Jinja variables should have spaces before and after: {{ var_name }}
varnish/files/default/etc/default/varnish.jinja:9
DAEMON_OPTS="-a {{ settings.get('listen', ':6081')}} \

[204] Lines should be no longer that 160 chars
varnish/ng/repo.sls:15
        - name: deb https://packagecloud.io/varnishcache/{{ varnish_settings.repo }}/{{ salt['grains.get']('os')|lower }}/ {{ salt['grains.get']('oscodename') }} main

[204] Lines should be no longer that 160 chars
varnish/ng/repo.sls:22
        - name: deb-src https://packagecloud.io/varnishcache/{{ varnish_settings.repo }}/{{ salt['grains.get']('os')|lower }}/ {{ salt['grains.get']('oscodename') }} main

[201] Trailing whitespace
varnish/ng/repo.sls:26

[204] Lines should be no longer that 160 chars
varnish/repo.sls:9
    - name: deb http://repo.varnish-cache.org/{{ salt['grains.get']('os')|lower }}/ {{ salt['grains.get']('oscodename')}} {{ varnish.repo.components | join(' ') }}

[206] Jinja variables should have spaces before and after: {{ var_name }}
varnish/repo.sls:9
    - name: deb http://repo.varnish-cache.org/{{ salt['grains.get']('os')|lower }}/ {{ salt['grains.get']('oscodename')}} {{ varnish.repo.components | join(' ') }}
```
  • Loading branch information
myii committed Nov 25, 2019
1 parent 79ed36b commit b0df59d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion varnish/files/Suse/etc/default/varnish.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Managed by saltstack.
{% set settings = salt['pillar.get']('varnish', {}) -%}

VARNISHD_PARAMS="-a {{ settings.get('listen', ':6081')}} \
VARNISHD_PARAMS="-a {{ settings.get('listen', ':6081') }} \
-T localhost:6082 \
-u varnish \
-f /etc/varnish/default.vcl \
Expand Down
2 changes: 1 addition & 1 deletion varnish/files/default/etc/default/varnish.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NFILES=131072
MEMLOCK=82000
NPROCS="unlimited"
RELOAD_VCL=1
DAEMON_OPTS="-a {{ settings.get('listen', ':6081')}} \
DAEMON_OPTS="-a {{ settings.get('listen', ':6081') }} \
-T localhost:6082 \
-f /etc/varnish/{{ settings.get('default_vcl', 'default.vcl') }} \
-S /etc/varnish/secret \
Expand Down
2 changes: 1 addition & 1 deletion varnish/ng/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ varnish.vcl.enable.{{ file_options.path }}:
file.managed:
- name: {{ file_options.path }}
- makedirs: true
- source: {{ file_options.source_path }}
- source: {{ file_options.source_path }}
- template: jinja
- require:
- pkg: varnish.install
Expand Down
14 changes: 11 additions & 3 deletions varnish/ng/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,26 @@ varnish.repo.dependencies:
varnish.repo.{{ varnish_settings.repo }}:
pkgrepo.managed:
- name: deb https://packagecloud.io/varnishcache/{{ varnish_settings.repo }}/{{ salt['grains.get']('os')|lower }}/ {{ salt['grains.get']('oscodename') }} main
- name: {{ 'deb https://packagecloud.io/varnishcache/{0}/{1}/ {2} main'.format(
varnish_settings.repo,
salt['grains.get']('os')|lower,
salt['grains.get']('oscodename'),
) }}
- file: /etc/apt/sources.list.d/{{ varnish_settings.repo }}.list
- gpgcheck: 1
- key_url: https://packagecloud.io/varnishcache/{{ varnish_settings.repo }}/gpgkey
varnish.repo.{{ varnish_settings.repo }}_src:
pkgrepo.managed:
- name: deb-src https://packagecloud.io/varnishcache/{{ varnish_settings.repo }}/{{ salt['grains.get']('os')|lower }}/ {{ salt['grains.get']('oscodename') }} main
- name: {{ 'deb-src https://packagecloud.io/varnishcache/{0}/{1}/ {2} main'.format(
varnish_settings.repo,
salt['grains.get']('os')|lower,
salt['grains.get']('oscodename'),
) }}
- file: /etc/apt/sources.list.d/{{ varnish_settings.repo }}.list
- gpgcheck: 1
- key_url: https://packagecloud.io/varnishcache/{{ varnish_settings.repo }}/gpgkey
{% elif salt['grains.get']('os_family') == 'RedHat' %}
include:
Expand Down
6 changes: 5 additions & 1 deletion varnish/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ include:
{% if salt['grains.get']('os_family') == 'Debian' -%}
varnish_repo:
pkgrepo.managed:
- name: deb http://repo.varnish-cache.org/{{ salt['grains.get']('os')|lower }}/ {{ salt['grains.get']('oscodename')}} {{ varnish.repo.components | join(' ') }}
- name: {{ 'deb http://repo.varnish-cache.org/{0}/ {1} {2}'.format(
salt['grains.get']('os')|lower,
salt['grains.get']('oscodename'),
varnish.repo.components | join(' '),
) }}
- file: /etc/apt/sources.list.d/varnish.list
- keyid: C4DEFFEB
- keyserver: keyserver.ubuntu.com
Expand Down

0 comments on commit b0df59d

Please sign in to comment.