Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Ensure hostkey is created.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Mar 6, 2018
1 parent f6e3a4f commit bdc772d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/files/sshd_config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HostKey /etc/ssh/ssh_host_ed25519_key
HostKey /etc/ssh/{{ hostkey }}
KexAlgorithms curve25519-sha256@libssh.org
Ciphers chacha20-poly1305@openssh.com

Expand Down
9 changes: 8 additions & 1 deletion admin/init.sls
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% from 'common/map.jinja' import root %}
{% from tpldir ~ '/map.jinja' import admin %}
{% from tpldir ~ '/map.jinja' import admin, hostkey %}
admin-packages:
pkg.installed:
Expand Down Expand Up @@ -31,6 +31,13 @@ sshd_config:
- mode: 644
- template: jinja
- source: salt://{{ tpldir }}/files/sshd_config
- defaults:
hostkey: "{{ hostkey }}"
cmd.run:
- name: ssh-keygen -A
- runas: {{ root.user }}
- creates:
- /etc/ssh/{{ hostkey }}
sshkeys-dir:
file.directory:
Expand Down
3 changes: 3 additions & 0 deletions admin/map.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{%
set hostkey = 'ssh_host_ed25519_key'
%}
{%
set admin = {
'ssh_users': [
Expand Down

0 comments on commit bdc772d

Please sign in to comment.