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/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: '*': 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