style: fix linters errors

This commit is contained in:
Eric Veiras Galisson 2019-11-20 16:22:54 +01:00 committed by Imran Iqbal
parent ad826bc23e
commit 18acd667c0
No known key found for this signature in database
GPG key ID: 6D8629439D2B7819
12 changed files with 89 additions and 37 deletions

10
.rubocop.yml Normal file
View file

@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# General overrides used across formulas in the org
Metrics/LineLength:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
Max: 88
# Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`

14
.salt-lint Normal file
View file

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
exclude_paths: []
rules: {}
skip_list:
# Using `salt-lint` for linting other files as well, such as Jinja macros/templates
- 205 # Use ".sls" as a Salt State file extension
# Skipping `207` and `208` because `210` is sufficient, at least for the time-being
# I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755`
- 207 # File modes should always be encapsulated in quotation marks
- 208 # File modes should always contain a leading zero
tags: []
verbosity: 1

View file

@ -54,17 +54,6 @@ jobs:
## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
# NOTE: Please try to select up to six instances that add some meaningful
# testing of the formula's behaviour. If possible, try to refrain from
# the classical "chosing all the instances because I want to test on
# another/all distro/s" trap: it will just add time to the testing (see
# the discussion on #121). As an example, the set chosen below covers
# the most used distros families, systemd and non-systemd and the latest
# three supported Saltstack versions with python2 and 3.
# As for `kitchen.yml`, that should still contain all of the platforms,
# to allow for comprehensive local testing
# Ref: https://github.com/saltstack-formulas/template-formula/issues/118
# Ref: https://github.com/saltstack-formulas/template-formula/issues/121
- env: INSTANCE=default-debian-10-master-py3
# - env: INSTANCE=default-ubuntu-1804-master-py3
# - env: INSTANCE=default-centos-8-master-py3
@ -115,8 +104,9 @@ jobs:
@semantic-release/git@7
deploy:
provider: 'script'
# Using deprecated `skip_cleanup` until `cleanup: false` works reliably
# cleanup: false
skip_cleanup: true
# Opt-in to `dpl v2` to complete the Travis build config validation (beta)
# * https://docs.travis-ci.com/user/build-config-validation
# Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default
edge: true
# Run `semantic-release`
script: 'npx semantic-release@15'

36
.yamllint Normal file
View file

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Extend the `default` configuration provided by `yamllint`
extends: default
# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
# 2. Any SLS files under directory `test/`, which are actually state files
# 3. Any YAML files under directory `.kitchen/`, introduced during local testing
ignore: |
node_modules/
test/**/states/**/*.sls
.kitchen/
yaml-files:
# Default settings
- '*.yaml'
- '*.yml'
- .salt-lint
- .yamllint
# SaltStack Formulas additional settings
- '*.example'
- test/**/*.sls
rules:
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
line-length:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
max: 88
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true

View file

@ -177,8 +177,6 @@ verifier:
suites:
- name: default
excludes:
- centos-6-2017-7-py2
provisioner:
state_top:
base:

View file

@ -4,4 +4,4 @@
nfs-client:
pkg.installed:
- pkgs: {{ nfs.pkgs_client|json }}
{% endif %}
{% endif %}

View file

@ -1,8 +1,9 @@
---
nfs:
mount_opts: None
mkmnt: True
persist_mount: True
persist_unmount: False
mount_opts: None
mkmnt: true
persist_mount: true
persist_unmount: false
exports_file: '/etc/exports'
export_template: 'salt://nfs/files/exports'
# for most Linux distributions:

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# vim: ft=jinja
{## Start with defaults from defaults.yaml ##}
{# Start with defaults from defaults.yaml #}
{% import_yaml 'nfs/defaults.yaml' as defaults %}
{% import_yaml 'nfs/osfamilymap.yaml' as osfamilymap %}
{% import_yaml 'nfs/osmap.yaml' as osmap %}

View file

@ -11,7 +11,7 @@ include:
{# Not every platform needs options #}
{% if 'opts' in m[1] or nfs.mount_opts %}
- opts: {{ m[1].opts|default(nfs.mount_opts) }}
{% endif %}
{% endif %}
- persist: {{ m[1].persist|default(nfs.persist_mount) }}
- mkmnt: {{ m[1].mkmnt|default(nfs.mkmnt) }}
{% endfor %}

View file

@ -1,2 +1,3 @@
---
Debian-8:
service_name: 'nfs-kernel-server'

View file

@ -4,7 +4,7 @@
nfs-server-deps:
pkg.installed:
- pkgs: {{ nfs.pkgs_server|json }}
{% endif %}
{% endif %}
nfs-exports-configure:
file.managed:
@ -16,11 +16,11 @@ nfs-exports-configure:
nfs-service:
service.running:
{% if nfs.service_name is string %}
{% if nfs.service_name is string %}
- name: {{ nfs.service_name }}
{% elif nfs.service_name is iterable %}
{% elif nfs.service_name is iterable %}
- names: {{ nfs.service_name }}
{% endif %}
{% endif %}
- enable: True
{% if grains.get('os') == 'FreeBSD' %}

View file

@ -1,14 +1,17 @@
---
nfs:
# Global settings:
mkmnt: False
mkmnt: false
mount_opts: noauto,ro
persist_unmount: True
persist_mount: False
persist_unmount: true
persist_mount: false
# Server settings
server:
exports:
/srv/homes: "hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)"
exports:
/srv/homes: >-
hostname1(rw,sync,no_subtree_check)
hostname2(ro,sync,no_subtree_check)
# FreeBSD specific:
mountd_flags: -l -S
@ -18,11 +21,10 @@ nfs:
mountpoint: "/some/path"
location: "hostname:/path"
opts: "vers=3,rsize=65535,wsize=65535"
persist: True
mkmnt: True
persist: true
mkmnt: true
unmount:
someothername:
mountpoint: "/some/other/path"
location: "hostname:/other/path"
persist: False
persist: false