fix user certificate usage
This commit is contained in:
parent
f3c43eb15c
commit
d5fdceb9d1
3 changed files with 4 additions and 2 deletions
|
@ -4,4 +4,4 @@ all:
|
|||
hosts:
|
||||
lewis:
|
||||
ansible_user: root
|
||||
ansible_host: lewis.dmz
|
||||
ansible_host: lewis.lan
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
CertificateFile /etc/ssh/ssh_user_ed25519_key-cert.pub
|
||||
IdentityFile /etc/ssh/ssh_user_ed25519_key
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
register: cert_stat
|
||||
- name: Generate user certificate
|
||||
command:
|
||||
cmd: "ssh -o ConnectTimeout=3 -o ConnectionAttempts=1 root@hermes.dmz '/root/ca.sh user \"{{ user_public_key }}\" lewis.dmz \"backup\"'"
|
||||
cmd: "ssh -o ConnectTimeout=3 -o ConnectionAttempts=1 root@hermes.dmz '/root/ca.sh user \"{{ user_public_key }}\" lewis.lan \"backup\"'"
|
||||
register: cert
|
||||
delegate_to: localhost
|
||||
when: not cert_stat.stat.exists
|
||||
|
@ -41,4 +41,5 @@
|
|||
copy:
|
||||
dest: "/etc/ssh/ssh_user_ed25519_key-cert.pub"
|
||||
content: "{{ cert.stdout }}"
|
||||
mode: 0600
|
||||
when: not cert_stat.stat.exists
|
||||
|
|
Reference in a new issue