diff --git a/tasks/deploy_certificate.yml b/tasks/deploy_certificate.yml index 739db40..0c7264c 100644 --- a/tasks/deploy_certificate.yml +++ b/tasks/deploy_certificate.yml @@ -34,22 +34,26 @@ lineinfile: path: /etc/ssh/ssh_config.d/certificates.conf line: "CertificateFile /etc/ssh/{{ item.name }}-cert.pub" + create: true when: item.type == "user" - name: Enable user identity lineinfile: path: /etc/ssh/ssh_config.d/certificates.conf line: "IdentityFile /etc/ssh/{{ item.name }}" + create: true when: item.type == "user" - name: Enable host certificate lineinfile: path: /etc/ssh/sshd_config.d/certificates.conf line: "HostCertificate /etc/ssh/{{ item.name }}-cert.pub" + create: true when: item.type == "host" - name: Enable host key lineinfile: path: /etc/ssh/sshd_config.d/certificates.conf line: "HostKey /etc/ssh/{{ item.name }}" + create: true when: item.type == "host"