Browse Source

handle creation of ssh certificate when none

python3
Edoardo Putti 7 years ago
parent
commit
57aaf9c123
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      roles/ssh_server/tasks/main.yaml

+ 2
- 1
roles/ssh_server/tasks/main.yaml View File

@ -34,6 +34,7 @@
- name: Validate SSH host certificate if any - name: Validate SSH host certificate if any
ssh_cert: ssh_cert:
register: ssh_verification register: ssh_verification
ignore_errors: yes
- debug: - debug:
var: ssh_verification var: ssh_verification
@ -109,7 +110,7 @@
dest: "/etc/ssh/ssh_host_ed25519_key-cert.pub" dest: "/etc/ssh/ssh_host_ed25519_key-cert.pub"
register: set_pub_key register: set_pub_key
notify: restart ssh notify: restart ssh
when: not ssh_verification
when: ssh_verification.failed
- name: add certificate to sshd config - name: add certificate to sshd config
lineinfile: lineinfile:


Loading…
Cancel
Save