From 24500ff0742d83f92ed30c3fe63d868441acfe4c Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Fri, 10 Jun 2022 00:13:19 +0200 Subject: [PATCH] updated states (lints) / updated .drone.yml --- .drone.yml | 4 +++- states/apparmor/init.sls | 2 +- states/apt/init.sls | 8 ++++---- states/gufw/init.sls | 6 +++--- states/maildb/init.sls | 4 ++-- states/misc/init.sls | 8 ++++---- states/netboxinventory/init.sls | 2 -- states/nextcloud_desktop/init.sls | 6 +++--- states/tor/init.sls | 2 +- states/vsftpd/init.sls | 2 +- states/youtubedl/init.sls | 2 +- states/ytdlp/init.sls | 2 +- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1041b7f..f90781a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,4 +10,6 @@ steps: - apt-get update -y - apt-get upgrade -y - pip3 install salt-lint - - salt-lint states + - > + 'find states -type f -name "*.sls" -print0 |' + ' xargs -0 --no-run-if-empty salt-lint' diff --git a/states/apparmor/init.sls b/states/apparmor/init.sls index 0e38fa9..e0e8da6 100644 --- a/states/apparmor/init.sls +++ b/states/apparmor/init.sls @@ -8,7 +8,7 @@ apparmor-{{ cfg }}: - source: "salt://apparmor/{{ cfg }}.j2" - user: root - group: root - - mode: 0644 + - mode: "0644" - template: jinja - watch_in: - service: apparmor-reload diff --git a/states/apt/init.sls b/states/apt/init.sls index 8303f8c..68902b3 100644 --- a/states/apt/init.sls +++ b/states/apt/init.sls @@ -1,11 +1,11 @@ --- {%- from "apt/map.jinja" import apt with context %} -{% for k, v in apt.config.items() -%} -apt-proxy-{{ k }}: +{% for itemkey, itemvalue in apt.config.items() -%} +apt-proxy-{{ itemkey }}: file.managed: - name: /etc/apt/apt.conf.d/{{ k }} - user: root - group: root - - mode: 0644 - - contents: {{ v.content }} + - mode: "0644" + - contents: {{ itemvalue.content }} {% endfor -%} \ No newline at end of file diff --git a/states/gufw/init.sls b/states/gufw/init.sls index b4c7a8d..047689a 100644 --- a/states/gufw/init.sls +++ b/states/gufw/init.sls @@ -2,10 +2,10 @@ gufw-cfg: file.managed: - source: salt://gufw/gufw.cfg - - name: /etc/gufw/gufw.cfg + - name: /etc/gufw/gufw.cfg - user: root - group: root - - mode: 600 + - mode: "0600" gufw-desktop-cfg: file.managed: @@ -13,4 +13,4 @@ gufw-desktop-cfg: - name: /etc/gufw/Desktop.profile - user: root - group: root - - mode: 600 + - mode: "0600" diff --git a/states/maildb/init.sls b/states/maildb/init.sls index 1affbed..f643cc1 100644 --- a/states/maildb/init.sls +++ b/states/maildb/init.sls @@ -16,7 +16,7 @@ maildb-apps-dir: - name: {{ maildb.appdir }} - user: vmail - group: vmail - - mode: 0755 + - mode: "0755" - makedirs: true maildb-script: @@ -25,6 +25,6 @@ maildb-script: - source: salt://maildb/maildb.py - user: vmail - group: vmail - - mode: 0755 + - mode: "0755" - require: - file: maildb-apps-dir diff --git a/states/misc/init.sls b/states/misc/init.sls index fd4b994..e3d0c8a 100644 --- a/states/misc/init.sls +++ b/states/misc/init.sls @@ -4,15 +4,15 @@ misc-public-dir: - name: /home/public - user: root - group: root - - mode: 0755 + - mode: "0755" {%- for file in salt['pillar.get']('misc_files') %} {{ file.name }}: file.managed: - name: {{ file.dest }} - - source: {{ file.src }} - - source_hash: sha256={{ file.checksum }} + - source: {{ file.src }} + - source_hash: sha256={{ file.checksum }} - user: root - group: root - - mode: 644 + - mode: "0644" {%- endfor %} diff --git a/states/netboxinventory/init.sls b/states/netboxinventory/init.sls index b7eae76..c7ee36f 100644 --- a/states/netboxinventory/init.sls +++ b/states/netboxinventory/init.sls @@ -12,8 +12,6 @@ netbox.create_site_{{ salt['grains.get']('location') }}: {%- endif %} {%- if salt['netbox.get'](app='dcim', endpoint='device-roles', name=salt['grains.get']('type')) == {} %} -"{{ salt['netbox.get'](app='dcim', endpoint='sites', name='nurnberg')}}" -"{{ salt['netbox.get'](app='dcim', endpoint='device-roles', name='front')}}" netbox.create_device_role_{{ salt['grains.get']('type') }}: module.run: - name: netbox.create_device_role diff --git a/states/nextcloud_desktop/init.sls b/states/nextcloud_desktop/init.sls index 92bc984..c379c8a 100644 --- a/states/nextcloud_desktop/init.sls +++ b/states/nextcloud_desktop/init.sls @@ -8,7 +8,7 @@ nextcloud-desktop-appimage: - skip_verify: true - user: root - group: root - - mode: 755 + - mode: "0755" - if_missing: {{ nextcloud_desktop.dest_path }}-{{ nextcloud_desktop.version }} nextcloud-desktop-install-link: @@ -25,7 +25,7 @@ nextcloud-desktop-icon: - source: salt://nextcloud_desktop/nextcloud.png - user: root - group: root - - mode: 644 + - mode: "0644" nextcloud-desktop-icon-entry: file.managed: @@ -33,4 +33,4 @@ nextcloud-desktop-icon-entry: - source: salt://nextcloud_desktop/nextcloud.desktop - user: root - group: root - - mode: 644 + - mode: "0644" diff --git a/states/tor/init.sls b/states/tor/init.sls index 9f204f7..1f7a383 100644 --- a/states/tor/init.sls +++ b/states/tor/init.sls @@ -10,7 +10,7 @@ tor-config: - source: salt://tor/torrc.j2 - user: root - group: root - - mode: 0660 + - mode: "0660" - template: jinja - watch_in: - service: tor-service diff --git a/states/vsftpd/init.sls b/states/vsftpd/init.sls index df35e75..cfd20aa 100644 --- a/states/vsftpd/init.sls +++ b/states/vsftpd/init.sls @@ -5,7 +5,7 @@ vsftpd-config: - source: salt://vsftpd/vsftpd.conf.j2 - user: root - group: root - - mode: 644 + - mode: "0644" - template: jinja - watch_in: - service: vsftpd-service diff --git a/states/youtubedl/init.sls b/states/youtubedl/init.sls index f5081f6..f3066a7 100644 --- a/states/youtubedl/init.sls +++ b/states/youtubedl/init.sls @@ -6,6 +6,6 @@ youtubedl-bin: - source: https://github.com/ytdl-org/youtube-dl/releases/download/{{ youtubedl.version }}/youtube-dl - user: root - group: root - - mode: 0775 + - mode: "0775" - template: jinja - skip_verify: true diff --git a/states/ytdlp/init.sls b/states/ytdlp/init.sls index 7c2de59..4532b18 100644 --- a/states/ytdlp/init.sls +++ b/states/ytdlp/init.sls @@ -6,6 +6,6 @@ ytdlp-bin: - source: https://github.com/yt-dlp/yt-dlp/releases/download/{{ ytdlp.version }}/yt-dlp - user: root - group: root - - mode: 0775 + - mode: "0775" - template: jinja - skip_verify: true