create files in lineinfile

This commit is contained in:
Pim Kunis 2023-04-26 18:53:15 +02:00
parent 42917c227a
commit 96bc6e97c0

View file

@ -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"