From 6718b2a861af66868e88695795b78fd001fa33a7 Mon Sep 17 00:00:00 2001 From: Alexander Weidinger Date: Mon, 19 Apr 2021 00:31:26 +0200 Subject: [PATCH] feat(check_cmd): run in config directory --- test/integration/default/files/_mapdata/amazonlinux-1.yaml | 1 + test/integration/default/files/_mapdata/amazonlinux-2.yaml | 1 + test/integration/default/files/_mapdata/arch-base-latest.yaml | 1 + test/integration/default/files/_mapdata/centos-6.yaml | 1 + test/integration/default/files/_mapdata/centos-7.yaml | 1 + test/integration/default/files/_mapdata/centos-8.yaml | 1 + test/integration/default/files/_mapdata/debian-10.yaml | 1 + test/integration/default/files/_mapdata/debian-9.yaml | 1 + test/integration/default/files/_mapdata/fedora-31.yaml | 1 + test/integration/default/files/_mapdata/fedora-32.yaml | 1 + test/integration/default/files/_mapdata/fedora-33.yaml | 1 + test/integration/default/files/_mapdata/gentoo-2-sysd.yaml | 1 + test/integration/default/files/_mapdata/gentoo-2-sysv.yaml | 1 + test/integration/default/files/_mapdata/opensuse-15.yaml | 1 + test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml | 1 + test/integration/default/files/_mapdata/oraclelinux-7.yaml | 1 + test/integration/default/files/_mapdata/oraclelinux-8.yaml | 1 + test/integration/default/files/_mapdata/ubuntu-16.yaml | 1 + test/integration/default/files/_mapdata/ubuntu-18.yaml | 1 + test/integration/default/files/_mapdata/ubuntu-20.yaml | 1 + unbound/config/file.sls | 1 + unbound/parameters/defaults.yaml | 1 + unbound/parameters/os_family/FreeBSD.yaml | 1 + unbound/parameters/os_family/RedHat.yaml | 1 + 24 files changed, 24 insertions(+) diff --git a/test/integration/default/files/_mapdata/amazonlinux-1.yaml b/test/integration/default/files/_mapdata/amazonlinux-1.yaml index 86296b7..39d9119 100644 --- a/test/integration/default/files/_mapdata/amazonlinux-1.yaml +++ b/test/integration/default/files/_mapdata/amazonlinux-1.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/amazonlinux-2.yaml b/test/integration/default/files/_mapdata/amazonlinux-2.yaml index d636b46..4655484 100644 --- a/test/integration/default/files/_mapdata/amazonlinux-2.yaml +++ b/test/integration/default/files/_mapdata/amazonlinux-2.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/arch-base-latest.yaml b/test/integration/default/files/_mapdata/arch-base-latest.yaml index 57e4179..8d921e0 100644 --- a/test/integration/default/files/_mapdata/arch-base-latest.yaml +++ b/test/integration/default/files/_mapdata/arch-base-latest.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/centos-6.yaml b/test/integration/default/files/_mapdata/centos-6.yaml index 4e59764..3bddc9f 100644 --- a/test/integration/default/files/_mapdata/centos-6.yaml +++ b/test/integration/default/files/_mapdata/centos-6.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/centos-7.yaml b/test/integration/default/files/_mapdata/centos-7.yaml index e35f770..b2c2e93 100644 --- a/test/integration/default/files/_mapdata/centos-7.yaml +++ b/test/integration/default/files/_mapdata/centos-7.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/centos-8.yaml b/test/integration/default/files/_mapdata/centos-8.yaml index 39e1101..5e240dc 100644 --- a/test/integration/default/files/_mapdata/centos-8.yaml +++ b/test/integration/default/files/_mapdata/centos-8.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/debian-10.yaml b/test/integration/default/files/_mapdata/debian-10.yaml index fe43531..5a4f79d 100644 --- a/test/integration/default/files/_mapdata/debian-10.yaml +++ b/test/integration/default/files/_mapdata/debian-10.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/debian-9.yaml b/test/integration/default/files/_mapdata/debian-9.yaml index 32e1344..3b17d46 100644 --- a/test/integration/default/files/_mapdata/debian-9.yaml +++ b/test/integration/default/files/_mapdata/debian-9.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/fedora-31.yaml b/test/integration/default/files/_mapdata/fedora-31.yaml index 31eb513..917d7ec 100644 --- a/test/integration/default/files/_mapdata/fedora-31.yaml +++ b/test/integration/default/files/_mapdata/fedora-31.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/fedora-32.yaml b/test/integration/default/files/_mapdata/fedora-32.yaml index 9311be7..17afee1 100644 --- a/test/integration/default/files/_mapdata/fedora-32.yaml +++ b/test/integration/default/files/_mapdata/fedora-32.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/fedora-33.yaml b/test/integration/default/files/_mapdata/fedora-33.yaml index ef3c5b3..f5b582b 100644 --- a/test/integration/default/files/_mapdata/fedora-33.yaml +++ b/test/integration/default/files/_mapdata/fedora-33.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml b/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml index 8cbede7..f85e175 100644 --- a/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml +++ b/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml b/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml index c1442ea..d328cbc 100644 --- a/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml +++ b/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/opensuse-15.yaml b/test/integration/default/files/_mapdata/opensuse-15.yaml index b151b43..5d85096 100644 --- a/test/integration/default/files/_mapdata/opensuse-15.yaml +++ b/test/integration/default/files/_mapdata/opensuse-15.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml b/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml index a904dc2..ddb7515 100644 --- a/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml +++ b/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/oraclelinux-7.yaml b/test/integration/default/files/_mapdata/oraclelinux-7.yaml index 70b917b..a3700a7 100644 --- a/test/integration/default/files/_mapdata/oraclelinux-7.yaml +++ b/test/integration/default/files/_mapdata/oraclelinux-7.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/oraclelinux-8.yaml b/test/integration/default/files/_mapdata/oraclelinux-8.yaml index ba98b0a..9be49a0 100644 --- a/test/integration/default/files/_mapdata/oraclelinux-8.yaml +++ b/test/integration/default/files/_mapdata/oraclelinux-8.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/ubuntu-16.yaml b/test/integration/default/files/_mapdata/ubuntu-16.yaml index 234a248..8f9687f 100644 --- a/test/integration/default/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-16.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/ubuntu-18.yaml b/test/integration/default/files/_mapdata/ubuntu-18.yaml index 3488059..568ccbf 100644 --- a/test/integration/default/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-18.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/test/integration/default/files/_mapdata/ubuntu-20.yaml b/test/integration/default/files/_mapdata/ubuntu-20.yaml index d8a2843..2ec0c4e 100644 --- a/test/integration/default/files/_mapdata/ubuntu-20.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-20.yaml @@ -7,6 +7,7 @@ values: added_in_pillar: pillar_value arch: amd64 config: /etc/unbound/unbound.conf + config_dir: /etc/unbound lookup: added_in_lookup: lookup_value master: template-master diff --git a/unbound/config/file.sls b/unbound/config/file.sls index 6056074..2e54d7f 100644 --- a/unbound/config/file.sls +++ b/unbound/config/file.sls @@ -23,6 +23,7 @@ unbound-config-file-file-managed: - makedirs: True - template: jinja - check_cmd: unbound-checkconf + - tmp_dir: {{ unbound.config_dir }} - require: - sls: {{ sls_package_install }} - context: diff --git a/unbound/parameters/defaults.yaml b/unbound/parameters/defaults.yaml index 95f0bb7..b8970f8 100644 --- a/unbound/parameters/defaults.yaml +++ b/unbound/parameters/defaults.yaml @@ -8,6 +8,7 @@ values: name: unbound rootgroup: root config: '/etc/unbound/unbound.conf' + config_dir: '/etc/unbound' service: name: unbound # Just here for testing diff --git a/unbound/parameters/os_family/FreeBSD.yaml b/unbound/parameters/os_family/FreeBSD.yaml index c8b15cb..8b7339f 100644 --- a/unbound/parameters/os_family/FreeBSD.yaml +++ b/unbound/parameters/os_family/FreeBSD.yaml @@ -14,4 +14,5 @@ values: rootgroup: wheel config: '/usr/local/etc/unbound/unbound.conf' + config_dir: '/usr/local/etc/unbound' ... diff --git a/unbound/parameters/os_family/RedHat.yaml b/unbound/parameters/os_family/RedHat.yaml index d5ccf0c..8e0faf1 100644 --- a/unbound/parameters/os_family/RedHat.yaml +++ b/unbound/parameters/os_family/RedHat.yaml @@ -13,4 +13,5 @@ --- values: config: /etc/unbound.conf + config_dir: /etc ...