From 5e9033f500cfa0cc5c06867ebdccd9e6b3298498 Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Sun, 27 Sep 2020 20:16:39 +0200 Subject: [PATCH 1/2] test(inspec): `_mapdata` files should have `tofs` configuration --- .../default/files/_mapdata/amazonlinux-1.yaml | 10 ++++++++++ .../default/files/_mapdata/amazonlinux-2.yaml | 10 ++++++++++ .../default/files/_mapdata/arch-base-latest.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/centos-6.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/centos-7.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/centos-8.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/debian-10.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/debian-9.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/fedora-31.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/fedora-32.yaml | 10 ++++++++++ .../default/files/_mapdata/opensuse-15.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/ubuntu-16.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/ubuntu-18.yaml | 10 ++++++++++ test/integration/default/files/_mapdata/ubuntu-20.yaml | 10 ++++++++++ 14 files changed, 140 insertions(+) diff --git a/test/integration/default/files/_mapdata/amazonlinux-1.yaml b/test/integration/default/files/_mapdata/amazonlinux-1.yaml index 7566157f..b18b022e 100644 --- a/test/integration/default/files/_mapdata/amazonlinux-1.yaml +++ b/test/integration/default/files/_mapdata/amazonlinux-1.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/amazonlinux-2.yaml b/test/integration/default/files/_mapdata/amazonlinux-2.yaml index ff39b52a..17e0c9f6 100644 --- a/test/integration/default/files/_mapdata/amazonlinux-2.yaml +++ b/test/integration/default/files/_mapdata/amazonlinux-2.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/arch-base-latest.yaml b/test/integration/default/files/_mapdata/arch-base-latest.yaml index 90d1d264..471eafb4 100644 --- a/test/integration/default/files/_mapdata/arch-base-latest.yaml +++ b/test/integration/default/files/_mapdata/arch-base-latest.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/centos-6.yaml b/test/integration/default/files/_mapdata/centos-6.yaml index 4c05c6b8..df92a76e 100644 --- a/test/integration/default/files/_mapdata/centos-6.yaml +++ b/test/integration/default/files/_mapdata/centos-6.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/centos-7.yaml b/test/integration/default/files/_mapdata/centos-7.yaml index 9e37cb89..a9df180f 100644 --- a/test/integration/default/files/_mapdata/centos-7.yaml +++ b/test/integration/default/files/_mapdata/centos-7.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/centos-8.yaml b/test/integration/default/files/_mapdata/centos-8.yaml index c0e6c763..f125f562 100644 --- a/test/integration/default/files/_mapdata/centos-8.yaml +++ b/test/integration/default/files/_mapdata/centos-8.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/debian-10.yaml b/test/integration/default/files/_mapdata/debian-10.yaml index c6c148f1..7c93e859 100644 --- a/test/integration/default/files/_mapdata/debian-10.yaml +++ b/test/integration/default/files/_mapdata/debian-10.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/debian-9.yaml b/test/integration/default/files/_mapdata/debian-9.yaml index 6a4436c1..9dd8a083 100644 --- a/test/integration/default/files/_mapdata/debian-9.yaml +++ b/test/integration/default/files/_mapdata/debian-9.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/fedora-31.yaml b/test/integration/default/files/_mapdata/fedora-31.yaml index b61b597a..caebd27c 100644 --- a/test/integration/default/files/_mapdata/fedora-31.yaml +++ b/test/integration/default/files/_mapdata/fedora-31.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/fedora-32.yaml b/test/integration/default/files/_mapdata/fedora-32.yaml index 19812142..3a506297 100644 --- a/test/integration/default/files/_mapdata/fedora-32.yaml +++ b/test/integration/default/files/_mapdata/fedora-32.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/opensuse-15.yaml b/test/integration/default/files/_mapdata/opensuse-15.yaml index fc1eddcc..4e25e104 100644 --- a/test/integration/default/files/_mapdata/opensuse-15.yaml +++ b/test/integration/default/files/_mapdata/opensuse-15.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/ubuntu-16.yaml b/test/integration/default/files/_mapdata/ubuntu-16.yaml index ebf0904a..71241140 100644 --- a/test/integration/default/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-16.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/ubuntu-18.yaml b/test/integration/default/files/_mapdata/ubuntu-18.yaml index d5605131..2b00d0f5 100644 --- a/test/integration/default/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-18.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': diff --git a/test/integration/default/files/_mapdata/ubuntu-20.yaml b/test/integration/default/files/_mapdata/ubuntu-20.yaml index 2bf6e3e9..8d2d7d00 100644 --- a/test/integration/default/files/_mapdata/ubuntu-20.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-20.yaml @@ -151,6 +151,16 @@ openssh: sshd_config_src: sshd_config sshd_config_user: root sshd_enable: true + tofs: + source_files: + manage ssh_known_hosts file: + - alt_ssh_known_hosts + ssh_config: + - alt_ssh_config + sshd_banner: + - fire_banner + sshd_config: + - alt_sshd_config ssh_config: Hosts: '*': From c0d5052f6a4f86ed78df5f79f4848f24113dbe1a Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Sun, 27 Sep 2020 20:17:05 +0200 Subject: [PATCH 2/2] fix(pillar): `tofs` must not be under `mine_functions` The debug output of test jobs don't show the use of TOFS as it should and the pillar.example show that `tofs` is under `mine_functions` instead of `openssh`. * pillar.example: move `tofs` under `openssh`. * test/salt/pillar/default.sls: ditoo. --- pillar.example | 20 ++++++++++---------- test/salt/pillar/default.sls | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pillar.example b/pillar.example index 2c86d92c..bf3a0f6a 100644 --- a/pillar.example +++ b/pillar.example @@ -361,16 +361,6 @@ openssh: # salt://files/ssh/moduli.hash # These will be automatically referenced to by the ssh_moduli state. -# Required for openssh.known_hosts -mine_functions: - public_ssh_host_keys: - mine_function: cmd.run - cmd: cat /etc/ssh/ssh_host_*_key.pub - python_shell: true - public_ssh_hostname: - mine_function: grains.get - key: id - tofs: # The files_switch key serves as a selector for alternative # directories under the formula files directory. See TOFS pattern @@ -399,3 +389,13 @@ mine_functions: - alt_ssh_config sshd_banner: - fire_banner + +# Required for openssh.known_hosts +mine_functions: + public_ssh_host_keys: + mine_function: cmd.run + cmd: cat /etc/ssh/ssh_host_*_key.pub + python_shell: true + public_ssh_hostname: + mine_function: grains.get + key: id diff --git a/test/salt/pillar/default.sls b/test/salt/pillar/default.sls index be0af660..664b4cd6 100644 --- a/test/salt/pillar/default.sls +++ b/test/salt/pillar/default.sls @@ -189,16 +189,6 @@ openssh: # salt://files/ssh/moduli.hash # These will be automatically referenced to by the ssh_moduli state. -# Required for openssh.known_hosts -mine_functions: - public_ssh_host_keys: - mine_function: cmd.run - cmd: cat /etc/ssh/ssh_host_*_key.pub - python_shell: true - public_ssh_hostname: - mine_function: grains.get - key: id - tofs: # The files_switch key serves as a selector for alternative # directories under the formula files directory. See TOFS pattern @@ -227,3 +217,13 @@ mine_functions: - alt_ssh_config sshd_banner: - fire_banner + +# Required for openssh.known_hosts +mine_functions: + public_ssh_host_keys: + mine_function: cmd.run + cmd: cat /etc/ssh/ssh_host_*_key.pub + python_shell: true + public_ssh_hostname: + mine_function: grains.get + key: id