mirror of
https://github.com/saltstack-formulas/nfs-formula.git
synced 2025-04-10 23:01:45 +00:00
style: fix linters errors
This commit is contained in:
parent
ad826bc23e
commit
18acd667c0
12 changed files with 89 additions and 37 deletions
10
.rubocop.yml
Normal file
10
.rubocop.yml
Normal 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
14
.salt-lint
Normal 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
|
18
.travis.yml
18
.travis.yml
|
@ -54,17 +54,6 @@ jobs:
|
||||||
## Define the rest of the matrix based on Kitchen testing
|
## Define the rest of the matrix based on Kitchen testing
|
||||||
# Make sure the instances listed below match up with
|
# Make sure the instances listed below match up with
|
||||||
# the `platforms` defined in `kitchen.yml`
|
# 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-debian-10-master-py3
|
||||||
# - env: INSTANCE=default-ubuntu-1804-master-py3
|
# - env: INSTANCE=default-ubuntu-1804-master-py3
|
||||||
# - env: INSTANCE=default-centos-8-master-py3
|
# - env: INSTANCE=default-centos-8-master-py3
|
||||||
|
@ -115,8 +104,9 @@ jobs:
|
||||||
@semantic-release/git@7
|
@semantic-release/git@7
|
||||||
deploy:
|
deploy:
|
||||||
provider: 'script'
|
provider: 'script'
|
||||||
# Using deprecated `skip_cleanup` until `cleanup: false` works reliably
|
# Opt-in to `dpl v2` to complete the Travis build config validation (beta)
|
||||||
# cleanup: false
|
# * https://docs.travis-ci.com/user/build-config-validation
|
||||||
skip_cleanup: true
|
# Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default
|
||||||
|
edge: true
|
||||||
# Run `semantic-release`
|
# Run `semantic-release`
|
||||||
script: 'npx semantic-release@15'
|
script: 'npx semantic-release@15'
|
||||||
|
|
36
.yamllint
Normal file
36
.yamllint
Normal 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
|
|
@ -177,8 +177,6 @@ verifier:
|
||||||
|
|
||||||
suites:
|
suites:
|
||||||
- name: default
|
- name: default
|
||||||
excludes:
|
|
||||||
- centos-6-2017-7-py2
|
|
||||||
provisioner:
|
provisioner:
|
||||||
state_top:
|
state_top:
|
||||||
base:
|
base:
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
nfs-client:
|
nfs-client:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- pkgs: {{ nfs.pkgs_client|json }}
|
- pkgs: {{ nfs.pkgs_client|json }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
---
|
||||||
nfs:
|
nfs:
|
||||||
mount_opts: None
|
mount_opts: None
|
||||||
mkmnt: True
|
mkmnt: true
|
||||||
persist_mount: True
|
persist_mount: true
|
||||||
persist_unmount: False
|
persist_unmount: false
|
||||||
exports_file: '/etc/exports'
|
exports_file: '/etc/exports'
|
||||||
export_template: 'salt://nfs/files/exports'
|
export_template: 'salt://nfs/files/exports'
|
||||||
# for most Linux distributions:
|
# for most Linux distributions:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# vim: ft=jinja
|
# 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/defaults.yaml' as defaults %}
|
||||||
{% import_yaml 'nfs/osfamilymap.yaml' as osfamilymap %}
|
{% import_yaml 'nfs/osfamilymap.yaml' as osfamilymap %}
|
||||||
{% import_yaml 'nfs/osmap.yaml' as osmap %}
|
{% import_yaml 'nfs/osmap.yaml' as osmap %}
|
||||||
|
|
|
@ -11,7 +11,7 @@ include:
|
||||||
{# Not every platform needs options #}
|
{# Not every platform needs options #}
|
||||||
{% if 'opts' in m[1] or nfs.mount_opts %}
|
{% if 'opts' in m[1] or nfs.mount_opts %}
|
||||||
- opts: {{ m[1].opts|default(nfs.mount_opts) }}
|
- opts: {{ m[1].opts|default(nfs.mount_opts) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- persist: {{ m[1].persist|default(nfs.persist_mount) }}
|
- persist: {{ m[1].persist|default(nfs.persist_mount) }}
|
||||||
- mkmnt: {{ m[1].mkmnt|default(nfs.mkmnt) }}
|
- mkmnt: {{ m[1].mkmnt|default(nfs.mkmnt) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
---
|
||||||
Debian-8:
|
Debian-8:
|
||||||
service_name: 'nfs-kernel-server'
|
service_name: 'nfs-kernel-server'
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
nfs-server-deps:
|
nfs-server-deps:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- pkgs: {{ nfs.pkgs_server|json }}
|
- pkgs: {{ nfs.pkgs_server|json }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
nfs-exports-configure:
|
nfs-exports-configure:
|
||||||
file.managed:
|
file.managed:
|
||||||
|
@ -16,11 +16,11 @@ nfs-exports-configure:
|
||||||
|
|
||||||
nfs-service:
|
nfs-service:
|
||||||
service.running:
|
service.running:
|
||||||
{% if nfs.service_name is string %}
|
{% if nfs.service_name is string %}
|
||||||
- name: {{ nfs.service_name }}
|
- name: {{ nfs.service_name }}
|
||||||
{% elif nfs.service_name is iterable %}
|
{% elif nfs.service_name is iterable %}
|
||||||
- names: {{ nfs.service_name }}
|
- names: {{ nfs.service_name }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- enable: True
|
- enable: True
|
||||||
|
|
||||||
{% if grains.get('os') == 'FreeBSD' %}
|
{% if grains.get('os') == 'FreeBSD' %}
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
|
---
|
||||||
nfs:
|
nfs:
|
||||||
# Global settings:
|
# Global settings:
|
||||||
mkmnt: False
|
mkmnt: false
|
||||||
mount_opts: noauto,ro
|
mount_opts: noauto,ro
|
||||||
persist_unmount: True
|
persist_unmount: true
|
||||||
persist_mount: False
|
persist_mount: false
|
||||||
|
|
||||||
# Server settings
|
# Server settings
|
||||||
server:
|
server:
|
||||||
exports:
|
exports:
|
||||||
/srv/homes: "hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)"
|
/srv/homes: >-
|
||||||
|
hostname1(rw,sync,no_subtree_check)
|
||||||
|
hostname2(ro,sync,no_subtree_check)
|
||||||
# FreeBSD specific:
|
# FreeBSD specific:
|
||||||
mountd_flags: -l -S
|
mountd_flags: -l -S
|
||||||
|
|
||||||
|
@ -18,11 +21,10 @@ nfs:
|
||||||
mountpoint: "/some/path"
|
mountpoint: "/some/path"
|
||||||
location: "hostname:/path"
|
location: "hostname:/path"
|
||||||
opts: "vers=3,rsize=65535,wsize=65535"
|
opts: "vers=3,rsize=65535,wsize=65535"
|
||||||
persist: True
|
persist: true
|
||||||
mkmnt: True
|
mkmnt: true
|
||||||
unmount:
|
unmount:
|
||||||
someothername:
|
someothername:
|
||||||
mountpoint: "/some/other/path"
|
mountpoint: "/some/other/path"
|
||||||
location: "hostname:/other/path"
|
location: "hostname:/other/path"
|
||||||
persist: False
|
persist: false
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue