Skip to content

Commit

Permalink
fix(config.sls): fix salt-lint errors
Browse files Browse the repository at this point in the history
```bash
Examining openvpn/config.sls of type state
[204] Lines should be no longer that 160 chars
openvpn/config.sls:30
{% set config_file = "{0}/openvpn_{1}.conf".format(config_dir, name) if map.multi_services and grains['os_family'] == 'FreeBSD' else "{0}/{1}.{2}".format(config_dir, name, map.conf_ext) %}

[206] Jinja variables should have spaces before and after: {{ var_name }}
openvpn/config.sls:166
      - service: openvpn_{{name}}_service

[206] Jinja variables should have spaces before and after: {{ var_name }}
openvpn/config.sls:182
      - service: openvpn_{{name}}_service

[206] Jinja variables should have spaces before and after: {{ var_name }}
openvpn/config.sls:198
      - service: openvpn_{{name}}_service

[206] Jinja variables should have spaces before and after: {{ var_name }}
openvpn/config.sls:208
    - name: {{ config_dir }}/{{ config.client_config_dir}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
openvpn/config.sls:213
      - service: openvpn_{{name}}_service

[206] Jinja variables should have spaces before and after: {{ var_name }}
openvpn/config.sls:222
    - name: {{ config_dir }}/{{ config.client_config_dir}}/{{ client }}
```
  • Loading branch information
myii committed Oct 9, 2019
1 parent edb4806 commit 1b3f7f6
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions openvpn/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ include:
{%- set config_dir = map.get(type, {}).get("conf_dir", map.conf_dir) %}
{%- endif %}
{% set config_file = "{0}/openvpn_{1}.conf".format(config_dir, name) if map.multi_services and grains['os_family'] == 'FreeBSD' else "{0}/{1}.{2}".format(config_dir, name, map.conf_ext) %}
{%- set config_file = "{0}/openvpn_{1}.conf".format(
config_dir,
name,
) if map.multi_services and grains['os_family'] == 'FreeBSD' else "{0}/{1}.{2}".format(
config_dir,
name,
map.conf_ext,
) %}
# Deploy {{ type }} {{ name }} config files
openvpn_config_{{ type }}_{{ name }}:
Expand Down Expand Up @@ -163,7 +170,7 @@ openvpn_{{ type }}_{{ name }}_status_file:
{{ _permissions(600, 'root', 0) }} # different group names on FreeBSD and Debian/Ubuntu
- watch_in:
{%- if map.multi_services %}
- service: openvpn_{{name}}_service
- service: openvpn_{{ name }}_service
{%- else %}
- service: openvpn_service
{%- endif %}
Expand All @@ -179,7 +186,7 @@ openvpn_{{ type }}_{{ name }}_log_file:
{{ _permissions(640, map.log_user) }}
- require_in:
{%- if map.multi_services %}
- service: openvpn_{{name}}_service
- service: openvpn_{{ name }}_service
{%- else %}
- service: openvpn_service
{%- endif %}
Expand All @@ -195,7 +202,7 @@ openvpn_{{ type }}_{{ name }}_log_file_append:
{{ _permissions(640, map.log_user) }}
- require_in:
{%- if map.multi_services %}
- service: openvpn_{{name}}_service
- service: openvpn_{{ name }}_service
{%- else %}
- service: openvpn_service
{%- endif %}
Expand All @@ -205,12 +212,12 @@ openvpn_{{ type }}_{{ name }}_log_file_append:
# Ensure client config dir exists
openvpn_config_{{ type }}_{{ name }}_client_config_dir:
file.directory:
- name: {{ config_dir }}/{{ config.client_config_dir}}
- name: {{ config_dir }}/{{ config.client_config_dir }}
{{ _permissions(750, 'root') }}
- makedirs: True
- watch_in:
{%- if map.multi_services %}
- service: openvpn_{{name}}_service
- service: openvpn_{{ name }}_service
{%- else %}
- service: openvpn_service
{%- endif %}
Expand All @@ -219,7 +226,7 @@ openvpn_config_{{ type }}_{{ name }}_client_config_dir:
# Client config for {{ client }}
openvpn_config_{{ type }}_{{ name }}_{{ client }}_client_config:
file.managed:
- name: {{ config_dir }}/{{ config.client_config_dir}}/{{ client }}
- name: {{ config_dir }}/{{ config.client_config_dir }}/{{ client }}
{{ _permissions(640, 'root') }}
- contents_pillar: openvpn:{{ type }}:{{ name }}:client_config:{{ client }}
- makedirs: True
Expand Down

0 comments on commit 1b3f7f6

Please sign in to comment.