From 96bc6e97c0d6711580d378a898f927a75f4c831e Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Wed, 26 Apr 2023 18:53:15 +0200 Subject: [PATCH] create files in lineinfile --- tasks/deploy_certificate.yml | 4 ++++ 1 file changed, 4 insertions(+) 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"