Skip to content
Snippets Groups Projects
Commit 62daaa36 authored by skorpy's avatar skorpy :construction_worker:
Browse files

Use salt['pillar.get'] accessor instead of pillar.get

Fixes salt-lint error 211
parent ea2961cf
No related branches found
No related tags found
1 merge request!527gitlab-ci: Added salt-lint
Pipeline #24062 failed
Showing
with 32 additions and 32 deletions
{%- set gopath = pillar.get('golang:gopath', '/usr/local/go') %} {%- set gopath = salt['pillar.get']('golang:gopath', '/usr/local/go') %}
include: include:
- golang - golang
...@@ -14,7 +14,7 @@ bird-exporter: ...@@ -14,7 +14,7 @@ bird-exporter:
- cwd: {{ gopath }}/src/github.com/czerwonk/bird_exporter - cwd: {{ gopath }}/src/github.com/czerwonk/bird_exporter
- name: go get -v -u github.com/czerwonk/bird_exporter - name: go get -v -u github.com/czerwonk/bird_exporter
- env: - env:
GOPATH: {{ pillar.get('golang:gopath', '/usr/local/go') }} GOPATH: {{ salt['pillar.get']('golang:gopath', '/usr/local/go') }}
- require: - require:
- pkg: golang - pkg: golang
- pkg: git - pkg: git
......
...@@ -7,12 +7,12 @@ table kernel_T_{{ kernel_table }}; ...@@ -7,12 +7,12 @@ table kernel_T_{{ kernel_table }};
protocol kernel kernel_{{ kernel_table }} { protocol kernel kernel_{{ kernel_table }} {
export filter { export filter {
{% if ip_version == 4 %} {% if ip_version == 4 %}
{%- if (pillar.get('source_ip_4', [])) in grains['ip_interfaces']['lo'] %} {%- if (salt['pillar.get']('source_ip_4', [])) in grains['ip_interfaces']['lo'] %}
krt_prefsrc = {{ pillar['source_ip_4'] }}; krt_prefsrc = {{ pillar['source_ip_4'] }};
{%- endif %} {%- endif %}
accept; accept;
{% elif ip_version == 6 %} {% elif ip_version == 6 %}
{%- if (pillar.get('source_ip_6', [])) in grains['ip_interfaces']['lo'] %} {%- if (salt['pillar.get']('source_ip_6', [])) in grains['ip_interfaces']['lo'] %}
krt_prefsrc = {{ pillar['source_ip_6'] }}; krt_prefsrc = {{ pillar['source_ip_6'] }};
{%- endif %} {%- endif %}
accept; accept;
...@@ -31,7 +31,7 @@ protocol kernel kernel_{{ kernel_table }} { ...@@ -31,7 +31,7 @@ protocol kernel kernel_{{ kernel_table }} {
import none; import none;
{%- endif %} {%- endif %}
device routes on; device routes on;
{%- if 'vmhost' in pillar.get('roles', []) %} {%- if 'vmhost' in salt['pillar.get']('roles', []) %}
learn; learn;
{%- endif %} {%- endif %}
......
...@@ -38,7 +38,7 @@ protocol ospf IGP { ...@@ -38,7 +38,7 @@ protocol ospf IGP {
}; };
{%- if type == 'ospf6' %} {%- if type == 'ospf6' %}
{%- if 'nat64' in pillar.get('roles', []) %} {%- if 'nat64' in salt['pillar.get']('roles', []) %}
stubnet 64:ff9b::/96; stubnet 64:ff9b::/96;
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
......
include: include:
- ferm - ferm
- bird.exporter - bird.exporter
{%- if 'gateway' in pillar.get('roles', []) %} {%- if 'gateway' in salt['pillar.get']('roles', []) %}
- bird.radv - bird.radv
- bird.domains - bird.domains
{%- endif %} {%- endif %}
...@@ -155,7 +155,7 @@ bird6: ...@@ -155,7 +155,7 @@ bird6:
- pkg: bird - pkg: bird
- file: /etc/bird/bird6.d - file: /etc/bird/bird6.d
{%- if 'babel' in pillar.get('roles', []) %} {%- if 'babel' in salt['pillar.get']('roles', []) %}
/etc/bird/bird6.d/910-kernel.conf: /etc/bird/bird6.d/910-kernel.conf:
file.managed: file.managed:
- source: salt://bird/files/kernel.conf.j2 - source: salt://bird/files/kernel.conf.j2
...@@ -170,7 +170,7 @@ bird6: ...@@ -170,7 +170,7 @@ bird6:
- require: - require:
- pkg: bird - pkg: bird
- file: /etc/bird/bird6.d - file: /etc/bird/bird6.d
{%- if 'gateway' in pillar.get('roles', []) %} {%- if 'gateway' in salt['pillar.get']('roles', []) %}
/etc/bird/bird6.d/912-kernel.conf: /etc/bird/bird6.d/912-kernel.conf:
file.managed: file.managed:
- source: salt://bird/files/kernel.conf.j2 - source: salt://bird/files/kernel.conf.j2
......
include: include:
- bird - bird
{% for domain_key, domain_val in pillar.get('domains', {}).items() %} {% for domain_key, domain_val in salt['pillar.get']('domains', {}).items() %}
/etc/bird/bird6.d/50-radv-dom{{ domain_val['domain_id'] }}.conf: /etc/bird/bird6.d/50-radv-dom{{ domain_val['domain_id'] }}.conf:
file.managed: file.managed:
......
{% set docker = pillar.get('docker', {}) %} {% set docker = salt['pillar.get']('docker', {}) %}
{% set volume = docker.volume_root | default('/srv/docker') ~ '/cadvisor' %} {% set volume = docker.volume_root | default('/srv/docker') ~ '/cadvisor' %}
{% set image = 'google/cadvisor:latest' %} {% set image = 'google/cadvisor:latest' %}
{% set cadvisor = pillar.get('cadvisor', {}) %} {% set cadvisor = salt['pillar.get']('cadvisor', {}) %}
{% set metrics = cadvisor.get('metrics', {}) %} {% set metrics = cadvisor.get('metrics', {}) %}
{% set port = '9999' %} {% set port = '9999' %}
......
{%- set gopath = pillar.get('golang:gopath', '/usr/local/go') %} {%- set gopath = salt['pillar.get']('golang:gopath', '/usr/local/go') %}
{%- set project = 'cpthook' %} {%- set project = 'cpthook' %}
{%- set uri = 'github.com/fleaz/CptHook' %} {%- set uri = 'github.com/fleaz/CptHook' %}
......
...@@ -21,7 +21,7 @@ user('knot-resolver','knot-resolver') ...@@ -21,7 +21,7 @@ user('knot-resolver','knot-resolver')
cache.size = 1*GB cache.size = 1*GB
{%- if 'forwarder' in pillar.get('roles', []) %} {%- if 'forwarder' in salt['pillar.get']('roles', []) %}
{%- if salt['pillar.get']('dns:dns64', True) and salt['pillar.get']('dns:forwarder:dns64', True) and salt['pillar.get']('dns:kresd:dns64', True) %} {%- if salt['pillar.get']('dns:dns64', True) and salt['pillar.get']('dns:forwarder:dns64', True) and salt['pillar.get']('dns:kresd:dns64', True) %}
modules = { dns64 = '64:ff9b::' } modules = { dns64 = '64:ff9b::' }
{%- endif %} {%- endif %}
......
{%- set gopath = pillar.get('golang:gopath', '/usr/local/go') %} {%- set gopath = salt['pillar.get']('golang:gopath', '/usr/local/go') %}
{%- set gopkg = 'github.com/kumina/unbound_exporter' %} {%- set gopkg = 'github.com/kumina/unbound_exporter' %}
include: include:
...@@ -12,7 +12,7 @@ unbound-exporter: ...@@ -12,7 +12,7 @@ unbound-exporter:
- cwd: {{ gopath }}/src/{{ gopkg }} - cwd: {{ gopath }}/src/{{ gopkg }}
- name: go get -v -u {{ gopkg }} - name: go get -v -u {{ gopkg }}
- env: - env:
GOPATH: {{ pillar.get('golang:gopath', '/usr/local/go') }} GOPATH: {{ salt['pillar.get']('golang:gopath', '/usr/local/go') }}
- require: - require:
- pkg: golang - pkg: golang
- git: unbound-exporter - git: unbound-exporter
......
...@@ -24,7 +24,7 @@ server: ...@@ -24,7 +24,7 @@ server:
harden-glue: yes harden-glue: yes
harden-dnssec-stripped: yes harden-dnssec-stripped: yes
harden-below-nxdomain: no harden-below-nxdomain: no
{%- if 'resolver' in pillar.get('roles', []) %} {%- if 'resolver' in salt['pillar.get']('roles', []) %}
qname-minimisation: yes qname-minimisation: yes
{%- else %} {%- else %}
qname-minimisation: no qname-minimisation: no
...@@ -36,7 +36,7 @@ server: ...@@ -36,7 +36,7 @@ server:
rrset-roundrobin: yes rrset-roundrobin: yes
minimal-responses: no minimal-responses: no
{%- if 'forwarder' in pillar.get('roles', []) and salt['pillar.get']('dns:dns64', True) and salt['pillar.get']('dns:forwarder:dns64', True) and salt['pillar.get']('dns:unbound:dns64', True) %} {%- if 'forwarder' in salt['pillar.get']('roles', []) and salt['pillar.get']('dns:dns64', True) and salt['pillar.get']('dns:forwarder:dns64', True) and salt['pillar.get']('dns:unbound:dns64', True) %}
# DNS64 # DNS64
module-config: "dns64 validator iterator" module-config: "dns64 validator iterator"
dns64-prefix: 64:ff9b::/96 dns64-prefix: 64:ff9b::/96
...@@ -68,7 +68,7 @@ forward-zone: ...@@ -68,7 +68,7 @@ forward-zone:
forward-host: c.ns.ffffm.net forward-host: c.ns.ffffm.net
forward-host: d.ns.freifunk-frankfurt.de forward-host: d.ns.freifunk-frankfurt.de
{%- if 'forwarder' in pillar.get('roles', []) %} {%- if 'forwarder' in salt['pillar.get']('roles', []) %}
forward-zone: forward-zone:
name: "." name: "."
#recursiveA.ns.as64475.net #recursiveA.ns.as64475.net
......
{% set docker = pillar.get('docker', {}) %} {% set docker = salt['pillar.get']('docker', {}) %}
{% set images = docker.get('images', {}) %} {% set images = docker.get('images', {}) %}
{% set containers = docker.get('containers', []) %} {% set containers = docker.get('containers', []) %}
......
{% set docker = pillar.get('docker', {}) %} {% set docker = salt['pillar.get']('docker', {}) %}
{% set images = docker.get('images', {}) %} {% set images = docker.get('images', {}) %}
......
{% if grains['osfinger'] == "Debian-9" %} {% if grains['osfinger'] == "Debian-9" %}
{%- if 'dovecot' in pillar.get('roles', []) %} {%- if 'dovecot' in salt['pillar.get']('roles', []) %}
include: include:
- .dovecot - .dovecot
{%- endif %} {%- endif %}
......
{%- set gopath = pillar.get('golang:gopath', '/usr/local/go') %} {%- set gopath = salt['pillar.get']('golang:gopath', '/usr/local/go') %}
{%- set gopkg = 'git.darmstadt.ccc.de/ffda/fastd-exporter' %} {%- set gopkg = 'git.darmstadt.ccc.de/ffda/fastd-exporter' %}
include: include:
...@@ -12,7 +12,7 @@ fastd-exporter: ...@@ -12,7 +12,7 @@ fastd-exporter:
- cwd: {{ gopath }}/src/{{ gopkg }} - cwd: {{ gopath }}/src/{{ gopkg }}
- name: go get -v -u {{ gopkg }} - name: go get -v -u {{ gopkg }}
- env: - env:
GOPATH: {{ pillar.get('golang:gopath', '/usr/local/go') }} GOPATH: {{ salt['pillar.get']('golang:gopath', '/usr/local/go') }}
- require: - require:
- pkg: golang - pkg: golang
- git: fastd-exporter - git: fastd-exporter
......
# for each domain # for each domain
{%- for domain_key, domain_val in pillar.get('domains', {}).items() %} {%- for domain_key, domain_val in salt['pillar.get']('domains', {}).items() %}
{%- set domain_id = domain_val['domain_id'] %} {%- set domain_id = domain_val['domain_id'] %}
# assign fastd configuration # assign fastd configuration
......
...@@ -21,5 +21,5 @@ golang-env: ...@@ -21,5 +21,5 @@ golang-env:
file.managed: file.managed:
- name: /etc/profile.d/go - name: /etc/profile.d/go
- contents: - contents:
export GOPATH={{ pillar.get('golang:gopath', '/usr/local/go') }} export GOPATH={{ salt['pillar.get']('golang:gopath', '/usr/local/go') }}
export PATH=$PATH:$GOPATH/bin export PATH=$PATH:$GOPATH/bin
{%- if 'grafana' in pillar.get('roles', []) %} {%- if 'grafana' in salt['pillar.get']('roles', []) %}
include: include:
- grafana.grafana - grafana.grafana
{%- endif %} {%- endif %}
......
{%- set includes = [] %} {%- set includes = [] %}
{%- if 'go-carbon' in pillar.get('roles') %} {%- if 'go-carbon' in salt['pillar.get']('roles') %}
{%- do includes.append('.go-carbon') %} {%- do includes.append('.go-carbon') %}
{%- endif %} {%- endif %}
{%- if 'carbonapi' in pillar.get('roles') %} {%- if 'carbonapi' in salt['pillar.get']('roles') %}
{%- do includes.append('.carbonapi') %} {%- do includes.append('.carbonapi') %}
{%- endif %} {%- endif %}
......
include: include:
{%- if 'haproxy' in pillar.get('roles', []) %} {%- if 'haproxy' in salt['pillar.get']('roles', []) %}
- .install - .install
{%- endif %} {%- endif %}
{%- set interfaces = salt['pillar.get']('kea-dhcp:v4:interfaces', []) -%} {%- set interfaces = salt['pillar.get']('kea-dhcp:v4:interfaces', []) -%}
{%- for domain, domainData in pillar.get('domains', {}).items() -%} {%- for domain, domainData in salt['pillar.get']('domains', {}).items() -%}
{%- do interfaces.append(domain ~ '-br') -%} {%- do interfaces.append(domain ~ '-br') -%}
{%- endfor -%} {%- endfor -%}
{ {
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
}{% if not loop.last %},{% endif %} }{% if not loop.last %},{% endif %}
{%- endfor %} {%- endfor %}
{% for domain, domainData in pillar.get('domains', {}).items() if 'IPv4' in domainData %} {% for domain, domainData in salt['pillar.get']('domains', {}).items() if 'IPv4' in domainData %}
{%- set instance = domainData.IPv4 %} {%- set instance = domainData.IPv4 %}
{%- if salt['pillar.get']('kea-dhcp:v4:subnets', []) and instance.subnets %},{%- endif %} {%- if salt['pillar.get']('kea-dhcp:v4:subnets', []) and instance.subnets %},{%- endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment