From 36b1fbffb2f24506079e46a8155877c19f648473 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Wed, 15 Feb 2023 22:59:10 +0100 Subject: Add linting pipeline Signed-off-by: Georg Pfuetzenreuter --- .pipeline.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.pipeline.yml b/.pipeline.yml index 9450491..1c8955d 100644 --- a/.pipeline.yml +++ b/.pipeline.yml @@ -1,6 +1,17 @@ skip_clone: true pipeline: + lint: + image: registry.opensuse.org/home/crameleon/libertacasa/containers/containerfile/libertacasa/pipeline-lint:latest + secrets: [ci_netrc_username, ci_netrc_password, ci_netrc_machine] + when: + event: [push] + commands: + - git clone --single-branch -b $CI_COMMIT_BRANCH $CI_REPO_LINK ../salt-libertacasa-linting + - cd ../salt-libertacasa-linting + - find . -type f \( -name '*.yaml' -o -name '*.yml' \) -exec yamllint -f colored -s {} + + - find . -name '*.sls' -exec salt-lint --severity -x 204 {} + + check: image: registry.opensuse.org/home/crameleon/libertacasa/containers/containerfile/libertacasa/pipeline:latest secrets: [ ci_netrc_username, ci_netrc_password, ci_netrc_machine ] -- cgit v1.2.3 From cd93d792fff7bde02f75aa9d704de644be290b1a Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Wed, 15 Feb 2023 23:00:20 +0100 Subject: Address yamllint errors/warnings - remove spaces, add headers - add ignore for line-lengths in .pipeline.yml Signed-off-by: Georg Pfuetzenreuter --- .pipeline.yml | 6 ++++-- pillar/formulas.yaml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.pipeline.yml b/.pipeline.yml index 1c8955d..1c2352f 100644 --- a/.pipeline.yml +++ b/.pipeline.yml @@ -1,3 +1,5 @@ +--- +# yamllint disable rule:line-length skip_clone: true pipeline: @@ -14,7 +16,7 @@ pipeline: check: image: registry.opensuse.org/home/crameleon/libertacasa/containers/containerfile/libertacasa/pipeline:latest - secrets: [ ci_netrc_username, ci_netrc_password, ci_netrc_machine ] + secrets: [ci_netrc_username, ci_netrc_password, ci_netrc_machine] when: event: [push] commands: @@ -40,5 +42,5 @@ pipeline: event: [push] instance: woodpecker-orpheus.intranet.squirrelcube.com commands: - #- rolesyncer + # - rolesyncer - bin/rolesyncer.py diff --git a/pillar/formulas.yaml b/pillar/formulas.yaml index 89f7405..191a8e1 100644 --- a/pillar/formulas.yaml +++ b/pillar/formulas.yaml @@ -1,3 +1,4 @@ +--- - firewalld - keepalived - nginx -- cgit v1.2.3 From 18d28c3b7fed42e29eb9ff7b11b4dd1a54f8a510 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Wed, 15 Feb 2023 23:08:18 +0100 Subject: Address salt-lint errors/warnings - remove trailing whitespaces - format octal modes correctly Signed-off-by: Georg Pfuetzenreuter --- pillar/id/dericom02_rigel_lysergic_dev.sls | 2 +- pillar/id/deriweb01_rigel_lysergic_dev.sls | 4 ++-- salt/profile/matterbridge/init.sls | 2 +- salt/profile/netcup_failover/init.sls | 2 +- salt/profile/salt/master.sls | 8 ++++---- salt/profile/salt/minion.sls | 4 +++- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pillar/id/dericom02_rigel_lysergic_dev.sls b/pillar/id/dericom02_rigel_lysergic_dev.sls index 4309cf9..51a487e 100644 --- a/pillar/id/dericom02_rigel_lysergic_dev.sls +++ b/pillar/id/dericom02_rigel_lysergic_dev.sls @@ -23,7 +23,7 @@ profile: NickServNick: viaduct NickServPassword: ${'secret_matterbridge:general:accounts:irc.libertacasa:NickServPassword'} ColorNicks: 'true' - Charset: utf8 + Charset: utf8 MessageSplit: 'true' MessageQueue: 60 UseRelayMsg: 'true' diff --git a/pillar/id/deriweb01_rigel_lysergic_dev.sls b/pillar/id/deriweb01_rigel_lysergic_dev.sls index ca607ba..77b553a 100644 --- a/pillar/id/deriweb01_rigel_lysergic_dev.sls +++ b/pillar/id/deriweb01_rigel_lysergic_dev.sls @@ -412,7 +412,7 @@ nginx: - location /: - proxy_pass: http://media.takahe.rigel.lysergic.dev:8001 {{ takaheresolver }} - {#- despair.life is a second entry-point to social.liberta.casa instead of only a secondary domain in Takahe #} + {#- despair.life is a second entry-point to social.liberta.casa instead of only a secondary domain in Takahe #} - server: {{ takahe_includes() }} - server_name: despair.life @@ -436,7 +436,7 @@ nginx: - snippets/error - server_name: exhausted.life {{ takahe_gohome() }} - - location /.well-known/: + - location /.well-known/: - proxy_pass: {{ backend.takahe }} - sub_filter_types: application/xml - sub_filter: takahe.rigel.lysergic.dev:8000 exhausted.life diff --git a/salt/profile/matterbridge/init.sls b/salt/profile/matterbridge/init.sls index c90225b..264f4e1 100644 --- a/salt/profile/matterbridge/init.sls +++ b/salt/profile/matterbridge/init.sls @@ -46,7 +46,7 @@ matterbridge_{{ instance }}_mediadir: - user: matterbridge {#- to-do: implement some shared group #} - group: lighttpd - - mode: 750 + - mode: '0750' - makedirs: True {%- endif %} diff --git a/salt/profile/netcup_failover/init.sls b/salt/profile/netcup_failover/init.sls index c4d5679..f0227e0 100644 --- a/salt/profile/netcup_failover/init.sls +++ b/salt/profile/netcup_failover/init.sls @@ -5,6 +5,6 @@ include: file.managed: - user: keepalived_script - group: wheel - - mode: 750 + - mode: '0750' - template: jinja - source: salt://{{ slspath }}/files/failover.sh.j2 diff --git a/salt/profile/salt/master.sls b/salt/profile/salt/master.sls index a8dce54..f0fdc7c 100644 --- a/salt/profile/salt/master.sls +++ b/salt/profile/salt/master.sls @@ -17,7 +17,7 @@ salt_master_extension_modules_dirs: {%- endfor %} - user: root - group: salt - - mode: 0755 + - mode: '0755' salt_master_extension_modules_bins: file.managed: @@ -30,7 +30,7 @@ salt_master_extension_modules_bins: {%- endfor %} - user: root - group: salt - - mode: 0640 + - mode: '0640' - require: - file: salt_master_extension_modules_dirs @@ -72,7 +72,7 @@ salt_master_extra_packages: - requirepass {{ master_pillar['cache.redis.password'] }} - user: root - group: redis - - mode: 0640 + - mode: '0640' - require: - pkg: redis @@ -80,7 +80,7 @@ salt_master_extra_packages: file.directory: - user: redis - group: redis - - mode: 0750 + - mode: '0750' - require: - pkg: redis diff --git a/salt/profile/salt/minion.sls b/salt/profile/salt/minion.sls index 5d33845..7d2ad54 100644 --- a/salt/profile/salt/minion.sls +++ b/salt/profile/salt/minion.sls @@ -1,5 +1,7 @@ {%- set netbox_pillar = salt['pillar.get']('netbox') -%} -{%- if 'custom_fields' in netbox_pillar and netbox_pillar['custom_fields']['salt_roles'] is not none and 'salt.syndic' in netbox_pillar['custom_fields']['salt_roles'] -%} +{%- if 'custom_fields' in netbox_pillar + and netbox_pillar['custom_fields']['salt_roles'] is not none + and 'salt.syndic' in netbox_pillar['custom_fields']['salt_roles'] -%} {%- set master = salt['pillar.get']('salt:master:syndic_master') -%} {%- elif 'config_context' in netbox_pillar -%} {%- set master = netbox_pillar['config_context']['salt_master'] -%} -- cgit v1.2.3