Skip to content

Commit 4355ac6

Browse files
committed
feat(yamllint): include for this repo and apply rules throughout
* Semi-automated using `ssf-formula` (v0.5.0) * Fix errors shown below: ```bash openvpn-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:") ./openvpn/osfamilymap.yaml 1:1 warning missing document start "---" (document-start) 15:19 warning truthy value should be one of [false, true] (truthy) 17:16 warning truthy value should be one of [false, true] (truthy) 18:17 warning truthy value should be one of [false, true] (truthy) ./openvpn/defaults.yaml 1:1 warning missing document start "---" (document-start) 5:13 warning truthy value should be one of [false, true] (truthy) 6:26 warning truthy value should be one of [false, true] (truthy) 12:19 warning truthy value should be one of [false, true] (truthy) ./openvpn/osmap.yaml 1:1 warning missing document start "---" (document-start) ./openvpn/osfingermap.yaml 1:1 warning missing document start "---" (document-start) pillar.example 8:89 error line too long (108 > 88 characters) (line-length) 9:89 error line too long (103 > 88 characters) (line-length) 13:89 error line too long (118 > 88 characters) (line-length) 15:89 error line too long (101 > 88 characters) (line-length) 16:89 error line too long (106 > 88 characters) (line-length) 19:89 error line too long (125 > 88 characters) (line-length) 22:89 error line too long (114 > 88 characters) (line-length) 23:89 error line too long (114 > 88 characters) (line-length) 24:89 error line too long (106 > 88 characters) (line-length) 26:2 warning missing starting space in comment (comments) 32:2 warning missing starting space in comment (comments) 40:1 warning missing document start "---" (document-start) 46:18 warning truthy value should be one of [false, true] (truthy) 50:19 warning truthy value should be one of [false, true] (truthy) 54:6 warning missing starting space in comment (comments) 56:1 error duplication of key "openvpn" in mapping (key-duplicates) 103:8 warning missing starting space in comment (comments) 117:25 warning truthy value should be one of [false, true] (truthy) 118:21 warning truthy value should be one of [false, true] (truthy) 136:89 error line too long (255 > 88 characters) (line-length) 165:8 warning missing starting space in comment (comments) 167:8 warning missing starting space in comment (comments) 214:2 error syntax error: found character '%' that cannot start any token 253:89 error line too long (255 > 88 characters) (line-length) 291:32 error trailing spaces (trailing-spaces) test/integration/repositories/pillars.sls 1:1 warning missing document start "---" (document-start) 5:18 warning truthy value should be one of [false, true] (truthy) 6:19 warning truthy value should be one of [false, true] (truthy) 7:28 warning truthy value should be one of [false, true] (truthy) 52:13 warning truthy value should be one of [false, true] (truthy) 53:19 warning truthy value should be one of [false, true] (truthy) 54:15 warning truthy value should be one of [false, true] (truthy) 81:1 error too many blank lines (1 > 0) (empty-lines) ```
1 parent a62f318 commit 4355ac6

File tree

9 files changed

+101
-55
lines changed

9 files changed

+101
-55
lines changed

.travis.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---
44
stages:
55
- test
6-
- commitlint
6+
- lint
77
- name: release
88
if: branch = master AND type != pull_request
99

@@ -46,16 +46,21 @@ script:
4646

4747
jobs:
4848
include:
49-
# Define the commitlint stage
50-
- stage: commitlint
49+
# Define the `lint` stage (runs `yamllint` and `commitlint`)
50+
- stage: lint
5151
language: node_js
5252
node_js: lts/*
5353
before_install: skip
5454
script:
55+
# Install and run `yamllint`
56+
- pip install --user yamllint
57+
# yamllint disable-line rule:line-length
58+
- yamllint -s . .yamllint pillar.example test/integration/repositories/pillars.sls
59+
# Install and run `commitlint`
5560
- npm install @commitlint/config-conventional -D
5661
- npm install @commitlint/travis-cli -D
5762
- commitlint-travis
58-
# Define the release stage that runs semantic-release
63+
# Define the release stage that runs `semantic-release`
5964
- stage: release
6065
language: node_js
6166
node_js: lts/*

.yamllint

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
4+
# Extend the `default` configuration provided by `yamllint`
5+
extends: default
6+
7+
# Files to ignore completely
8+
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
9+
ignore: |
10+
node_modules/
11+
12+
rules:
13+
line-length:
14+
# Increase from default of `80`
15+
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
16+
max: 88

openvpn/defaults.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
openvpn:
25
conf_dir: /etc/openvpn
36
conf_ext: conf
47
dh_files: ['2048', '4096']
5-
dsaparam: False
6-
external_repo_enabled: False
8+
dsaparam: false
9+
external_repo_enabled: false
710
external_repo_supported: []
811
external_repo_version: stable
912
group: nobody
1013
# None, will default to 'user'
1114
log_user:
12-
multi_services: False
15+
multi_services: false
1316
pkgs: ['openvpn']
1417
service: openvpn
1518
service_function: running

openvpn/osfamilymap.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
Arch:
25
pkgs:
36
- openvpn
@@ -12,10 +15,10 @@ RedHat:
1215
FreeBSD:
1316
conf_dir: /usr/local/etc/openvpn
1417
group: openvpn
15-
multi_services: True
18+
multi_services: true
1619
user: openvpn
17-
manage_user: False
18-
manage_group: False
20+
manage_user: false
21+
manage_group: false
1922
Windows:
2023
conf_dir: C:\Program Files\OpenVPN\config
2124
conf_ext: ovpn

openvpn/osfingermap.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
CentOS-6:
25
multi_services: false

openvpn/osmap.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
Debian:
25
external_repo_supported:
36
- wheezy

pillar.example

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
# See https://openvpn.net/index.php/open-source/documentation/howto.html#examples
25
# for configuration details
36
# Important: Replace all '-' in names on left side with '_'!
47

58
# Defaults can be overwritten, see openvpn/map.jinja for default values
69
# openvpn:
710
# lookup:
8-
# dh_files: ['4096'] # This creates a dh file with 4096 bits (which will take a long time).
9-
# dh_files: ['2048'] # This creates a dh file with 2048 bits (which should be enough.)
10-
# # Default: ['2048', '4096']
11-
# # (It creates both variants.)
11+
# # This creates a dh file with 4096 bits (which will take a long time).
12+
# dh_files: ['4096']
13+
# # This creates a dh file with 2048 bits (which should be enough.)
14+
# # Default: ['2048', '4096']
15+
# # (It creates both variants.)
16+
# dh_files: ['2048']
1217
#
13-
# dsaparam: False # Set this to True if you want to use the -dsaparam flag in DH param generation.
14-
# # See also:
15-
# # https://github.com/saltstack-formulas/openvpn-formula/pull/77
16-
# # https://security.stackexchange.com/questions/42415/openvpn-dhparam
18+
# # Set this to true if you want to use the -dsaparam flag in DH param generation.
19+
# # See also:
20+
# # https://github.com/saltstack-formulas/openvpn-formula/pull/77
21+
# # https://security.stackexchange.com/questions/42415/openvpn-dhparam
22+
# dsaparam: false
1723
#
18-
# external_repo_enabled: True # This will use the OpenVPN repository documented
19-
# # at the following URL: https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos
20-
# # Only valid for Debian OS family
24+
# # This will use the OpenVPN repository documented
25+
# # at the following URL:
26+
# # https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos
27+
# # Only valid for Debian OS family
28+
# external_repo_enabled: true
2129
#
22-
# external_repo_version: testing # The version to use for OpenVPN if 'external_repo_enabled' is set to 'True'
23-
# # Info here: https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos
24-
# # Valid options: stable (default), testing, release/2.3, release/2.4
30+
# # The version to use for OpenVPN if 'external_repo_enabled' is set to 'true'
31+
# # Info here: https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos
32+
# # Valid options: stable (default), testing, release/2.3, release/2.4
33+
# external_repo_version: testing
2534

26-
#See also the example used in tests: test/integration/repositories/pillars.sls
35+
# See also the example used in tests: test/integration/repositories/pillars.sls
2736

2837
##
2938
# OpenVPN user and group
3039
#
3140
# For historic reasons these are the default values:
32-
#openvpn:
41+
# openvpn:
3342
# lookup:
3443
# user: nobody
3544
# group: nobody # nogroup on Debian
@@ -43,17 +52,16 @@ openvpn:
4352
group: openvpn
4453
# When the user is not 'nobody', it will be managed by this formula.
4554
# You can suppress this by: (Default on FreeBSD)
46-
manage_user: False
55+
manage_user: false
4756
# When the group is neither 'nobody' nor 'nogroup',
4857
# it will be managed by this formula.
4958
# You can suppress this by: (Default on FreeBSD)
50-
manage_group: False
59+
manage_group: false
5160

5261
# If you want to control the openvpn services via other tools,
5362
# you want to 'disabled' it in your system. Default: running
54-
#service_function: disabled
63+
# service_function: disabled
5564

56-
openvpn:
5765
server:
5866
myserver1:
5967
ca: /path/to/mycacert.pem
@@ -100,7 +108,7 @@ openvpn:
100108
# tl;dr: The bigger, the better.
101109
dh: dh4096.pem
102110
# for faster DP params generation use only ['2048'] in openvpn:lookup:dh_files
103-
#dh: dh2048.pem
111+
# dh: dh2048.pem
104112
server: '10.8.0.0 255.255.255.0'
105113
ifconfig_pool_persist: ipp.txt
106114
server_bridge:
@@ -114,8 +122,8 @@ openvpn:
114122
client1: |
115123
iroute 192.168.10.0 255.255.255.0
116124
learn_address:
117-
client_to_client: False
118-
duplicate_cn: False
125+
client_to_client: false
126+
duplicate_cn: false
119127
keepalive: '10 120'
120128
# `tls-auth` and `tls-crypt` are mutually exclusive
121129
# and `tls-crypt` is only valid for OpenVPN 2.4 and above.
@@ -133,6 +141,7 @@ openvpn:
133141
- AES-256-CBC
134142
auths:
135143
- SHA384
144+
# yamllint disable-line rule:line-length
136145
tls_cipher: 'DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-CAMELLIA256-SHA:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-RSA-AES128-SHA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA'
137146
comp_lzo:
138147
max_clients: 100
@@ -162,9 +171,9 @@ openvpn:
162171
ifconfig: '10.8.0.1 10.8.0.2'
163172
secret: /path/to/mysecret.key
164173
# or
165-
#secret: /path/to/mysecret.key 0
174+
# secret: /path/to/mysecret.key 0
166175
# or
167-
#secret: # use this form for paths with spaces
176+
# secret: # use this form for paths with spaces
168177
# - /path/to/mysecret.key
169178
# - 0
170179
secret_content: |
@@ -211,13 +220,11 @@ openvpn:
211220
http_proxy_retry:
212221
http_proxy: 'proxy-server proxy-port'
213222
mute_replay_warnings:
214-
{% if grains['os_family'] == 'Windows' %}
215-
dev_node: ovpn-myclient2
216-
# Take care with the quoting for Windows paths with spaces
217-
ca: '"C:\\Program Files\\OpenVPN\\config\\mycacert.pem"'
218-
{% else %}
219223
ca: /path/to/mycacert.pem
220-
{% endif %}
224+
# The following two commented options are examples for Windows
225+
# dev_node: ovpn-myclient2
226+
# Take care with the quoting for Windows paths with spaces
227+
# ca: '"C:\\Program Files\\OpenVPN\\config\\mycacert.pem"'
221228
ca_content: |
222229
-----BEGIN CERTIFICATE-----
223230
...
@@ -236,7 +243,7 @@ openvpn:
236243
askpass_content: |
237244
p4ssw0rd
238245
ns_cert_type: server
239-
#tls_auth: /path/to/tls.key 0
246+
# tls_auth: /path/to/tls.key 0
240247
# or:
241248
tls_auth: # use this form for paths with spaces
242249
- /path/to/tls.key
@@ -250,16 +257,17 @@ openvpn:
250257
- AES-256-CBC
251258
auths:
252259
- SHA384
260+
# yamllint disable-line rule:line-length
253261
tls_cipher: 'DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-CAMELLIA256-SHA:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-RSA-AES128-SHA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA'
254262
remote_cert_tls: server
255263
comp_lzo:
256264
verb: 3
257265
mute: 20
258266
up: /usr/local/bin/tunnel_up.sh
259267
down: /usr/local/bin/tunnel_down.sh
260-
up_delay: True
261-
down_pre: True
262-
up_restart: True
268+
up_delay: true
269+
down_pre: true
270+
up_restart: true
263271
_append:
264272
- script-security 2
265273
- up 'echo up'
@@ -283,12 +291,12 @@ openvpn:
283291
route:
284292
- "8.8.8.8 255.255.255.255 net_gateway"
285293
myclient3:
286-
pull: False
294+
pull: false
287295
# from the man page:
288296
# This option must be used on a client which is connecting to a
289297
# multi-client server. It indicates to OpenVPN that it should accept
290298
# options pushed by the server, provided they are part of the legal
291-
# set of pushable options
299+
# set of pushable options
292300

293301
ifconfig_pool_persist:
294302
ipp.txt:
@@ -301,7 +309,7 @@ openvpn:
301309

302310
##
303311
# Use latest OpenVPN packages (default: false)
304-
use_latest: False
312+
use_latest: false
305313

306314
# Managing clients which use NetworkManager
307315
# (Intentionally does not handle certificate/key distribution!)

test/integration/default/inspec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
name: default
25
title: openvpn formula
36
maintainer: SaltStack Formulas

test/integration/repositories/pillars.sls

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
openvpn:
25
lookup:
36
user: openvpn
47
group: openvpn
5-
manage_user: True
6-
manage_group: True
7-
external_repo_enabled: True
8+
manage_user: true
9+
manage_group: true
10+
external_repo_enabled: true
811
dh_files: ['512']
912
server:
1013
myserver1:
@@ -49,9 +52,9 @@ openvpn:
4952
topology: p2p
5053
dev: tun
5154
comp_lzo: "yes"
52-
pull: False
53-
tls_client: False
54-
nobind: False
55+
pull: false
56+
tls_client: false
57+
nobind: false
5558
ifconfig: 169.254.0.2 169.254.0.1
5659
log_append: /var/log/openvpn/myclient1.log
5760
secret: /etc/openvpn/myclient1_secret.key
@@ -78,4 +81,3 @@ openvpn:
7881
4c099bf8e74b8bf4e6509de69b7a79ad
7982
7391b6cf3f4ae296ecf8b552144a2947
8083
-----END OpenVPN Static key V1-----
81-

0 commit comments

Comments
 (0)